commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r5055 - trunk/gnue-common/src/apps


From: johannes
Subject: r5055 - trunk/gnue-common/src/apps
Date: Fri, 30 Jan 2004 03:54:33 -0600 (CST)

Author: johannes
Date: 2004-01-30 03:54:32 -0600 (Fri, 30 Jan 2004)
New Revision: 5055

Modified:
   trunk/gnue-common/src/apps/GConfig.py
   trunk/gnue-common/src/apps/__init__.py
Log:
Using '__builtins__' instead of '__builtin__' to fix access-error.
Added workaround to the constructor of GConfigParser to avoid iteration-
Exception on parsing gnue.conf.


Modified: trunk/gnue-common/src/apps/GConfig.py
===================================================================
--- trunk/gnue-common/src/apps/GConfig.py       2004-01-29 21:04:10 UTC (rev 
5054)
+++ trunk/gnue-common/src/apps/GConfig.py       2004-01-30 09:54:32 UTC (rev 
5055)
@@ -189,11 +189,14 @@
     self.__defaults = defaults
     ConfigParser.__init__(self)
     typecasts = self.__typecasts = {}
-    for f in defaults: 
-      try: 
-        typecasts[f['Name'].lower()] = f['Typecast']
-      except KeyError: 
-        typecasts[f['Name'].lower()] = str
+    # FIXME: I don't know what kind of elements are stored in 'defaults'.
+    #        add a correct iteration over the "defaults-dictionary"!
+    if len (defaults) > 0:
+      for f in defaults: 
+        try: 
+          typecasts[f['Name'].lower()] = f['Typecast']
+        except KeyError: 
+          typecasts[f['Name'].lower()] = str
   
   def get(self, section, field): 
     try: 
@@ -282,4 +285,4 @@
     "common_shared": os.path.join (paths.data, "share", "gnue")}
 
     
-    
\ No newline at end of file
+    

Modified: trunk/gnue-common/src/apps/__init__.py
===================================================================
--- trunk/gnue-common/src/apps/__init__.py      2004-01-29 21:04:10 UTC (rev 
5054)
+++ trunk/gnue-common/src/apps/__init__.py      2004-01-30 09:54:32 UTC (rev 
5055)
@@ -36,6 +36,6 @@
 # For Python 2.0/2.1, we add them ourselves
 import sys
 if sys.hexversion < 0x02020000:
-  __builtin__['True'] = 1
-  __builtin__['False'] = 0
+  __builtins__ ['True']  = 1
+  __builtins__ ['False'] = 0
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]