Beispiel #1
0
 def do_register(self, args):
   password   = getpass.getpass(prompt='type in your password:'******'confirm your password:'******'./dbConfig/useradmin', password+'\n')
     print 'Register to PySQL suceessfully!!'
   else:
     print '[Error] the password you tyoe in are not the same :( Plz try again.'
Beispiel #2
0
def setRelation(matchObj, argList, tableConfPath, tableConfContent):
  dataType = matchObj.group().split()[1]
  if dataType != 'integer' and dataType != 'character':
    print '[Syntax Error] try "set --help" or "set -h" to get help.'
    return None
  elif dataType == 'integer':
    columnName = argList.pop(2)
    range = ' '.join(argList[-3:]) if len(argList) > 2 else 'range '+ str(-sys.maxint-1) + ' ' + str(sys.maxint)
  elif dataType == 'character':
    columnName = argList.pop()
    range =  argList.pop() if len(argList) > 2 else '128'
  if tableConfContent.find(columnName) < 0: 
    File.appendNewRecord(None, tableConfPath, columnName + ': ' + dataType + ' ' + range + '\n') 
  else:
    print '[Setting Error] The column name already exist. Plz try "set --help" or "set -h" to get help.'