Changeset 3126
- Timestamp:
- 07/10/08 14:55:01 (5 years ago)
- Location:
- branch/UmitPlugins/source-plugins
- Files:
-
- 2 modified
-
context-menu/sources/main.py (modified) (2 diffs)
-
flow-analyzer/sources/main.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/UmitPlugins/source-plugins/context-menu/sources/main.py
r3095 r3126 25 25 from umitPlugin.Engine import Plugin 26 26 from higwidgets.higanimates import HIGAnimatedBar 27 from umitGUI.ScanNotebook import ScanNotebookPage, ScanResult 28 29 class MyWidget(HIGAnimatedBar): 30 pass 27 31 28 32 class MenuPlugin(Plugin): … … 32 36 self.id = Core().connect('ScanHostsView-created', self.__on_created_hosts) 33 37 38 for page in Core().get_main_scan_notebook(): 39 if isinstance(page, ScanNotebookPage): 40 self.__on_created_hosts( \ 41 Core(), page.scan_result.scan_host_view) 42 34 43 def stop(self): 35 44 Core().disconnect(self.id) 36 45 46 for page in Core().get_main_scan_notebook(): 47 if not isinstance(page, ScanNotebookPage): 48 continue 49 50 for child in page.scan_result.scan_host_view: 51 if isinstance(child, MyWidget): 52 page.scan_result.scan_host_view.remove(child) 53 child.hide() 54 child.destroy() 55 37 56 def __on_created_hosts(self, core, view): 38 widget = HIGAnimatedBar('<tt>I\'m here spying your hosts</tt>')57 widget = MyWidget('<tt>I\'m here spying your hosts</tt>') 39 58 widget.show() 40 59 view.pack_start(widget, False, False) -
branch/UmitPlugins/source-plugins/flow-analyzer/sources/main.py
r3095 r3126 25 25 from umitPlugin.Engine import Plugin 26 26 from higwidgets.higanimates import HIGAnimatedBar 27 from umitGUI.ScanNotebook import ScanNotebookPage 27 28 28 29 class FlowContainer(gtk.VBox): … … 44 45 paned.pack1(scroll(self.text1)) 45 46 paned.pack2(scroll(self.text2)) 47 48 message = "Not yet avaiable. Try to start a scan!" 49 50 self.text1.get_buffer().set_text(message) 51 self.text2.get_buffer().set_text(message) 46 52 47 53 self.pack_start(paned) … … 50 56 def update(self, page): 51 57 # Simple set the xml and normal output to textviews 52 f = open(page.command_execution.get_xml_output_file(), "r") 53 txt = "".join(f.readlines()) 54 55 self.text1.get_buffer().set_text(txt) 56 57 f = open(page.command_execution.get_output_file(), "r") 58 txt = "".join(f.readlines()) 59 60 self.text2.get_buffer().set_text(txt) 61 58 59 if hasattr(page, 'command_execution') and page.command_execution: 60 f = open(page.command_execution.get_xml_output_file(), "r") 61 txt = "".join(f.readlines()) 62 63 self.text1.get_buffer().set_text(txt) 64 65 f = open(page.command_execution.get_output_file(), "r") 66 txt = "".join(f.readlines()) 67 68 self.text2.get_buffer().set_text(txt) 62 69 63 70 class FlowPlugin(Plugin): … … 65 72 self.id = Core().connect('ScanNotebookPage-created', self.__on_created) 66 73 74 for page in Core().get_main_scan_notebook(): 75 if isinstance(page, ScanNotebookPage): 76 self.__on_created(Core(), page) 77 page.emit('scan-finished') 78 67 79 def stop(self): 68 80 Core().disconnect(self.id) 81 82 for page in Core().get_main_scan_notebook(): 83 if not isinstance(page, ScanNotebookPage): 84 continue 85 86 for child in page.scan_result.scan_result_notebook: 87 if not isinstance(child, FlowContainer): 88 continue 89 90 idx = page.scan_result.scan_result_notebook.page_num(child) 91 page.scan_result.scan_result_notebook.remove_page(idx) 92 93 child.hide() 94 child.destroy() 69 95 70 96 def __on_created(self, core, page):
