Skip to main content

config selector

Project description

config selector

>>> import os
>>> SELFDIR = os.path.dirname(os.path.abspath('.'))  # or : SELFDIR = os.path.dirname(os.path.abspath(__file__))
>>> PROJECTDIR = os.path.dirname(SELFDIR)
>>> 
>>> from confselector import ConfSelector
>>> ConfSelector.configure([PROJECTDIR, os.path.join(PROJECTDIR, 'config'), os.path.join(PROJECTDIR, 'conf'), SELFDIR, ])
>>> 
>>> pyfile, configobj = ConfSelector.selected('-dev')
>>> print(pyfile, configobj)
>>> 
>>> pyfile, configobj = ConfSelector.selected('-prod')
>>> print(pyfile, configobj)
>>> 
>>> pyfile, configobj = ConfSelector.selected('')
>>> print(pyfile, configobj)
>>> 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confselector-1.0.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page