diff options
author | jblum | 2009-05-14 22:04:10 +0000 |
---|---|---|
committer | jblum | 2009-05-14 22:04:10 +0000 |
commit | 1940d068382c1559ab1e6a100c03971335c2f442 (patch) | |
tree | 0ed6825ceeac5f5ae531cddde8526f7c3055bcbe | |
parent | 766160f355a040204f2229adc61dd64e30ef36fe (diff) | |
download | gnuradio-1940d068382c1559ab1e6a100c03971335c2f442.tar.gz gnuradio-1940d068382c1559ab1e6a100c03971335c2f442.tar.bz2 gnuradio-1940d068382c1559ab1e6a100c03971335c2f442.zip |
Blacklist certain ID names, such as python builtins, and gnuradio modules.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11032 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r-- | grc/src/gui/MainWindow.py | 1 | ||||
-rw-r--r-- | grc/src/gui/NotebookPage.py | 1 | ||||
-rw-r--r-- | grc/src/platforms/python/Param.py | 7 |
3 files changed, 8 insertions, 1 deletions
diff --git a/grc/src/gui/MainWindow.py b/grc/src/gui/MainWindow.py index 2106b8ea1..bd5f73a80 100644 --- a/grc/src/gui/MainWindow.py +++ b/grc/src/gui/MainWindow.py @@ -145,7 +145,6 @@ class MainWindow(gtk.Window): 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, diff --git a/grc/src/gui/NotebookPage.py b/grc/src/gui/NotebookPage.py index 0d6a4a87c..a3ec5b4e2 100644 --- a/grc/src/gui/NotebookPage.py +++ b/grc/src/gui/NotebookPage.py @@ -91,6 +91,7 @@ class NotebookPage(gtk.HBox): 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 diff --git a/grc/src/platforms/python/Param.py b/grc/src/platforms/python/Param.py index e75a882a4..10caa4c21 100644 --- a/grc/src/platforms/python/Param.py +++ b/grc/src/platforms/python/Param.py @@ -63,6 +63,9 @@ class FileParam(EntryParam): 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 @@ class Param(_Param): 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 |