[Erp5-report] r34831 jerome - /erp5/trunk/utils/timing_log_parser/parse_timing_log.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Apr 28 14:39:58 CEST 2010


Author: jerome
Date: Wed Apr 28 14:39:57 2010
New Revision: 34831

URL: http://svn.erp5.org?rev=34831&view=rev
Log:
use abspath to guess the path of config file, this unifies the treatment of
full path and name of a file in current directory

Modified:
    erp5/trunk/utils/timing_log_parser/parse_timing_log.py

Modified: erp5/trunk/utils/timing_log_parser/parse_timing_log.py
URL: http://svn.erp5.org/erp5/trunk/utils/timing_log_parser/parse_timing_log.py?rev=34831&r1=34830&r2=34831&view=diff
==============================================================================
--- erp5/trunk/utils/timing_log_parser/parse_timing_log.py [utf8] (original)
+++ erp5/trunk/utils/timing_log_parser/parse_timing_log.py [utf8] Wed Apr 28 14:39:57 2010
@@ -186,15 +186,13 @@
 
 if configuration is None:
   raise ValueError, '--config is mandatory'
+
 config_file = os.path.splitext(os.path.basename(configuration))[0]
-config_path = os.path.dirname(configuration)
-if len(config_path):
-  config_path = [config_path]
-else:
-  config_path = sys.path
+config_path = [os.path.dirname(os.path.abspath(configuration))] + sys.path
 file, path, description = imp.find_module(config_file, config_path)
 module = imp.load_module(config_file, file, path, description)
 file.close()
+
 processLine = module.processLine
 LINE_PATTERN = module.LINE_PATTERN
 date_key = module.date_key




More information about the Erp5-report mailing list