def restore_saved_config(self): return self._backup_restore( inverseDict(self.saves2backups), "Restored the backup of the saved configuration" )
from ufwi_rpcd.common import tr from ufwi_ruleset.common.parameters import ( LOCAL_FIREWALL, NUFW_GATEWAY, LOG_LIMIT_REGEX_STR) from ufwi_rulesetqt.parameters_dialog_ui import Ui_Dialog FIREWALL_TYPE_INDEXES = { LOCAL_FIREWALL: 0, u'gateway': 1, NUFW_GATEWAY: 2, } NUFW_TAB = 2 LDAP_TAB = 3 NUFW_TABS = (NUFW_TAB, LDAP_TAB) FIREWALL_TYPES = inverseDict(FIREWALL_TYPE_INDEXES) NUFW_GATEWAY_INDEX = FIREWALL_TYPE_INDEXES[NUFW_GATEWAY] LOG_LIMIT_REGEXP = QRegExp(LOG_LIMIT_REGEX_STR) class RulesetConfig(dict, Logger): def __init__(self, gui, client): dict.__init__(self) Logger.__init__(self) self.client = client self.gui = gui self.getConfig() self.update_callbacks = [] # def callback(config): ... def getConfig(self): conf = self.client.call('ufwi_ruleset', 'getConfig')