def _appendArgs(url, args):
 if hasattr(args, 'items'):
  args = args.items()
  args.sort()
 if (len(args) == 0):
  return url
 if ('?' in url.rstrip('?')):
  sep = '&'
 else:
  sep = '?'
 return ('%s%s%s' % (url, sep, urlencode(args)))

def _appendArgs ( url , args ) : if hasattr ( args , 'items' ) : args = args . items ( ) args . sort ( ) if ( len ( args ) == 0 ) : return url if ( '?' in url . rstrip ( '?' ) ) : sep = '&' else : sep = '?' return ( '%s%s%s' % ( url , sep , urlencode ( args ) ) )
append some arguments to an http query .