From ab5bd9742a2d1b306e1a65b7f37c46f602c3fdd3 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 8 Sep 2011 14:24:13 +0200 Subject: [PATCH] cleanup for using the config dir properly, and not an hard-wired ~/.sfi/ --- sface/config.py | 7 +++---- sface/sfiprocess.py | 2 +- sface/sfirenew.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sface/config.py b/sface/config.py index bf94cbc..edb2924 100644 --- a/sface/config.py +++ b/sface/config.py @@ -1,7 +1,7 @@ # config for sface # uses in this order # command-line args -# ~/.sfi/sfi_config +# /sfi_config ### import os @@ -28,9 +28,8 @@ class Config: ] def __init__ (self): - print 'WARNING - should pass config dir' - self.dirname=os.path.expanduser("~/.sfi/") - self.read_config() + # no need to do anything here, we need set_dirname later on + pass def get_dirname (self): return self.dirname diff --git a/sface/sfiprocess.py b/sface/sfiprocess.py index f794c63..e06bf9a 100644 --- a/sface/sfiprocess.py +++ b/sface/sfiprocess.py @@ -89,7 +89,7 @@ class SfiProcess(QObject): def __getRSpec(self, mgr): slice = config.getSlice() # Write RSpec to file for testing. - filename = os.path.expanduser("~/.sfi/" + slice + ".rspec") + filename = config.fullpath ("%s.rspec"%slice) try: os.remove(filename) except: diff --git a/sface/sfirenew.py b/sface/sfirenew.py index 863b253..17cd8d6 100644 --- a/sface/sfirenew.py +++ b/sface/sfirenew.py @@ -44,7 +44,7 @@ class SfiRenewer(QObject): def finishedUpdateRecord(self): # we have to force sfi.py to download an updated slice credential - sliceCredName = os.path.expanduser("~/.sfi/slice_" + self.hrn.split(".")[-1] + ".cred") + sliceCredName = config.fullpath("slice_" + self.hrn.split(".")[-1] + ".cred") if os.path.exists(sliceCredName): os.remove(sliceCredName) -- 2.43.0