def deserialize_parameters(self, parameters): """ Load configuration from a string representation that has been created by :func:`serialize_parameters`. Override both if non-guidata attributes need to be serialized or if some guidata parameterss hould not be serialized (e.g. they only affect the visual presentation). :param str parameters: A string representation of all configuration parameters. """ c = UserConfig({}) io = StringIO.StringIO(parameters) c.readfp(io) self.read_config(c,'Config','')
def serialize_parameters(self): """ Return a string representation of the configuration that can be read with :func:`deserialize_parameters`. Override both if non-guidata attributes need to be serialized or if some guidata parameters should not be serialized (e.g. they only affect the visual presentation). :returns: A string representation of all configuration parameters. :rtype: str """ c = UserConfig({}) io = StringIO.StringIO() self.write_config(c,'Config','') c.write(io) return io.getvalue()
add_image_module_path("guidata", "images") _ = get_translation("guidata") DEFAULTS = { 'arrayeditor': { 'font/family/nt': ['Consolas', 'Courier New'], 'font/family/posix': 'Bitstream Vera Sans Mono', 'font/family/mac': 'Monaco', 'font/size': 9, 'font/bold': False, }, 'dicteditor': { 'font/family/nt': ['Consolas', 'Courier New'], 'font/family/posix': 'Bitstream Vera Sans Mono', 'font/family/mac': 'Monaco', 'font/size': 9, 'font/italic': False, 'font/bold': False, }, 'texteditor': { 'font/family/nt': ['Consolas', 'Courier New'], 'font/family/posix': 'Bitstream Vera Sans Mono', 'font/family/mac': 'Monaco', 'font/size': 9, 'font/italic': False, 'font/bold': False, }, } CONF = UserConfig(DEFAULTS)