From 39d5f4aec6848b2568c69b2c76f554ed3920741c Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 9 Jun 2009 22:18:41 +0000 Subject: [PATCH] define Config.config_path which stores the path to the directory where the config file lives --- geni/util/config.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/geni/util/config.py b/geni/util/config.py index 4a94f5b3..9f9e018b 100644 --- a/geni/util/config.py +++ b/geni/util/config.py @@ -30,9 +30,12 @@ class Config: # Load plc_config loaded = False + # path to config.py source path = dirname(abspath(__file__)) self.path = path + # parent directory of config.py source self.basepath = dirname(self.path) + # path to actual config file filename = basename(filepath) alt_file = join(self.path, 'util', filename) geni_file = join(geni, 'util', filename) @@ -43,6 +46,7 @@ class Config: execfile(config_file, self.__dict__) loaded = True self.config_file = config_file + self.config_path = dirname(config_file) break except: pass -- 2.43.0