本文整理汇总了Python中netzob.Common.ResourcesConfiguration.ResourcesConfiguration.getWorkspaceDir方法的典型用法代码示例。如果您正苦于以下问题:Python ResourcesConfiguration.getWorkspaceDir方法的具体用法?Python ResourcesConfiguration.getWorkspaceDir怎么用?Python ResourcesConfiguration.getWorkspaceDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类netzob.Common.ResourcesConfiguration.ResourcesConfiguration
的用法示例。
在下文中一共展示了ResourcesConfiguration.getWorkspaceDir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from netzob.Common.ResourcesConfiguration import ResourcesConfiguration [as 别名]
# 或者: from netzob.Common.ResourcesConfiguration.ResourcesConfiguration import getWorkspaceDir [as 别名]
def __init__(self):
# Parse command line arguments
cmdLine = CommandLine()
cmdLine.parse()
opts = cmdLine.getOptions()
# Current workspace path can be provided in command line argument
if opts.workspace is None:
workspaceDir = ResourcesConfiguration.getWorkspaceDir()
else:
workspaceDir = opts.workspace
# Start the workspace management
self.workspaceSelectorController = WorkspaceSelectorController(self)
self.currentWorkspace = self.workspaceSelectorController.getWorkspace(workspaceDir)
if self.currentWorkspace is None:
sys.exit()
#self.currentWorkspace = self._loadWorkspace(opts)
self.currentProjet = None
# Enable bug reporting, if workspace is configured so or if
# netzob was explicitly started with the "-b" command line
# option.
enableBugReports = self.currentWorkspace.enableBugReporting
if enableBugReports != opts.bugReport:
enableBugReports = opts.bugReport
self.enableBugReporter(enableBugReports)
# Initialize everything else
self._initLogging(opts)
self._initResourcesAndLocales()
# Intialize signals manager
self.signalsManager = SignalsManager()
# Loading the last project
self.currentProject = self.currentWorkspace.getLastProject()
# Initialize a clipboard object
self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
# Check dependencies
if not DepCheck.checkRequiredDependency():
self.log.fatal("Netzob could not start because some of its required dependencies were not found.")
sys.exit()
# Initialize main view
self.log.info("Starting netzob UI")
self.view = None # small hack since the attribute need to exists when the main glade is loaded
self.view = NetzobMainView(self)
# Load all available plugins
NetzobPlugin.loadPlugins(self)
self.view.registerPerspectives()
# Refresh list of available exporter plugins
self.updateListOfExporterPlugins()
# Refresh list of available projects
self.updateListOfAvailableProjects()