Re: [orca-devel] Some user-settings changes



El 17/06/10 14:16, Joanmarie Diggs escribió:
Hey Javi.

I'm reorganizing the way in which orca store/load its preferences
Yay! :-)

  and i'm a little confused.
:-( I'm still on my first cup of coffee, so maybe (hopefully) I'll
smarten up as the day goes on. But I'm confused about what you're
confused about. :-/

In Orca there are a variable called 'userCustomizableSettings'.
Correct.

  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.
Yup.

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()
It's ugly, but yup.

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'.
Cool.
:P
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.
You mean continue to write out a file, or something else?
Yes, continue writing a file but only containing these exception-settings, i said, settings not included in userCustomizableSettings
As for the imports, you wouldn't need those if you're no longer
importing settings from a module. :-)
ok, just as i thougth ... thx!
BTW, please treat all the debugging-related settings as settings.
mmm, you mean that debuggin-related settings will be in userCustomizableSettings?
Anyhoo, I feel like you're asking a question that I'm not hearing (and
thus not addressing). If that is indeed the case, please try again.
No, I just needed to expose this things for comment it and for you know my work's scope and my advances. At the moment i have a settings_manager and a classic backend (old orca_prefs) ... and it works! At the moment i'm working in gconf backend and i'm trying to simplify backend's creation by making changes I mentioned before.
  In
the meantime, I'll work on my caffeination levels. ;-)
xDD
Take care.
--joanie

Cheers!

--
Javier Hernández<javiube gmail com>



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