Changeset 3002
- Timestamp:
- 06/14/08 16:12:05 (5 years ago)
- Location:
- branch/UmitPlugins
- Files:
-
- 6 modified
-
umitCore/BasePaths.py (modified) (2 diffs)
-
umitCore/Paths.py (modified) (1 diff)
-
umitCore/UmitConf.py (modified) (1 diff)
-
umitCore/UserConf.py (modified) (2 diffs)
-
umitGUI/App.py (modified) (3 diffs)
-
umitGUI/MainWindow.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/UmitPlugins/umitCore/BasePaths.py
r2986 r3002 44 44 ICONS_DIR = os.path.join(main_dir, "share", "icons", "umit") 45 45 PIXMAPS_DIR = os.path.join(main_dir, "share", "pixmaps", "umit") 46 PLUGINS_DIR = os.path.join(main_dir, "share", "umit", "plugins") 46 47 DOCS_DIR = os.path.join(main_dir, "share", "doc", "umit") 47 48 … … 58 59 umit_opt = 'umit.opt', 59 60 pixmaps_dir = PIXMAPS_DIR, 61 plugins_dir = PLUGINS_DIR, 60 62 i18n_dir = LOCALE_DIR, 61 63 i18n_message_file = 'umit.mo', -
branch/UmitPlugins/umitCore/Paths.py
r2986 r3002 246 246 and not exists(user_dir): 247 247 mkdir(user_dir) 248 mkdir(join(user_dir, "plugins")) 249 mkdir(join(user_dir, "plugins-download")) 248 250 log.debug(">>> Umit user dir successfully created! %s" % user_dir) 249 251 else: -
branch/UmitPlugins/umitCore/UmitConf.py
r2975 r3002 538 538 not_present = property(get_not_present, set_not_present) 539 539 540 class Plugins(object): 541 def __init__(self): 542 self.parser = Path.config_parser 543 self.section_name = "plugins" 544 545 if not self.parser.has_section(self.section_name): 546 self.create_section() 547 548 def save_changes(self): 549 self.parser.save_changes() 550 551 def create_section(self): 552 from os.path import join 553 self.paths = [join(Path.config_dir, "plugins")] 554 self.plugins = "" 555 556 def __get_it(self, p_name): 557 value = None 558 559 try: value = self.parser.get(self.section_name, p_name) 560 except: pass 561 finally: return self.sanity_settings(value) 562 563 def __set_it(self, property_name, settings): 564 settings = self.sanity_settings(settings) 565 self.parser.set(self.section_name, property_name, settings) 566 567 def sanity_settings(self, settings): 568 # FIXME: more sensed :D 569 if not settings: 570 return "" 571 return settings 572 573 def get_paths(self): 574 return self.__get_it("paths").split(":") 575 576 def set_paths(self, settings): 577 self.__set_it("paths", ":".join(settings)) 578 579 def get_plugins(self): 580 return self.__get_it("plugins").split(":") 581 582 def set_plugins(self, settings): 583 self.__set_it("plugins", ":".join(settings)) 584 585 paths = property(get_paths, set_paths) 586 plugins = property(get_plugins, set_plugins) 587 540 588 # Exceptions 541 589 class ProfileNotFound: -
branch/UmitPlugins/umitCore/UserConf.py
r2975 r3002 39 39 not_present = [58079, 19076, 12703] 40 40 modified = [63881, 42182, 13193] 41 42 [plugins] 43 paths = plugins 41 44 ''' 42 45 … … 18516 18519 return create_config_file(user_dir, 18517 18520 base_paths['config_file'], 18518 umit_conf_content )18521 umit_conf_content % base_paths['plugins_dir']) 18519 18522 18520 18523 def create_wizard(user_dir): -
branch/UmitPlugins/umitGUI/App.py
r2986 r3002 32 32 from umitCore.UmitLogging import log 33 33 34 from umitPlugin.Engine import PluginEngine 34 35 35 36 # Script found at http://www.py2exe.org/index.cgi/HowToDetermineIfRunningFromExe … … 46 47 class App: 47 48 def __init__(self, args=sys.argv): 48 pass 49 # Initialite the PluginEngine 50 PluginEngine() 49 51 50 52 def __parse_cmd_line(self): … … 61 63 62 64 self.main_window.show_all() 65 66 # Load the selected plugins 67 PluginEngine().load_selected_plugins() 63 68 64 69 def safe_shutdown(self, signum, stack): -
branch/UmitPlugins/umitGUI/MainWindow.py
r2980 r3002 56 56 from umitCore.UmitDB import Scans, UmitDB 57 57 58 from umitPlugin.Window import PluginWindow 59 from umitPlugin.Engine import PluginEngine 60 58 61 root = False 59 62 try: … … 93 96 self.set_title(_("Umit")) 94 97 98 self._plugin_win = PluginWindow() 95 99 self._icontheme = gtk.IconTheme() 96 100 self.main_accel_group = gtk.AccelGroup() … … 227 231 _('Use the selected scan profile to create another'), 228 232 self._new_scan_profile_with_selected_cb), 233 234 ('Extensions', 235 gtk.STOCK_INFO, 236 _('_Extensions'), 237 '<Control>e', 238 _('Extensions manager'), 239 self._show_plugin_manager), 229 240 230 241 ('Quit', … … 298 309 <menuitem action='Compare Results'/> 299 310 <menuitem action='Search Scan'/> 311 <separator/> 312 <menuitem action='Extensions'/> 300 313 </menu> 301 314 … … 357 370 title=results[result][1].scan_name) 358 371 page.status.set_search_loaded() 359 372 373 def _show_plugin_manager(self, widget, data=None): 374 self._plugin_win.show() 375 360 376 def _close_scan_cb(self, widget, data=None): 361 377 # data can be none, if the current page is to be closed … … 989 1005 UmitDB().cleanup(SearchConfig().converted_save_time) 990 1006 1007 # Saving the plugins 1008 PluginEngine().plugins.save_changes() 1009 991 1010 gtk.main_quit() 992 1011
