[orca-devel] Some user-settings changes



Hi all!

I need some feedback about a couple of questions.

I'm reorganizing the way in which orca store/load its preferences and i'm a little confused.
In Orca there are a variable called 'userCustomizableSettings'. This var contains a list of orca.settings that a user can customize, so i understand that only this customizable settings should be stored in user-settings.py or gconf or whatever.

Actually, user-settings.py are written like this (see inline comments):

self._setupPreferencesDirs()
        # Write ~/.orca/user-settings.py
        #
        # getting orca user-preferences dir and open the file 
        orcaDir = settings.userPrefsDir
        prefs = open(os.path.join(orcaDir, "user-settings.py"), "w")
        
        # here, orca writes into user-settings.py settings like: 
        # some imports, sets debugLevel, debugFile, etc ...
        self._writePreferencesPreamble(prefs)

        # i think real user-settings starts here 
        for key in settings.userCustomizableSettings:
            value = self._getValueForKey(self.prefsDict, key)
            if value != None:
                prefs.writelines("orca.settings.%s = %s\n" % (key, value))
        if self.keyBindingsTreeModel:
            self._writeKeyBindingsMap(prefs, self.keyBindingsTreeModel)
        if self.pronunciationTreeModel:
            self._writePronunciationMap(prefs, self.pronunciationTreeModel)
        # real user-settings finishes here

        # write some other things related with orca_state and closes user-settings.py
        self._writePreferencesPostamble(prefs)
        prefs.close()

I have planed to only store settings contained in 'settings.userCustomizableSettings' and store other configurations in a common place (ie: /usr/local/share/orca/config/...), and of course, delegate its writing into a common module or in 'settings_manager.py'.
I don't sure if it is really necessary to store all things as actually is done and/or make additional imports each time user settings are loaded or reloaded.

These things will provide a simplest way for managing orca user prefs and will be easier to write backends in the future, so, feedback will be gratefully.

Thanks in advance!

-- 
Javier Hernández Antúnez <jhernandez emergya es>
Área de Operaciones

Emergya Consultoría
Tfno: +34 954 51 75 77
Fax: +34 954 51 64 73
www.emergya.es



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]