示例#1
0
def resetParams(db_name):
    """Reset project and activity parameters"""
    _param_registry().clear()
    ProjectParameter.delete().execute()
    ActivityParameter.delete().execute()
    DatabaseParameter.delete().execute()
    Group.delete().execute()
示例#2
0
 def write_database_parameters(self, activate_parameters=False, delete_existing=True):
     if activate_parameters:
         if self.database_parameters is not None:
             if delete_existing:
                 DatabaseParameter.delete().where(DatabaseParameter.database == self.db_name).execute()
             parameters.new_database_parameters(self.database_parameters, self.db_name)
     elif self.database_parameters:
         self.metadata['parameters'] = self.database_parameters
示例#3
0
def resetParams(db_name=None):
    """Clear parameters in live memory (registry) and on disk.
    Clear either all params (project and all db params) or db params from a single database (if db_name provided)"""
    _param_registry().clear(db_name)

    if db_name is None:
        ProjectParameter.delete().execute()
        ActivityParameter.delete().execute()
        DatabaseParameter.delete().execute()
    else:
        ActivityParameter.delete().where(
            ActivityParameter.database == db_name).execute()
        DatabaseParameter.delete().where(
            DatabaseParameter.database == db_name).execute()
        Group.delete().execute()