示例#1
0
文件: project.py 项目: I2PC/scipion
    def __init__(self, **kwargs):
        # Load global configuration
        settings = ProjectSettings()

        # TODO: put the menu part more nicely. From here:
        menu = MenuConfig()

        fileMenu = menu.addSubMenu('File')
        fileMenu.addSubMenu('Browse files', 'browse', icon='fa-folder-open.png')
        fileMenu.addSubMenu('Exit', 'exit', icon='fa-sign-out.png')

        confMenu = menu.addSubMenu('Configuration')
        confMenu.addSubMenu('General', 'general')
        confMenu.addSubMenu('Hosts', 'hosts')
        confMenu.addSubMenu('Protocols', 'protocols')
        confMenu.addSubMenu('User', 'user')

        helpMenu = menu.addSubMenu('Help')
        helpMenu.addSubMenu('Online help', 'online_help', icon='fa-external-link.png')
        helpMenu.addSubMenu('About', 'about', icon='fa-question-circle.png')

        self.menuCfg = menu
        self.generalCfg = settings.getConfig()

        try:
            title = '%s (%s on %s)' % (Message.LABEL_PROJECTS, 
                                       pwutils.getLocalUserName(),
                                       pwutils.getLocalHostName())
        except Exception:
            title = Message.LABEL_PROJECTS
        
        ProjectBaseWindow.__init__(self, title, minsize=(750, 500), **kwargs)
        self.manager = Manager()
        
        self.switchView(VIEW_PROJECTS)
    def __init__(self, **kwargs):
        try:
            title = '%s (%s on %s)' % ('Workflow template customizer',
                                       pwutils.getLocalUserName(),
                                       pwutils.getLocalHostName())
        except Exception:
            title = Message.LABEL_PROJECTS

        settings = ProjectSettings()
        self.generalCfg = settings.getConfig()

        ProjectBaseWindow.__init__(self, title, minsize=(400, 550), **kwargs)
        self.viewFuncs = {VIEW_WIZARD: BoxWizardView}
        self.switchView(VIEW_WIZARD)
示例#3
0
    def __init__(self, **kwargs):
        try:
            title = '%s (%s on %s)' % ('Workflow template customizer',
                                       pwutils.getLocalUserName(),
                                       pwutils.getLocalHostName())
        except Exception:
            title = Message.LABEL_PROJECTS

        settings = ProjectSettings()
        self.generalCfg = settings.getConfig()

        ProjectBaseWindow.__init__(self, title, minsize=(400, 550), **kwargs)
        self.viewFuncs = {VIEW_WIZARD: BoxWizardView}
        self.switchView(VIEW_WIZARD)
示例#4
0
    def __init__(self, config, **kwargs):

        windowTitle = config.get(WINDOWS_TITLE, 'Scipion wizard')
        try:
            title = '%s (%s on %s)' % (windowTitle, pwutils.getLocalUserName(),
                                       pwutils.getLocalHostName())
        except Exception:
            title = windowTitle

        settings = ProjectSettings()
        self.generalCfg = settings.getConfig()

        self.config = config
        ProjectBaseWindow.__init__(self, title, minsize=(400, 550), **kwargs)
        self.viewFuncs = {VIEW_WIZARD: BoxWizardView}
        self.manager = Manager()
        self.switchView(VIEW_WIZARD)
