changeset 16:edecb6fbd5a7

further stubbing of ini factory
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 27 May 2011 19:00:43 -0700
parents 0bea5297c156
children 11039ffec62a
files pyloader/factory.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pyloader/factory.py	Fri May 27 18:56:00 2011 -0700
+++ b/pyloader/factory.py	Fri May 27 19:00:43 2011 -0700
@@ -4,6 +4,7 @@
 
 import loader
 import os
+from ConfigParser import SafeConfigParser as ConfigParser
 
 __all__ = ['CircularReferenceError', 'PyFactory', 'IniFactory']
 
@@ -88,3 +89,13 @@
 
     def read(self):
         """reads configuration from an .ini file"""
+
+        here = os.path.dirname(os.path.abspath(self.inifile))
+        
+        # read configuration
+        defaults={'here': here,
+                  'this': os.path.abspath(self.inifile)}
+        parser = ConfigParser(defaults=defaults)
+        parser.optionxform = str # use whole case
+        parser.read(self.inifile)
+