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


Python Connector.isInstalled方法代码示例

本文整理汇总了Python中connector.Connector.isInstalled方法的典型用法代码示例。如果您正苦于以下问题:Python Connector.isInstalled方法的具体用法?Python Connector.isInstalled怎么用?Python Connector.isInstalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在connector.Connector的用法示例。


在下文中一共展示了Connector.isInstalled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: MainWindow

# 需要导入模块: from connector import Connector [as 别名]
# 或者: from connector.Connector import isInstalled [as 别名]

#.........这里部分代码省略.........
        if not self.afsaccount.isChecked() and not self.cons2.isChecked():
            self.displayErrorMessage('Missing radio box', \
                                     'From where are you running the application?')
            return False
        return True
    
    
    def setUnsetActionCheckBox(self,mode):
        '''
        When unchecking "action" checkboxes, this method makes sure
        that the depended radio-boxes are unset as well. Since we have
        3 different types of radio-boxes we treat 3 modes.
        '''
        if mode == 'sinon':
            dependencies = ['sin_fromcpr','sin_fromfltp','sin_fromtif']
        elif mode == 'paganinon':
            dependencies = ['fltp_fromcpr','fltp_fromtif']
        elif mode == 'reconstructon':
            dependencies = ['rec_fromtif','rec_fromsino','rec_fromfltp']
            
        if not getattr(self,mode).isChecked():
            for param in dependencies:
                ParameterWrap.CLA_dict[param].resetField()
            
            
    def setUnsetFijiOn(self):
        '''
        This method is called when setting to have the preview image in
        Fiji. In that case we check whether the fiji command is
        available in the path and if not we display an error message
        and unset the checkbox again.
        '''
        if self.openinfiji.isChecked():
            if not self.job.isInstalled('fiji'):
                self.openinfiji.setCheckState(0)
                self.displayErrorMessage('Fiji not found', \
                    'fiji must be in PATH, e.g. installed in /urs/bin')
                return
            
            
    def setUnsetComputingLocation(self):
        '''
        This method checks the computing location and directory paths
        and changes the directories if necessary. It should be run when
        toggling the computing location and after loading config files. 
        '''
        paths = ['inputdirectory','cprdirectory','fltpdirectory',
                 'sindirectory','recodirectory']
        
        if not self.target == 'x02da':
            return
        
        for path_item in paths:
            path = str(getattr(self,path_item).text()) 
            if self.afsaccount.isChecked():
                if path[0:16] == '/sls/X02DA/data/' and \
                        self.dirs.homedir[0:16] == '/afs/psi.ch/user':
                    newpath = self.dirs.cons2Path2afs(path)
                    getattr(self,path_item).setText(newpath)
            
            if self.cons2.isChecked():
                if path[0:16] == '/afs/psi.ch/user':
                    newpath = self.dirs.afsPath2Cons2(path)
                    getattr(self,path_item).setText(newpath)

开发者ID:habi,项目名称:grecoman,代码行数:68,代码来源:main.py

示例2: MainWindow

# 需要导入模块: from connector import Connector [as 别名]
# 或者: from connector.Connector import isInstalled [as 别名]

#.........这里部分代码省略.........
        make sure the radiobox from where the computing takes place has been set
        '''
        if not self.afsaccount.isChecked() and not self.cons2.isChecked():
            self.displayErrorMessage('Missing radio box', 'From where are you running the application?')
            return False
        return True
    
    
    def setUnsetSinoCheckBox(self):
        '''
        method that is challed when checking/unchecking the sinobox
        '''
        if not self.sinon.isChecked():
            ParameterWrap.par_dict['sin_fromcpr'].resetField()
            ParameterWrap.par_dict['sin_fromfltp'].resetField()
            
            
    def setUnsetPaganinCheckBox(self):
        '''
        method that is challed when checking/unchecking the Paganin-box
        '''
        if not self.paganinon.isChecked():
            ParameterWrap.par_dict['fltp_fromcpr'].resetField()
            ParameterWrap.par_dict['fltp_fromtif'].resetField()
            
            
    def setUnsetFijiOn(self):
        '''
        method that is called when checking/unchecking whether to open
        preview image in Fiji. in that case we check whether the fiji
        command is available in the path
        '''
        if self.openinfiji.isChecked():
            if not self.job.isInstalled('fiji'):
                self.openinfiji.setCheckState(0)
                self.displayErrorMessage('Fiji not found', 'fiji must be in PATH, e.g. installed in /urs/bin')
                return
            
    
    def resetAllStyleSheets(self):
        '''
        delete all custom stylesheet settings for all class properties
        '''
        for key,param in ParameterWrap.par_dict.iteritems():
            handle = getattr(self,param.name)
            handle.setStyleSheet("")
            
            
    def clearAllFields(self):
        '''
        method for clearing all fields in the GUI
        '''
        for key,param in ParameterWrap.par_dict.iteritems():
            param.resetField()
        self.sinograms.clear()
        self.resetAllStyleSheets()
            
            
    def saveConfigFile(self):
        '''
        method when pressing Menu item for loading config file
        '''
        savefile = QFileDialog.getSaveFileName(self,
                        'Select where the config file should be saved',self.lastdir)
        if not savefile:
            return
开发者ID:arcaduf,项目名称:grecoman,代码行数:70,代码来源:grecoman.py


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