示例#5
0
    def __init__(self, **kwargs):
        # Load global configuration
        settings = ProjectSettings()

        # TODO: put the menu part more nicely. From here:
        menu = MenuConfig()

        fileMenu = menu.addSubMenu('File')
        fileMenu.addSubMenu('Browse files',
                            'browse',
                            icon='fa-folder-open.gif')
        fileMenu.addSubMenu('Exit', 'exit', icon='fa-sign-out.gif')

        confMenu = menu.addSubMenu('Configuration')
        if os.path.exists(pw.Config.SCIPION_CONFIG):
            confMenu.addSubMenu('General', 'general')
        confMenu.addSubMenu('Hosts', 'hosts')
        confMenu.addSubMenu('Protocols', 'protocols')
        if os.path.exists(pw.Config.SCIPION_LOCAL_CONFIG):
            confMenu.addSubMenu('User', 'user')

        helpMenu = menu.addSubMenu('Help')
        helpMenu.addSubMenu('Online help',
                            'online_help',
                            icon='fa-external-link.gif')
        helpMenu.addSubMenu('About', 'about', icon='fa-question-circle.gif')

        self.menuCfg = menu
        self.generalCfg = settings.getConfig()

        try:
            title = '%s (%s on %s)' % (Message.LABEL_PROJECTS,
                                       pwutils.getLocalUserName(),
                                       pwutils.getLocalHostName())
        except Exception:
            title = Message.LABEL_PROJECTS

        ProjectBaseWindow.__init__(self,
                                   title,
                                   minsize=(750, 500),
                                   icon=Icon.SCIPION_ICON_PROJS,
                                   **kwargs)
        self.manager = pw.project.Manager()
        self.switchView(VIEW_PROJECTS)
示例#6
0
    def __init__(self, template, argsList, showScheduleOption, schedule,
                 showProjectOption, showProject, showProjectName):
        try:
            title = '%s (%s on %s)' % ('Workflow template customizer',
                                       pwutils.getLocalUserName(),
                                       pwutils.getLocalHostName())
        except Exception:
            title = Message.LABEL_PROJECTS

        settings = ProjectSettings()
        self.generalCfg = settings.getConfig()

        ProjectBaseWindow.__init__(self, title, minsize=(800, 350))
        self.template = template
        self.argsList = argsList
        self.showScheduleOption = showScheduleOption
        self.schedule = schedule
        self.showProjectOption = showProjectOption
        self.showProject = showProject
        self.showProjectName = showProjectName

        self.viewFuncs = {VIEW_WIZARD: KickoffView}
        self.action = Message.LABEL_BUTTON_CANCEL
        self.switchView(VIEW_WIZARD)
示例#7
0
    def __init__(self, path, master=None):
        # Load global configuration
        self.projName = os.path.basename(path)
        try:
            projTitle = '%s (%s on %s)' % (self.projName,
                                           pwutils.getLocalUserName(),
                                           pwutils.getLocalHostName())
        except Exception:
            projTitle = self.projName

        self.projPath = path
        self.project = self.loadProject()

        # TODO: put the menu part more nicely. From here:
        menu = MenuConfig()

        projMenu = menu.addSubMenu('Project')
        projMenu.addSubMenu('Browse files',
                            'browse',
                            icon='fa-folder-open.gif')
        projMenu.addSubMenu('Remove temporary files',
                            'delete',
                            icon='fa-trash-o.gif')
        projMenu.addSubMenu('Manage project labels', 'labels', icon=Icon.TAGS)
        projMenu.addSubMenu('Toggle color mode',
                            'color_mode',
                            shortCut="Ctrl+t",
                            icon=Icon.ACTION_VISUALIZE)
        projMenu.addSubMenu('Select all protocols',
                            'select all',
                            shortCut="Ctrl+a")
        projMenu.addSubMenu('Find protocol to add',
                            'find protocol',
                            shortCut="Ctrl+f")
        projMenu.addSubMenu('', '')  # add separator
        projMenu.addSubMenu('Import workflow',
                            'load_workflow',
                            icon='fa-download.gif')
        projMenu.addSubMenu('Search workflow',
                            'search_workflow',
                            icon='fa-search.gif')
        if pw.Config.debugOn():
            projMenu.addSubMenu('Export tree graph', 'export_tree')
        projMenu.addSubMenu('', '')  # add separator
        projMenu.addSubMenu('Debug Mode',
                            'debug mode',
                            shortCut="Ctrl+d",
                            icon='debug.gif')
        projMenu.addSubMenu('', '')  # add separator
        projMenu.addSubMenu('Notes', 'notes', icon='fa-pencil.gif')
        projMenu.addSubMenu('', '')  # add separator
        projMenu.addSubMenu('Exit', 'exit', icon='fa-sign-out.gif')

        helpMenu = menu.addSubMenu('Help')
        helpMenu.addSubMenu('Online help',
                            'online_help',
                            icon='fa-external-link.gif')
        helpMenu.addSubMenu('About', 'about', icon='fa-question-circle.gif')
        helpMenu.addSubMenu('Contact support',
                            'contact_us',
                            icon='fa-question-circle.gif')

        self.menuCfg = menu

        if self.project.openedAsReadOnly():
            self.projName += "<READ ONLY>"

        # Notify about the workflow in this project
        self.selectedProtocol = None
        self.showGraph = False
        Plotter.setBackend('TkAgg')
        ProjectBaseWindow.__init__(self,
                                   projTitle,
                                   master,
                                   minsize=(90, 50),
                                   icon=Icon.SCIPION_ICON_PROJ)

        OS.handler().maximizeWindow(self.root)

        self.switchView(VIEW_PROTOCOLS)

        self.initProjectTCPServer(
        )  # Socket thread to communicate with clients

        ProjectWorkflowNotifier(self.project).notifyWorkflow()
