[Idle-dev] Re: config files

Randall Hopper aa8vb@yahoo.com
Mon, 6 Mar 2000 08:07:26 -0500


Jeremy Hylton:
 |I just checked in a simple configuration management framework for IDLE.
 |It gets configurable options from one or more config files instead of
 |from constants in the code itself.
...

As IDLE is a Tkinter app, why not use the Tk mechanism for specifying
resources? It's already generalized for cross-platform support.  On MSWin,
the resources go in the tk.tcl file (according to Brent Welch in his Tcl/Tk
book).  On UNIX, that translates into .Xdefaults (standard X resource cfg
that newbies quickly learn).  The difference is abstracted by Tk and the
app code is the same.

Alternatively, Tkinter supports reading startup "profile" code (written in
Python) for Tkinter apps.  The file loaded is based on the appname and
classname passed to Tk() -- see Tkinter.py::readprofile() for details.

Tim Peters:
 |[Mark Hammond]
 |> I would suggest simply placing it in the Python directory - from
 |> sys.executable.  Who ever complains that this is not sufficient
 |> gets to fix it ;-)
 |
 |Agree with Mark.  Name it idle.ini, for minimal Windows surprise and maximal
 |Windows portability.

Please don't do that.  UNIX users hate that.  I wouldn't ask that you call
it ".idlerc" on MSWindows platforms, for maximal UNIX portability.  :-)

Let's do what make sense on each OS, and if possible use an API that
already supports each platform's conventions transparently (<whatever>.ini on
Windows, ~/.<whatever> on UNIX).

-- 
Randall Hopper
aa8vb@yahoo.com


A recent thread on this topic in c.l.py:

http://www.deja.com/=dnc/[ST_rn=ps]/viewthread.xp?search=thread&recnum=%3c20000225073335.A3192031@vislab.epa.gov%3e%231/1&AN=589831804&svcclass=dnserver&frpage=getdoc.xp