def commit(self): # formatter_functions().reset_to_builtins() pref_value = [] for name, cls in self.funcs.iteritems(): if name not in self.builtins: pref_value.append((cls.name, cls.doc, cls.arg_count, cls.program_text)) self.db.new_api.set_pref('user_template_functions', pref_value) funcs = compile_user_template_functions(pref_value) self.db.new_api.set_user_template_functions(funcs) self.gui.library_view.model().refresh() load_user_template_functions(self.db.library_id, [], funcs) return False
def commit(self): # formatter_functions().reset_to_builtins() pref_value = [] for name, cls in iteritems(self.funcs): if name not in self.builtins: pref_value.append((cls.name, cls.doc, cls.arg_count, cls.program_text)) self.db.new_api.set_pref('user_template_functions', pref_value) funcs = compile_user_template_functions(pref_value) self.db.new_api.set_user_template_functions(funcs) self.gui.library_view.model().refresh() load_user_template_functions(self.db.library_id, [], funcs) return False
def commit(self): pref_value = [] for name, cls in iteritems(self.funcs): if name not in self.builtins: pref_value.append(cls.to_pref()) for v in self.st_funcs.values(): pref_value.append(v.to_pref()) self.db.new_api.set_pref('user_template_functions', pref_value) funcs = compile_user_template_functions(pref_value) self.db.new_api.set_user_template_functions(funcs) self.gui.library_view.model().refresh() load_user_template_functions(self.db.library_id, [], funcs) return False