diff options
author | Auke Booij (tulcod) <auke@tulcod.com> | 2010-07-31 13:21:11 +0200 |
---|---|---|
committer | Auke Booij (tulcod) <auke@tulcod.com> | 2010-07-31 15:10:11 +0200 |
commit | eb8c73c4bef036a3eea61d530c5ab6550d4cee40 (patch) | |
tree | 70bc410b4f59739c2c1c1318c6c6c645510c528a | |
parent | Change config file format (diff) | |
download | g-cran-eb8c73c4bef036a3eea61d530c5ab6550d4cee40.tar.gz g-cran-eb8c73c4bef036a3eea61d530c5ab6550d4cee40.tar.bz2 g-cran-eb8c73c4bef036a3eea61d530c5ab6550d4cee40.zip |
Move g-cran config file
-rw-r--r-- | g_common/g_common.py | 6 | ||||
-rw-r--r-- | g_common/settings.py | 4 | ||||
-rw-r--r-- | g_cran/cran.cfg (renamed from g_cran/g-cran.cfg) | 0 | ||||
-rw-r--r-- | setup.py | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/g_common/g_common.py b/g_common/g_common.py index 73f3e86..c671b5c 100644 --- a/g_common/g_common.py +++ b/g_common/g_common.py @@ -23,7 +23,7 @@ def read_config(conf_file,defaults={}): #returns dict of key=value config file def read_driver_config(driver_name): - conffile=os.path.join('/etc/g-common',driver_name+'.cfg') + conffile=os.path.join(settings.GLOBAL_CONF_DIR,settings.DRIVER_DIR,driver_name+'.cfg') return read_config(conffile,{ #'name':None, #'executable':None, @@ -46,7 +46,7 @@ def action_sync(repo_location,driver,remote_uri): remote_uri=repo_conf['uri'] #todo write repo.cfg - cfg_file=open(os.path.join(repo_location,MYDIR,"repo.cfg"),"w") + cfg_file=open(os.path.join(repo_location,settings.MYDIR,"repo.cfg"),"w") cfg_file.write('driver='+driver) cfg_file.write('uri='+remote_uri) cfg_file.close() @@ -80,7 +80,7 @@ def generate_tree(repo_location): repo_conf=read_repo_config(repo_location) driver_conf=read_driver_config(repo_conf['driver']) - ebuild_file=COMMON_EBUILD_FILE #get from settings + ebuild_file=settings.COMMON_EBUILD_FILE #get from settings packages_list_pipe=subprocess.Popen(fixme,shell=True,stdout=subprocess.PIPE) os.waitpid(process.pid,0) diff --git a/g_common/settings.py b/g_common/settings.py index 4ce4f6a..5163c2f 100644 --- a/g_common/settings.py +++ b/g_common/settings.py @@ -1,3 +1,5 @@ -GLOBAL_CONF_DIR='/etc/g-common/' +GLOBAL_CONF_DIR='/usr/share/g-common/' +DRIVER_DIR='drivers/' +COMMON_EBUILD_FILE=GLOBAL_CONF_DIR+'common.ebuild' MYDIR='.g-common' diff --git a/g_cran/g-cran.cfg b/g_cran/cran.cfg index 31b90d6..31b90d6 100644 --- a/g_cran/g-cran.cfg +++ b/g_cran/cran.cfg @@ -13,7 +13,7 @@ setup(name='G-CRAN', package_data={'g_cran':['convert_packages_rds.R']}, data_files=[ #('/etc/g-common/',['g_common/']), - ('/usr/share/g-common/drivers/',['g_cran/g-cran.cfg']), + ('/usr/share/g-common/drivers/',['g_cran/cran.cfg']), ('/usr/share/g-common/',['g_common/common.ebuild']), ] ) |