Exemplo n.º 1
0
Arquivo: Menu.py Projeto: jfmc/logen
		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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
Arquivo: Menu.py Projeto: boube/minino
 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
Exemplo n.º 5
0
    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()