Did I find the right examples for you? yes no

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

        def parseBool (obj):
  log.debug ("parseBool: " + str(obj))
  obj_str = str(obj).strip().lower()
  if obj == True or obj == 1:
    return True
  if obj == False or obj == 0:
    return False
  if obj_str in ("true", "yes", "1", "y"):
    return True
  if obj_str in ("false", "no", "0", "n"):
    return False
  return None
        


src/g/i/gists.cli-0.351/gists_cli/gists.py   gists.cli(Download)
      return True
    # Shortcut check: is arg a Bool, File, String with spaces/sp char
    if util.parseBool( cmd ) != None:
      return False
    if util.isFileOrDir( cmd ) == True:
    cmd = "list"
  elif alen == 1:
    if util.isGistIdent(args[0]) == True and util.isFileOrDir( args[0] ) == False  and util.parseBool( args[0] ) == None:
      # view ID
      cmd = "view"
      cmd = "new"
  elif alen == 2:
    if util.isGistIdent(args[0]) == True and util.parseBool( args[0] ) == None:
      # get ID 'Dir'
      cmd =  "get"
      # create/new Description and Content
      cmd = "new"
  elif alen == 3 and util.parseBool( args[0] ) != None:
      # create/new Boolean, Description and File
      # create/new Boolean, Description and Content
      cmd = "new"
  elif alen == 3 and util.parseBool( args[0] ) == None and util.isGistIdent(args[0]) == True:

src/g/i/gists.cli-0.351/gists_cli/bak.gists.py   gists.cli(Download)
    cmd = "list"
  elif alen == 1:
    if args[0].strip().isalnum() == True and util.isFileOrDir( args[0] ) == False  and util.parseBool( args[0] ) == None:
      # view ID
      cmd = "view"
      cmd = "create"
  elif alen == 2:
    if str(args[0]).strip().isalnum() and util.parseBool( args[0] ) == None:
      # get ID 'Dir'
      cmd =  "get"
      # create Description and Content
      cmd = "create"
  elif alen == 3 and util.parseBool( args[0] ) != None:
      # create Boolean, Description and File
      # create Boolean, Description and Content
      # create Description and File 
      # create Description and Content 
      if util.parseBool( args[0] ) != None:
        if util.isFileOrDir(args[1]) == True:
          actions.create( public=util.parseBool( args[0] ), filename=args[1] )

src/g/i/gists.cli-0.351/gists_cli/actions.py   gists.cli(Download)
      public = defaults.public
    else:
      public = util.parseBool( util.readConsole(prompt='Public Gist? (y/n):', bool=True) )
 
  if description == None:
    for file in gist['files']:
      print ('  ' + file)
    confirm = util.parseBool( util.readConsole(prompt='Delete Gist? (y/n):', required=False, bool=True) )
 
  if confirm: