def __init__(self): self.list = [ ("PIL", None, ["Legion"], "https://pypi.python.org/pypi/Pillow"), #("wx", None, ["Settings Window"], "http://www.wxpython.org"), ("win32ui", "pywin32", ["very many essential"], "http://sourceforge.net/projects/pywin32") ] warnings = 0 for dep in self.list: is_win32ui = dep[0] == "win32ui" try: exec("import " + dep[0]) except ImportError: if not dep[0] in settings.SETTINGS["one time warnings"]: warnings += 1 settings.SETTINGS["one time warnings"][dep[0]] = True urgency = "You can get it at " if is_win32ui else "If you wish to use those features, you can get it at " print("\n" + dep[0] + " is required for ", dep[2], " features. " + urgency + dep[3] + "\n") else: name = dep[0] if not is_win32ui else dep[1] exec("self." + name.upper() + "=True") if warnings > 0: settings.save_config()
def __init__(self): self.list = [ ("PIL", None, ["Legion"], "https://pypi.python.org/pypi/Pillow"), #("wx", None, ["Settings Window"], "http://www.wxpython.org"), ("win32ui", "pywin32", ["very many essential"], "http://sourceforge.net/projects/pywin32") ] warnings = 0 for dep in self.list: is_win32ui = dep[0] == "win32ui" try: exec ("import " + dep[0]) except ImportError: if not dep[0] in settings.SETTINGS["one time warnings"]: warnings += 1 settings.SETTINGS["one time warnings"][dep[0]] = True urgency = "You can get it at " if is_win32ui else "If you wish to use those features, you can get it at " print("\n" + dep[0] + " is required for ", dep[2], " features. " + urgency + dep[3] + "\n") else: name = dep[0] if not is_win32ui else dep[1] exec ("self." + name.upper() + "=True") if warnings > 0: settings.save_config()
def node_rule_active(self, name, value): print self.get_node_rule(name).node, value self.get_node_rule(name).node.active = value print 5 settings.SETTINGS["nodes"][name] = value settings.save_config()
def toggle_status(nexus): enabled = settings.SETTINGS["miscellaneous"]["status_window_enabled"] if enabled: nexus.intermediary.kill() else: utilities.launch_status() settings.SETTINGS["miscellaneous"]["status_window_enabled"] = not enabled settings.save_config()
def toggle_status(): enabled = settings.SETTINGS["miscellaneous"]["status_window_enabled"] if enabled: control.nexus().intermediary.kill() else: launch_status() settings.SETTINGS["miscellaneous"]["status_window_enabled"] = not enabled settings.save_config()
def set_active_command(enable_disable, ccr_mode): ccr_mode = str(ccr_mode) if int(enable_disable) == 1: set_active(ccr_mode) else: settings.SETTINGS["ccr"]["modes"][ccr_mode] = False set_active() # activate and save settings.save_config() refresh()
def node_rule_active(self, name, value): self.get_node_rule(name).master_node.active = value settings.SETTINGS["nodes"][name] = value settings.save_config()
def receive_settings(data): settings.SETTINGS = data settings.save_config()
def save_it(self, e): settings.SETTINGS = self.tree_to_dictionary() settings.save_config()
def get_settings_from_settings_window(data): settings.SETTINGS = data settings.save_config()