Пример #1
0
    def _readSettings(self):        
        settings = QtCore.QSettings(Path.getTempPath().join('ui_settings', apiUtils.getClassName(self) + '.ini'),
                                    QtCore.QSettings.IniFormat)
        settings.beginGroup(apiUtils.getClassName(self))
        
        self.readSettings(settings)

        settings.endGroup()
Пример #2
0
 def __init__(self, func, sort='cumulative', strip_dirs=False):
     super(Profile, self).__init__(func)
     self.sort = sort
     self.strip_dirs = strip_dirs
     base_path = Path.getTempPath().join('profile')
     base_path.makedirs()
     self.profile_path = base_path.join('{0}.{1}.profile'.format(func.__module__, func.__name__))
     self.stats_path = base_path.join('{0}.{1}.log'.format(func.__module__, func.__name__))
     self.profile = cProfile.Profile()
Пример #3
0
    def _readSettings(self):
        settings = QtCore.QSettings(
            Path.getTempPath().join('ui_settings',
                                    apiUtils.getClassName(self) + '.ini'),
            QtCore.QSettings.IniFormat)
        settings.beginGroup(apiUtils.getClassName(self))

        self.readSettings(settings)

        settings.endGroup()
Пример #4
0
 def __init__(self, func, sort='cumulative', strip_dirs=False):
     super(Profile, self).__init__(func)
     self.sort = sort
     self.strip_dirs = strip_dirs
     base_path = Path.getTempPath().join('profile')
     base_path.makedirs()
     self.profile_path = base_path.join('{0}.{1}.profile'.format(
         func.__module__, func.__name__))
     self.stats_path = base_path.join('{0}.{1}.log'.format(
         func.__module__, func.__name__))
     self.profile = cProfile.Profile()
Пример #5
0
 def _tryCredentials(self, msg='P4 Login', force=False):
     #Validate Credentials
     if self.p4User is None or self.p4Password is None:
         success, user, password = LoginWidget.getCredentials(loginMsg=msg,
                                                              credentialsFile=Path.getTempPath().join('p4_login.dat'),
                                                              force=force)
         if not success:
             raise ValueError('Invalid Login Infomation!')
         self.setP4User(user)
         self.setP4Password(password)
     
     self.p4Conn.user = self.p4User
     self.p4Conn.password = self.p4Password
     
     try:
         self.p4Conn.run_login()
     except P4Exception, e:
         self.setP4User(None)
         self.setP4Password(None)
         self._tryCredentials(msg='P4 Login Invalid!', force=True)
Пример #6
0
    def _tryCredentials(self, msg='P4 Login', force=False):
        #Validate Credentials
        if self.p4User is None or self.p4Password is None:
            success, user, password = LoginWidget.getCredentials(
                loginMsg=msg,
                credentialsFile=Path.getTempPath().join('p4_login.dat'),
                force=force)
            if not success:
                raise ValueError('Invalid Login Infomation!')
            self.setP4User(user)
            self.setP4Password(password)

        self.p4Conn.user = self.p4User
        self.p4Conn.password = self.p4Password

        try:
            self.p4Conn.run_login()
        except P4Exception as e:
            self.setP4User(None)
            self.setP4Password(None)
            self._tryCredentials(msg='P4 Login Invalid!', force=True)
        except:
            raise