当前位置: 首页>>代码示例>>Python>>正文


Python ResourcesConfiguration.getWorkspaceDir方法代码示例

本文整理汇总了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()
开发者ID:lindi2,项目名称:netzob,代码行数:65,代码来源:NetzobMainController.py


注:本文中的netzob.Common.ResourcesConfiguration.ResourcesConfiguration.getWorkspaceDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。