def onOk(self, evt): self.p1.saveAllData() self.p2.saveAllData() self.p3.saveAllData() if self.lang.getValue() != self.lang_old: config.importLanguage() evt.Skip() #let the frame now process the Ok event
def onOk(self, evt): self.p1.saveAllData() self.p2.saveAllData() self.p3.saveAllData() #enabled_plugins = set(config.get('plugin', 'enabled_plugins').split(',')) import torchat if self.tor_portable.getValue() == 1: config.set('client', 'tor_config', 'tor_portable') else: config.set('client', 'tor_config', 'tor') enabled_plugins = [] for plugin_name in torchat.PLUGINS: if self.plugins[plugin_name].getValue(): enabled_plugins.append(plugin_name) config.set('plugin', 'enabled_plugins', ','.join(enabled_plugins)) if self.lang.getValue() != self.lang_old: config.importLanguage() evt.Skip() #let the frame now process the Ok event
# plugins with same name in getDataDir()/plugins win over app's plugins/ dir plugins_parent_dirs = [config.getDataDir(), os.path.dirname(__file__)] for plugins_parent_dir in plugins_parent_dirs: plugins_dir = os.path.join(plugins_parent_dir, 'plugins') if os.path.exists(plugins_dir): sys.path.append(plugins_dir) for plugin_file in os.listdir(plugins_dir): if plugin_file.endswith('.py'): plugin_name = plugin_file[:-3] PLUGINS[plugin_name] = __import__(plugin_name) for xx in TRANSLATIONS: if hasattr(PLUGINS[plugin_name], 'NAME_' + xx): dscr = getattr(PLUGINS[plugin_name], 'NAME_' + xx) var_name = 'DSET_PLUGIN_' + plugin_name.upper() setattr(TRANSLATIONS[xx], var_name, dscr) config.importLanguage() def load_plugins(): enabled_plugins = config.get('plugin', 'enabled_plugins').split(',') for plugin_name in enabled_plugins: if plugin_name in PLUGINS: PLUGINS[plugin_name].load(sys.modules[__name__]) def main(): load_plugins() global app print "(2) wxPython version %s" % wx.version() #create the mandatory wx application object if config.isMac(): import tc_mac app = tc_mac.App(redirect=False)