Config-File installieren, default auf ~/etc/userconfig.cfg wenn nicht mit -c ueberschrieben

This commit is contained in:
Marcus Stoegbauer 2013-01-14 15:06:52 +00:00
parent 7fe7c87ca2
commit 046a6badc9
3 changed files with 13 additions and 3 deletions

View File

@ -12,5 +12,6 @@ setup( name="userconfig",
author="Marcus Stoegbauer",
author_email="marcus@grmpf.org",
packages=["Userconfig"],
scripts = ["userconfig.py"]
scripts = ["userconfig.py"],
data_files = [ ('etc', [ 'userconfig.cfg' ]) ]
)

9
userconfig.cfg Normal file
View File

@ -0,0 +1,9 @@
# $Id$
# $URL$
[Main]
configdir = ../
configfile = userconfig.cfg
debug = 0
stamp = %userconfig_generated 1.0%
stampreplace = $userconfig_stamp$

View File

@ -195,7 +195,7 @@ def processAllFiles(destfiles, dirConfig):
# def buildAllFiles
def main():
configfile = ""
configfile = os.environ['HOME']+"/etc/userconfig.cfg"
global verbose
try:
@ -222,7 +222,7 @@ def main():
return 2
# try
if configfile == "":
if not os.path.isfile(configfile):
Tools.error( "No config file specified.")
return 2
# if configfile