Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I wrote the <a href="http://pypi.python.org/pypi/pymlconf" rel="noreferrer">pymlconf</a> for this purpose.the configuration syntax is <a href="http://www.yaml.org/" rel="noreferrer">yaml</a>.</p> <p><strong>For example:</strong></p> <p><em>Config files:</em></p> <pre><code>#app/conf/users/sites.mysite.conf: name: mysite.com owner: name: My Name phone: My Phone Number address: My Address #app/conf/admin/root.conf: server: version: 0.3a sites: admin: name: admin.site.com owner: name: Admin Name phone: Admin Phone Number address: Admin Address #app/conf/admin/server.conf: host: 0.0.0.0 port: 80 #../other_path/../special.conf: licence_file: /path/to/file log_file: /path/to/file #app/src/builtin_config.py: _builtin_config={ 'server':{'name':'Power Server'} } OR: _builtin_config=""" server: name: Power Server """ </code></pre> <p><em>Then look at single line usage:</em></p> <pre><code>from pymlconf import ConfigManager from app.builtin_config import _builtin_config config_root = ConfigManager( _builtin_config, ['app/conf/admin','app/conf/users'], '../other_path/../special.conf') </code></pre> <p><em>Fetching config entries:</em></p> <pre><code># All from app/conf/users/sites.mysite.conf print config_root.sites.mysite.name print config_root.sites.mysite.owner.name print config_root.sites.mysite.owner.address print config_root.sites.mysite.owner.phone # All from app/conf/admin/root.conf print config_root.sites.admin.name print config_root.sites.admin.owner.name print config_root.sites.admin.owner.address print config_root.sites.admin.owner.phone print config_root.server.name # from _builtin_config print config_root.server.version # from app/conf/admin/root.conf print config_root.server.host # from app/conf/admin/server.conf print config_root.server.port # from app/conf/admin/server.conf print config_root.licence_file # from ../other_path/../special.conf print config_root.log_file # from ../other_path/../special.conf </code></pre> <p>It seems this covers your problem.but you can fork it on <a href="https://github.com/pylover/pymlconf" rel="noreferrer">github</a></p> <p>Links:</p> <ol> <li><a href="http://pypi.python.org/pypi/pymlconf" rel="noreferrer">Python package index</a></li> <li><a href="https://github.com/pylover/pymlconf" rel="noreferrer">Source on github</a></li> <li><a href="http://packages.python.org/pymlconf/" rel="noreferrer">Documentation</a></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload