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



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.

> 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?

As for the imports, you wouldn't need those if you're no longer
importing settings from a module. :-)

BTW, please treat all the debugging-related settings as settings.

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. In
the meantime, I'll work on my caffeination levels. ;-)

Take care.
--joanie



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