commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10907 - gnuradio/trunk/gnuradio-core/src/python/gnura


From: jcorgan
Subject: [Commit-gnuradio] r10907 - gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr
Date: Fri, 24 Apr 2009 20:25:25 -0600 (MDT)

Author: jcorgan
Date: 2009-04-24 20:25:25 -0600 (Fri, 24 Apr 2009)
New Revision: 10907

Modified:
   gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/prefs.py
Log:
Fixes ticket:312.

Modified: gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/prefs.py
===================================================================
--- gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/prefs.py        
2009-04-24 22:13:01 UTC (rev 10906)
+++ gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/prefs.py        
2009-04-25 02:25:25 UTC (rev 10907)
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -53,8 +53,9 @@
     invoke the methods in this python class.
     """
     def __init__(self):
-        _prefs_base.__init__(self)
-        self.cp = ConfigParser.RawConfigParser()
+       _prefs_base.__init__(self)
+       self.cp = ConfigParser.RawConfigParser()
+       self.__getattr__ = lambda self, name: getattr(self.cp, name)
 
     def _sys_prefs_filenames(self):
         dir = _sys_prefs_dirname()
@@ -65,16 +66,12 @@
         fnames.sort()
         return [os.path.join(dir, f) for f in fnames]
 
-        
     def _read_files(self):
         filenames = self._sys_prefs_filenames()
         filenames.append(_user_prefs_filename())
         #print "filenames: ", filenames
         self.cp.read(filenames)
 
-    def __getattr__(self, name):
-        return getattr(self.cp, name)
-
     # ----------------------------------------------------------------
     # These methods override the C++ virtual methods of the same name
     # ----------------------------------------------------------------





reply via email to

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