A way to patch configuration files.
Project description
# amani
#About
Amani is a way to patch configuration files.
#Install
pip install amani
#Usage
constants.py
class A:
a = 1
b = []
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'maps',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '3306',
}
}
try:
import amani
amani.patch(__file__, globals(), prefix='test')
except:
pass
print A.a
print A.b
print DATABASES['default']
test_constants.json
[
["A", "a", 2],
["A", "b", ["test"]],
["DATABASES", "default",
{
"ENGINE": "django.db.backends.mysql",
"NAME": "maps",
"USER": "user",
"PASSWORD": "password",
"HOST": "",
"PORT": "3306"
}
]
]
#About
Amani is a way to patch configuration files.
#Install
pip install amani
#Usage
constants.py
class A:
a = 1
b = []
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'maps',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '3306',
}
}
try:
import amani
amani.patch(__file__, globals(), prefix='test')
except:
pass
print A.a
print A.b
print DATABASES['default']
test_constants.json
[
["A", "a", 2],
["A", "b", ["test"]],
["DATABASES", "default",
{
"ENGINE": "django.db.backends.mysql",
"NAME": "maps",
"USER": "user",
"PASSWORD": "password",
"HOST": "",
"PORT": "3306"
}
]
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
amani-0.0.1.tar.gz
(1.9 kB
view hashes)