Config-File installieren, default auf ~/etc/userconfig.cfg wenn nicht mit -c ueberschrieben
This commit is contained in:
parent
7fe7c87ca2
commit
046a6badc9
3
setup.py
3
setup.py
@ -12,5 +12,6 @@ setup( name="userconfig",
|
|||||||
author="Marcus Stoegbauer",
|
author="Marcus Stoegbauer",
|
||||||
author_email="marcus@grmpf.org",
|
author_email="marcus@grmpf.org",
|
||||||
packages=["Userconfig"],
|
packages=["Userconfig"],
|
||||||
scripts = ["userconfig.py"]
|
scripts = ["userconfig.py"],
|
||||||
|
data_files = [ ('etc', [ 'userconfig.cfg' ]) ]
|
||||||
)
|
)
|
||||||
|
9
userconfig.cfg
Normal file
9
userconfig.cfg
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# $Id$
|
||||||
|
# $URL$
|
||||||
|
|
||||||
|
[Main]
|
||||||
|
configdir = ../
|
||||||
|
configfile = userconfig.cfg
|
||||||
|
debug = 0
|
||||||
|
stamp = %userconfig_generated 1.0%
|
||||||
|
stampreplace = $userconfig_stamp$
|
@ -195,7 +195,7 @@ def processAllFiles(destfiles, dirConfig):
|
|||||||
# def buildAllFiles
|
# def buildAllFiles
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
configfile = ""
|
configfile = os.environ['HOME']+"/etc/userconfig.cfg"
|
||||||
global verbose
|
global verbose
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -222,7 +222,7 @@ def main():
|
|||||||
return 2
|
return 2
|
||||||
# try
|
# try
|
||||||
|
|
||||||
if configfile == "":
|
if not os.path.isfile(configfile):
|
||||||
Tools.error( "No config file specified.")
|
Tools.error( "No config file specified.")
|
||||||
return 2
|
return 2
|
||||||
# if configfile
|
# if configfile
|
||||||
|
Loading…
Reference in New Issue
Block a user