def preLaunch(self): """ Sets ourself up for running Needed for unit tests """ log.debug("preLaunch") self.packageStore = PackageStore() self.ideviceStore = IdeviceStore(self.config) self.ideviceStore.load() # Make it so jelly can load objects from ~/.exe/idevices sys.path.append(self.config.configDir / 'idevices') self.webServer = WebServer(self) # and determine the web server's port before launching the client, so it can use the same port#: self.webServer.find_port()
def preLaunch(self): """ Sets ourself up for running Needed for unit tests """ log.debug("preLaunch") self.ideviceStore = IdeviceStore(self.config) try: self.ideviceStore.load() except: backup = self.config.configDir / 'idevices.backup' if backup.exists(): backup.rmtree() (self.config.configDir / 'idevices').move(backup) self.loadErrors.append( _(u'An error has occurred when loading your Idevice Store. A backup is saved at %s') % backup) self.ideviceStore.load() # Make it so jelly can load objects from ~/.exe/idevices sys.path.append(self.config.configDir/'idevices') self.webServer = WebServer(self, self.packagePath) # and determine the web server's port before launching the client, so it can use the same port#: self.webServer.find_port()
def preLaunch(self): """ Sets ourself up for running Needed for unit tests """ log.debug("preLaunch") self.ideviceStore = IdeviceStore(self.config) try: self.ideviceStore.load() except: backup = self.config.configDir / 'idevices.backup' if backup.exists(): backup.rmtree() (self.config.configDir / 'idevices').move(backup) self.loadErrors.append( _(u'An error has occurred when loading your Idevice Store. A backup is saved at %s' ) % backup) self.ideviceStore.load() # Make it so jelly can load objects from ~/.exe/idevices sys.path.append(self.config.configDir / 'idevices') self.webServer = WebServer(self, self.packagePath) # and determine the web server's port before launching the client, so it can use the same port#: self.webServer.find_port() # Add missing mime types to Twisted for Windows File.contentTypes.update({ '.odt': 'application/vnd.oasis.opendocument.text', '.odp': 'application/vnd.oasis.opendocument.presentation', '.ods': 'application/vnd.oasis.opendocument.spreadsheet', '.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', '.pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation', '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })