On 7/20/07, Darren Dale <[EMAIL PROTECTED]> wrote:

> Although, the config files generated this way are not very well organized, due
> to the seemingly random order that a dict's items are accessed. Look at the
> mpl3.conf file that is generated with Fernando's proof-of-concept:
>
> interactive = False
> backend = 'TkAgg'
> [figure]
>     edgecolor = 'white'
>     facecolor = 0.75
>     dpi = 100
>     figsize = [6.4000000000000004, 4.7999999999999998]
>     [[subplot]]
>         top = 0.90000000000000002
>         right = 0.90000000000000002
>         bottom = 0.10000000000000001
>         left = 0.125
> [lines]
>     linewidth = 2.0
>     linestyle = '-'
> [InitOnly]
>     numerix = 'numpy'
>
> That is not too bad for small config files, but matplotlib's selection of rc
> parameters is pretty large, and it is nice to have them appear in the file in
> a meaningful order.

Not a whole lot we can do about that, since the write method comes
from the configobj code.  Since they try to write in the same place
the original file had things (to preserve comments and such), I don't
think this is easy to fix.

However, it's not all gloom and doom: one can simply generate a config
file from the object description, edit it for ordering, and after that
keep it synced with changes to the object description fairly easily.
The current code only works in one direction: the file overrides the
object.  It should take me about 5 minutes to add a method to go in
the other, since the code is really already there.  With that, you can
then use the workflow of generating once, manually fixing it, and then
updating it from the class.

That way, you can always keep the default file you like as internal
MPL data, but at install time, update that file as needed from runtime
config before putting it in the user's directory.  It lets you keep a
nicely commented, organized file, but update it at installation time
with proper info.

I'll code this up after I get back from lunch, and then I'll really
stop touching this code.  I mean it :)

Cheers,

f

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to