Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(9)  |  Derive(0)  |  Import(0)

        def getCredentials (): 
  global token, username, password
  if os.path.exists( HOME + TOKENFILE):
    file = open(HOME + TOKENFILE, 'r')
    token = file.read().strip()
    log.debug ("Credentials: " + HOME + TOKENFILE + " = " + token)
  elif os.path.exists( HOME + CREDENTIALS):
    file = open(HOME + CREDENTIALS, 'r')
    line = file.read().strip()
    token = line.split(':')[2].split('@')[0]
    log.debug ("Credentials: " + HOME + CREDENTIALS + " = " + token)
  elif username == None or password == None:
    log.debug ("Credentials: No token found.")
    username = raw_input("Username: ")
    password = getpass.getpass()
    token = None
    auth(username, password)
        


src/g/i/gists.cli-0.351/gists_cli/actions.py   gists.cli(Download)
 
    log.debug("Using index: " + str(index))
    api.getCredentials()
    url = "/gists"
    gists = api.get(url)
def list ():
  api.getCredentials()
  log.debug ("Command: List.")
 
  url = "/gists"
def new (public=None,description=None,content=None,filename=None):
  api.getCredentials()
  log.debug ("Command: New: public: '{0}' description: '{1}' filename: '{2}' content: '{3}'.".format(str(public), str(description), str(filename), str(content)))
 
  if public == None:
def _get_gist(id):
  api.getCredentials()
  log.debug ("Internal: _get_gist: " + id) 
 
  url = "/gists/" + id
def append (id, description=None,content=None,filename=None):
  api.getCredentials()
  log.debug ("Command: Append: id: '{0}' description: '{1}' filename: '{2}' content: '{3}'.".format(id, str(description), str(filename), str(content)))
 
  if id[0] in _cmds['#']: