commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r11032 - in gnuradio/trunk/grc/src: gui platforms/pyth


From: jblum
Subject: [Commit-gnuradio] r11032 - in gnuradio/trunk/grc/src: gui platforms/python
Date: Thu, 14 May 2009 16:04:11 -0600 (MDT)

Author: jblum
Date: 2009-05-14 16:04:10 -0600 (Thu, 14 May 2009)
New Revision: 11032

Modified:
   gnuradio/trunk/grc/src/gui/MainWindow.py
   gnuradio/trunk/grc/src/gui/NotebookPage.py
   gnuradio/trunk/grc/src/platforms/python/Param.py
Log:
Blacklist certain ID names, such as python builtins, and gnuradio modules.




Modified: gnuradio/trunk/grc/src/gui/MainWindow.py
===================================================================
--- gnuradio/trunk/grc/src/gui/MainWindow.py    2009-05-14 21:22:56 UTC (rev 
11031)
+++ gnuradio/trunk/grc/src/gui/MainWindow.py    2009-05-14 22:04:10 UTC (rev 
11032)
@@ -145,7 +145,6 @@
                try: #try to load from file
                        if file_path: Messages.send_start_load(file_path)
                        flow_graph = self._platform.get_new_flow_graph()
-                       flow_graph.handle_states = self.handle_states
                        page = NotebookPage(
                                self,
                                flow_graph=flow_graph,

Modified: gnuradio/trunk/grc/src/gui/NotebookPage.py
===================================================================
--- gnuradio/trunk/grc/src/gui/NotebookPage.py  2009-05-14 21:22:56 UTC (rev 
11031)
+++ gnuradio/trunk/grc/src/gui/NotebookPage.py  2009-05-14 22:04:10 UTC (rev 
11032)
@@ -91,6 +91,7 @@
                self.pack_start(self.scrolled_window)
                #inject drawing area and handle states into flow graph
                self.get_flow_graph().drawing_area = self.get_drawing_area()
+               self.get_flow_graph().handle_states = main_window.handle_states
                self.show_all()
 
        def get_drawing_area(self): return self.drawing_area

Modified: gnuradio/trunk/grc/src/platforms/python/Param.py
===================================================================
--- gnuradio/trunk/grc/src/platforms/python/Param.py    2009-05-14 21:22:56 UTC 
(rev 11031)
+++ gnuradio/trunk/grc/src/platforms/python/Param.py    2009-05-14 22:04:10 UTC 
(rev 11032)
@@ -63,6 +63,9 @@
                        self._handle_changed()
                file_dialog.destroy() #destroy the dialog
 
+#blacklist certain ids, its not complete, but should help
+import __builtin__
+ID_BLACKLIST = ['options', 'gr', 'blks2', 'wxgui', 'wx', 'math', 'forms', 
'firdes'] + dir(__builtin__)
 #define types, native python + numpy
 VECTOR_TYPES = (tuple, list, set, numpy.ndarray)
 COMPLEX_TYPES = [complex, numpy.complex, numpy.complex64, numpy.complex128]
@@ -309,6 +312,10 @@
                        except:
                                self._add_error_message('ID "%s" is not 
unique.'%v)
                                raise Exception
+                       try: assert v not in ID_BLACKLIST
+                       except:
+                               self._add_error_message('ID "%s" is 
blacklisted.'%v)
+                               raise Exception
                        return v
                #########################
                # Grid Position Type





reply via email to

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