#29 Add environment variable interpolations to the configuration

v3.0
closed
5
2006-04-12
2006-04-05
No

It'd be nice to be able to use environment variables as
sources of configuration information inside the
configuration file. This can easily be done by using
the feature of the smart ConfigParser objects. This
way, the command lline and the configuration files
would have the same capabilities (in fact the
configuration file would be a little more powerful on
systems where the length of the command line is
restricted).

Suggestion:
-----------

C:\epydoc\epydoc\src\epydoc>svn diff cli.py
Index: cli.py
===================================================================
--- cli.py (revision 1165)
+++ cli.py (working copy)
@@ -38,11 +38,14 @@
A simple example of a config file is::

[epydoc]
- modules: sys, os, os.path, re
+ modules: sys, os, os.path, re,
%(MYSANDBOXPATH)/utilities.py
name: Example
graph: classtree
introspect: no

+All ConfigParser interpolations are done using local
values and
+the environment variables.
+
Verbosity Levels
================
The C{-v} and C{-q} options increase and decrease
verbosity,
@@ -278,7 +281,7 @@
configparser.readfp(fp, configfile)
fp.close()
for optname in configparser.options('epydoc'):
- val = configparser.get('epydoc', optname).strip()
+ val = configparser.get('epydoc', optname,
vars=os.environ).strip()
optname = optname.lower().strip()
if optname in ('modules', 'objects', 'values',
'module', 'object', 'value'):

Discussion

  • Pierre Rouleau

    Pierre Rouleau - 2006-04-05

    delta to cli.py

     
  • Edward Loper

    Edward Loper - 2006-04-12

    Logged In: YES
    user_id=195958

    Added to subversion, revision 1217

     
  • Edward Loper

    Edward Loper - 2006-04-12
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks