← Back to team overview

aesthete-team team mailing list archive

Re: Default plot preferences

 

Actually, it's a little subtle... So, when a new object is created with a
given name_root (you'll see that passed to the aobject.AObject constructor)
Aesthete checks for preference settings for that type of AObject in the
Preferencer (which I suspect is what you're looking for) in aobject.py. It
can be accessed via aobject.get_preferencer()

_Theoretically_ all that should be required is for default preferences to
be set in preferences.default.xml (in share/) and when Aesthete opens it
will load those into Preferencer's XML tree (before any AObjects are
created). Naturally, they will be overridden by any settings in the user's
home directory. The little icon beside most settings widgets is the
preferencer option - if you wish to set a preference for this object (other
than the aesthete default), you can click this and it will write the
current value to ~/.aesthete/preferences.xml during a clean shutdown. The
easiest way to set defaults, other than manually editing
preferences.default.xml, is to (temporarily) copy the default file over
your .aesthete version, set the necessary preferences and return the file
to preferences.default.xml.

This might be a little clearer to explain in person, but it's worthwhile
having on the list.
P

On Wed, Nov 23, 2011 at 10:43 AM, Chris Palmer <cpalmer@xxxxxxxxxxxxxxxxx>wrote:

> Hi all,
>
> I'm just looking at adding some default Glancer settings (show grid, x/y
> min/max, that sort of thing). At first I followed the other preferences
> like concise_property_notebook, but then how does glancer/Plot.py read
> these? By importing the window object from the main program? Seems messy.
>
> I see aobject.py has functions like get_preference and the like, but these
> seem to be geared towards XML stuff. Ideally there would be a global
> preferences db, so that I could do something like:
>
> from prefs import pref_db
> ...
> if pref_db(<pref_setting>) :
> ...
>
>
> Is this already possible in some way? If not, is it worth having? I can
> certainly try to create something that does this if needs be.
>
> Thoughts?
>
> Chris.
>
> --
> Mailing list: https://launchpad.net/~**aesthete-team<https://launchpad.net/%7Eaesthete-team>
> Post to     : aesthete-team@lists.launchpad.**net<aesthete-team@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~**aesthete-team<https://launchpad.net/%7Eaesthete-team>
> More help   : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>

References