Exemplo n.º 1
0
    def InitModel(self):

        self.pub('splash_set_title_text', u'booting db\u2026')

        self._http = ClientNetworking.HTTPConnectionManager()

        HydrusController.HydrusController.InitModel(self)

        self._options = self.Read('options')
        self._new_options = self.Read(
            'serialisable',
            HydrusSerialisable.SERIALISABLE_TYPE_CLIENT_OPTIONS)

        HC.options = self._options

        if self._new_options.GetBoolean('use_system_ffmpeg'):

            if HydrusVideoHandling.FFMPEG_PATH.startswith(HC.BIN_DIR):

                HydrusVideoHandling.FFMPEG_PATH = os.path.basename(
                    HydrusVideoHandling.FFMPEG_PATH)

        self._services_manager = ClientCaches.ServicesManager(self)

        self._client_files_manager = ClientCaches.ClientFilesManager(self)

        self._client_session_manager = ClientCaches.HydrusSessionManager(self)

        self._managers['local_booru'] = ClientCaches.LocalBooruCache(self)
        self._managers['tag_censorship'] = ClientCaches.TagCensorshipManager(
            self)
        self._managers['tag_siblings'] = ClientCaches.TagSiblingsManager(self)
        self._managers['tag_parents'] = ClientCaches.TagParentsManager(self)
        self._managers['undo'] = ClientCaches.UndoManager(self)
        self._managers['web_sessions'] = ClientCaches.WebSessionManagerClient(
            self)

        if HC.options['proxy'] is not None:

            (proxytype, host, port, username, password) = HC.options['proxy']

            ClientNetworking.SetProxy(proxytype, host, port, username,
                                      password)

        def wx_code():

            self._caches['images'] = ClientCaches.RenderedImageCache(self)
            self._caches['thumbnail'] = ClientCaches.ThumbnailCache(self)

            CC.GlobalBMPs.STATICInitialise()

        self.CallBlockingToWx(wx_code)

        self.sub(self, 'Clipboard', 'clipboard')
        self.sub(self, 'RestartBooru', 'restart_booru')
Exemplo n.º 2
0
    def InitModel(self):

        self.pub('splash_set_title_text', 'booting db...')

        self._http = ClientNetworking.HTTPConnectionManager()

        HydrusController.HydrusController.InitModel(self)

        self._options = self.Read('options')
        self._new_options = self.Read(
            'serialisable',
            HydrusSerialisable.SERIALISABLE_TYPE_CLIENT_OPTIONS)

        HC.options = self._options

        self._services_manager = ClientCaches.ServicesManager(self)

        self._client_files_manager = ClientCaches.ClientFilesManager(self)

        self._client_session_manager = ClientCaches.HydrusSessionManager(self)

        self._managers['local_booru'] = ClientCaches.LocalBooruCache(self)
        self._managers['tag_censorship'] = ClientCaches.TagCensorshipManager(
            self)
        self._managers['tag_siblings'] = ClientCaches.TagSiblingsManager(self)
        self._managers['tag_parents'] = ClientCaches.TagParentsManager(self)
        self._managers['undo'] = ClientCaches.UndoManager(self)
        self._managers['web_sessions'] = ClientCaches.WebSessionManagerClient(
            self)

        if HC.options['proxy'] is not None:

            (proxytype, host, port, username, password) = HC.options['proxy']

            ClientNetworking.SetProxy(proxytype, host, port, username,
                                      password)

        def wx_code():

            self._caches['fullscreen'] = ClientCaches.RenderedImageCache(
                self, 'fullscreen')
            self._caches['preview'] = ClientCaches.RenderedImageCache(
                self, 'preview')
            self._caches['thumbnail'] = ClientCaches.ThumbnailCache(self)

            CC.GlobalBMPs.STATICInitialise()

        self.CallBlockingToWx(wx_code)

        self.sub(self, 'Clipboard', 'clipboard')
        self.sub(self, 'RestartServer', 'restart_server')
        self.sub(self, 'RestartBooru', 'restart_booru')