示例#8
0
文件: project.py 项目: I2PC/scipion
    def __init__(self, path, master=None):
        # Load global configuration
        self.projName = os.path.basename(path)
        try:
            projTitle = '%s (%s on %s)' % (self.projName,
                                           pwutils.getLocalUserName(),
                                           pwutils.getLocalHostName())
        except Exception:
            projTitle = self.projName 
            
        self.projPath = path
        self.loadProject()

        # TODO: put the menu part more nicely. From here:
        menu = MenuConfig()

        projMenu = menu.addSubMenu('Project')
        projMenu.addSubMenu('Browse files', 'browse',
                            icon='fa-folder-open.png')
        projMenu.addSubMenu('Remove temporary files', 'delete',
                            icon='fa-trash-o.png')
        projMenu.addSubMenu('Manage project labels', 'labels',
                            icon=Icon.TAGS)
        projMenu.addSubMenu('Toogle color mode', 'color_mode',
                            shortCut="Ctrl+t", icon=Icon.ACTION_VISUALIZE)
        projMenu.addSubMenu('Select all protocols', 'select all',
                            shortCut="Ctrl+a")
        projMenu.addSubMenu('Find protocol to add', 'find protocol',
                            shortCut="Ctrl+f")
        projMenu.addSubMenu('', '')  # add separator
        projMenu.addSubMenu('Import workflow', 'load_workflow',
                            icon='fa-download.png')
        projMenu.addSubMenu('Search workflow', 'search_workflow',
                            icon = 'fa-search.png')
        projMenu.addSubMenu('Export tree graph', 'export_tree')
        projMenu.addSubMenu('', '')  # add separator
        projMenu.addSubMenu('Notes', 'notes', icon='fa-pencil.png')
        projMenu.addSubMenu('', '')  # add separator
        projMenu.addSubMenu('Exit', 'exit', icon='fa-sign-out.png')

        helpMenu = menu.addSubMenu('Help')
        helpMenu.addSubMenu('Online help', 'online_help',
                            icon='fa-external-link.png')
        helpMenu.addSubMenu('About', 'about',
                            icon='fa-question-circle.png')
        helpMenu.addSubMenu('Contact support', 'contact_us',
                            icon='fa-question-circle.png')

        self.menuCfg = menu
        # TODO: up to here

        if self.project.openedAsReadOnly():
            self.projName += "<READ ONLY>"

        # Notify about the workflow in this project
        self.icon = self.generalCfg.icon.get()
        self.selectedProtocol = None
        self.showGraph = False
        Plotter.setBackend('TkAgg')
        ProjectBaseWindow.__init__(self, projTitle, master,
                                   icon=self.icon, minsize=(90,50))
        self.root.attributes("-zoomed", True)

        self.switchView(VIEW_PROTOCOLS)

        self.initProjectTCPServer()  # Socket thread to communicate with clients

        ProjectWorkflowNotifier(self.project).notifyWorkflow()