def dbcredentials(username, password, location, source):
 source_idx = None
 while (source_idx is None):
  source_idx = fetch('SELECT ROWID FROM host WHERE ip = ?', (source,))
  if (len(source_idx) > 0):
   source_idx = source_idx[0][0]
  else:
   dbhost(None, source, None)
   source_idx = None
 return insert('INSERT INTO credentials VALUES (?,?,?,?,?)', (username, password, location, source_idx, _timestamp()))

def dbcredentials ( username , password , location , source ) : source_idx = None while ( source_idx is None ) : source_idx = fetch ( 'SELECT ROWID FROM host WHERE ip = ?' , ( source , ) ) if ( len ( source_idx ) > 0 ) : source_idx = source_idx [ 0 ] [ 0 ] else : dbhost ( None , source , None ) source_idx = None return insert ( 'INSERT INTO credentials VALUES (?,?,?,?,?)' , ( username , password , location , source_idx , _timestamp ( ) ) )
insert credentials into the database .