Exemple #1
0
 def do_set(self, c):
     """sets a VAR1=VALUE1[:VAR2=VALUE2]
     sets a value in the currently loaded database """
     
     if not self.current_param_db: 
         utils.newline_msg("WRN", "current db not set... skipping")
         return 
     
     ret = utils.parse_to_dict(c, allowed_keys=self.possible_keys)
     if not ret: 
         return
     for k in ret.keys():
         self.__dict__[k] = ret[k]
Exemple #2
0
 def do_set(self, c):
     """sets a VAR1=VALUE1[:VAR2=VALUE2]
     sets a value in the currently loaded database """
     if not self.current_param_db: 
         utils.newline_msg("WRN", "current db not set... skipping")
         return 
     
     ret = utils.parse_to_dict(c, allowed_keys=self.possible_keys)
     if not ret: 
         return
     
     for k in ret.keys():
         self.current_param_db.__dict__[k] = ret[k]
         if k == "repeat": continue # repeat is not in the master db (should it be added)
         self.master_db.execute_query( 'UPDATE dbs SET %s= ? WHERE id = ?'%k, ret[k], self.current_param_db.id  )