def __init__(self): """Creates a new instance of PyGlassApplication.""" QtCore.QObject.__init__(self) self._qApplication = None self._window = None self._splashScreen = None # Sets a temporary standard out and error for deployed applications in a write allowed # location to prevent failed write results. if PyGlassEnvironment.isDeployed: if appdirs: userDir = appdirs.user_data_dir(self.appID, self.appGroupID) else: userDir = FileUtils.createPath( os.path.expanduser('~'), '.pyglass', self.appGroupID, self.appID, isDir=True) path = FileUtils.createPath( userDir, self.appID + '_out.log', isFile=True) folder = FileUtils.getDirectoryOf(path, createIfMissing=True) sys.stdout = open(path, 'w+') FileUtils.createPath( appdirs.user_data_dir(self.appID, self.appGroupID), self.appID + '_error.log', isFile=True) folder = FileUtils.getDirectoryOf(path, createIfMissing=True) sys.stderr = open(path, 'w+') PyGlassEnvironment.initializeAppSettings(self)
def __init__(self, *args, **kwargs): """Creates a new instance of PyGlassApplication.""" QtCore.QObject.__init__(self) self._qApplication = None self._window = None self._splashScreen = None self.redirectLogOutputs() PyGlassEnvironment.initializeAppSettings(self) self.redirectLogOutputs()