def keys_changed(*unused): program, name = _save_name path = choices.save(program, name) if path: try: g.accel_map_save(path) except AttributeError: print "Error saving keybindings to", path
def keys_changed(*unused): site, program, name = _save_name if site: d = basedir.save_config_path(site, program) path = os.path.join(d, name) else: path = choices.save(program, name) if path: try: g.accel_map_save(path) except AttributeError: print "Error saving keybindings to", path
def save(self): """Save all option values. Usually called by OptionsBox().""" assert self.too_late_for_registrations path = choices.save(self.program, self.leaf) if not path: return # Saving is disabled from xml.dom.minidom import Document doc = Document() root = doc.createElement('Options') doc.appendChild(root) for option in self: option._to_xml(root) stream = open(path, 'w') doc.writexml(stream) stream.close()