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


Python sickbeard.saveAll函数代码示例

本文整理汇总了Python中sickbeard.saveAll函数的典型用法代码示例。如果您正苦于以下问题:Python saveAll函数的具体用法?Python saveAll怎么用?Python saveAll使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: run

    def run(self):
        if self.enable_https:
            protocol = "https"
            self.server = HTTPServer(self.app, no_keep_alive=True,
                                ssl_options={"certfile": self.https_cert, "keyfile": self.https_key})
        else:
            protocol = "http"
            self.server = HTTPServer(self.app, no_keep_alive=True)

        logger.log(u"Starting SickRage on " + protocol + "://" + str(self.options['host']) + ":" + str(
            self.options['port']) + "/")

        try:
            self.server.listen(self.options['port'], self.options['host'])
        except:
            etype, evalue, etb = sys.exc_info()
            logger.log("Could not start webserver on %s. Excpeption: %s, Error: %s" % (self.options['port'], etype, evalue), logger.ERROR)
            return

        try:
            self.io_loop.start()
            self.io_loop.close(True)

            # stop all tasks
            sickbeard.halt()

            # save all shows to DB
            sickbeard.saveAll()

        except ValueError:
            # Ignore errors like "ValueError: I/O operation on closed kqueue fd". These might be thrown during a reload.
            pass
开发者ID:tcavallari,项目名称:SickRage,代码行数:32,代码来源:webserveInit.py

示例2: shutdown

    def shutdown(self, type):
        if sickbeard.started:
            # stop all tasks
            sickbeard.halt()

            # save all shows to DB
            sickbeard.saveAll()

            # shutdown web server
            if self.webserver:
                logger.log("Shutting down Tornado")
                self.webserver.shutDown()
                try:
                    self.webserver.join(10)
                except:
                    pass

            # if run as daemon delete the pidfile
            if self.runAsDaemon and self.CREATEPID:
                self.remove_pid_file(self.PIDFILE)

            if type == sickbeard.events.SystemEvent.RESTART:
                install_type = sickbeard.versionCheckScheduler.action.install_type

                popen_list = []

                if install_type in ("git", "source"):
                    popen_list = [sys.executable, sickbeard.MY_FULLNAME]
                elif install_type == "win":
                    if hasattr(sys, "frozen"):
                        # c:\dir\to\updater.exe 12345 c:\dir\to\sickbeard.exe
                        popen_list = [
                            os.path.join(sickbeard.PROG_DIR, "updater.exe"),
                            str(sickbeard.PID),
                            sys.executable,
                        ]
                    else:
                        logger.log(u"Unknown SR launch method, please file a bug report about this", logger.ERROR)
                        popen_list = [
                            sys.executable,
                            os.path.join(sickbeard.PROG_DIR, "updater.py"),
                            str(sickbeard.PID),
                            sys.executable,
                            sickbeard.MY_FULLNAME,
                        ]

                if popen_list and not sickbeard.NO_RESTART:
                    popen_list += sickbeard.MY_ARGS
                    if "--nolaunch" not in popen_list:
                        popen_list += ["--nolaunch"]
                    logger.log(u"Restarting SickRage with " + str(popen_list))
                    logger.shutdown()  # shutdown the logger to make sure it's released the logfile BEFORE it restarts SR.
                    subprocess.Popen(popen_list, cwd=os.getcwd())

        # system exit
        logger.shutdown()  # Make sure the logger has stopped, just in case
        os._exit(0)
开发者ID:EmnaX,项目名称:SickRage,代码行数:57,代码来源:SickBeard.py

示例3: shutdown

    def shutdown(self, event):
        """
        Shut down SickRage

        :param event: Type of shutdown event, used to see if restart required
        """
        if sickbeard.started:
            sickbeard.halt()  # stop all tasks
            sickbeard.saveAll()  # save all shows to DB

            # shutdown web server
            if self.web_server:
                logger.log("Shutting down Tornado")  # pylint: disable=no-member
                self.web_server.shutDown()

                try:
                    self.web_server.join(10)
                except Exception:  # pylint: disable=broad-except
                    pass

            self.clear_cache()  # Clean cache

            # if run as daemon delete the pid file
            if self.run_as_daemon and self.create_pid:
                self.remove_pid_file(self.pid_file)

            if event == sickbeard.event_queue.Events.SystemEvent.RESTART:
                install_type = sickbeard.versionCheckScheduler.action.install_type

                popen_list = []

                if install_type in ("git", "source"):
                    popen_list = [sys.executable, sickbeard.MY_FULLNAME]
                elif install_type == "win":
                    logger.log(
                        "You are using a binary Windows build of SickRage. "  # pylint: disable=no-member
                        "Please switch to using git.",
                        logger.ERROR,
                    )

                if popen_list and not sickbeard.NO_RESTART:
                    popen_list += sickbeard.MY_ARGS
                    if "--nolaunch" not in popen_list:
                        popen_list += ["--nolaunch"]
                    logger.log("Restarting SickRage with %s" % popen_list)  # pylint: disable=no-member
                    # shutdown the logger to make sure it's released the logfile BEFORE it restarts SR.
                    logger.shutdown()  # pylint: disable=no-member
                    subprocess.Popen(popen_list, cwd=os.getcwd())

        # Make sure the logger has stopped, just in case
        logger.shutdown()  # pylint: disable=no-member
        os._exit(0)  # pylint: disable=protected-access
开发者ID:adaur,项目名称:SickRage,代码行数:52,代码来源:SickBeard.py

示例4: shutdown

    def shutdown(self, type):
        if sickbeard.started:
            # stop all tasks
            sickbeard.halt()

            # save all shows to DB
            sickbeard.saveAll()

            # shutdown web server
            if self.webserver:
                logger.log("Shutting down Tornado")
                self.webserver.shutDown()
                try:
                    self.webserver.join(10)
                except:
                    pass

            # if run as daemon delete the pidfile
            if self.runAsDaemon and self.CREATEPID:
                self.remove_pid_file(self.PIDFILE)

            if type == sickbeard.events.SystemEvent.RESTART:
                install_type = sickbeard.versionCheckScheduler.action.install_type

                popen_list = []

                if install_type in ('git', 'source'):
                    popen_list = [sys.executable, sickbeard.MY_FULLNAME]
                elif install_type == 'win':
                    if hasattr(sys, 'frozen'):
                        # c:\dir\to\updater.exe 12345 c:\dir\to\sickbeard.exe
                        popen_list = [os.path.join(sickbeard.PROG_DIR, 'updater.exe'), str(sickbeard.PID),
                                      sys.executable]
                    else:
                        logger.log(u"Unknown SB launch method, please file a bug report about this", logger.ERROR)
                        popen_list = [sys.executable, os.path.join(sickbeard.PROG_DIR, 'updater.py'),
                                      str(sickbeard.PID),
                                      sys.executable,
                                      sickbeard.MY_FULLNAME]

                if popen_list:
                    popen_list += sickbeard.MY_ARGS
                    if '--nolaunch' not in popen_list:
                        popen_list += ['--nolaunch']
                    logger.log(u"Restarting SickRage with " + str(popen_list))
                    logger.close()
                    subprocess.Popen(popen_list, cwd=os.getcwd())

        # system exit
        os._exit(0)
开发者ID:tattoomees,项目名称:SickRage,代码行数:50,代码来源:SickBeard.py

示例5: shutdown

    def shutdown(self, event):
        """
        Shut down Medusa

        :param event: Type of shutdown event, used to see if restart required
        """
        if sickbeard.started:
            sickbeard.halt()  # stop all tasks
            sickbeard.saveAll()  # save all shows to DB

            # shutdown web server
            if self.web_server:
                logger.log('Shutting down Tornado')
                self.web_server.shutDown()

                try:
                    self.web_server.join(10)
                except Exception:  # pylint: disable=broad-except
                    pass

            self.clear_cache()  # Clean cache

            # if run as daemon delete the pid file
            if self.run_as_daemon and self.create_pid:
                self.remove_pid_file(self.pid_file)

            if event == sickbeard.event_queue.Events.SystemEvent.RESTART:
                install_type = sickbeard.versionCheckScheduler.action.install_type

                popen_list = []

                if install_type in ('git', 'source'):
                    popen_list = [sys.executable, sickbeard.MY_FULLNAME]
                elif install_type == 'win':
                    logger.log('You are using a binary Windows build of Medusa. '
                               'Please switch to using git.', logger.ERROR)

                if popen_list and not sickbeard.NO_RESTART:
                    popen_list += sickbeard.MY_ARGS
                    if '--nolaunch' not in popen_list:
                        popen_list += ['--nolaunch']
                    logger.log('Restarting Medusa with {options}'.format(options=popen_list))
                    # shutdown the logger to make sure it's released the logfile BEFORE it restarts SR.
                    logger.shutdown()
                    subprocess.Popen(popen_list, cwd=os.getcwd())

        # Make sure the logger has stopped, just in case
        logger.shutdown()
        os._exit(0)  # pylint: disable=protected-access
开发者ID:Thraxis,项目名称:pymedusa,代码行数:49,代码来源:SickBeard.py

示例6: shutdown

    def shutdown(self, event):
        if sickbeard.started:
            # stop all tasks
            sickbeard.halt()

            # save all shows to DB
            sickbeard.saveAll()

            # shutdown web server
            if self.webserver:
                logger.log(u"Shutting down Tornado")
                self.webserver.shutDown()

                try:
                    self.webserver.join(10)
                except Exception:
                    pass

            # Clean cache
            self.clear_cache()

            # if run as daemon delete the pidfile
            if self.runAsDaemon and self.CREATEPID:
                self.remove_pid_file(self.PIDFILE)

            if event == sickbeard.event_queue.Events.SystemEvent.RESTART:
                install_type = sickbeard.versionCheckScheduler.action.install_type

                popen_list = []

                if install_type in ('git', 'source'):
                    popen_list = [sys.executable, sickbeard.MY_FULLNAME]
                elif install_type == 'win':
                    logger.log(u"You are using a binary Windows build of SickRage. Please switch to using git.", logger.ERROR)

                if popen_list and not sickbeard.NO_RESTART:
                    popen_list += sickbeard.MY_ARGS
                    if '--nolaunch' not in popen_list:
                        popen_list += ['--nolaunch']
                    logger.log(u"Restarting SickRage with " + str(popen_list))
                    logger.shutdown()  # shutdown the logger to make sure it's released the logfile BEFORE it restarts SR.
                    subprocess.Popen(popen_list, cwd=os.getcwd())

        # system exit
        logger.shutdown()  # Make sure the logger has stopped, just in case
        # pylint: disable=protected-access
        # Access to a protected member of a client class
        os._exit(0)
开发者ID:madtrix74,项目名称:SickRage,代码行数:48,代码来源:SickBeard.py

示例7: shutdown

    def shutdown(self, type):
        if sickbeard.started:
            # stop all tasks
            sickbeard.halt()

            # save all shows to DB
            sickbeard.saveAll()

            # shutdown web server
            if self.webserver:
                logger.log('Shutting down Tornado')
                self.webserver.shutDown()
                try:
                    self.webserver.join(10)
                except:
                    pass

            # if run as daemon delete the pidfile
            if self.runAsDaemon and self.CREATEPID:
                self.remove_pid_file(self.PIDFILE)

            if type == sickbeard.events.SystemEvent.RESTART:
                install_type = sickbeard.versionCheckScheduler.action.install_type

                popen_list = []

                if install_type in ('git', 'source'):
                    popen_list = [sys.executable, sickbeard.MY_FULLNAME]

                if popen_list:
                    popen_list += sickbeard.MY_ARGS
                    if '--nolaunch' not in popen_list:
                        popen_list += ['--nolaunch']
                    logger.log(u'Restarting SickGear with %s' % popen_list)
                    logger.close()
                    subprocess.Popen(popen_list, cwd=os.getcwd())

        # system exit
        os._exit(0)
开发者ID:Koernia,项目名称:SickGear,代码行数:39,代码来源:SickBeard.py

示例8: run

    def run(self):
        global restart, startPort, forceUpdate, noLaunch, web_options

        # Use this PID for everything
        sickbeard.PID = os.getpid()

        try:
            webserveInit.initWebServer(web_options)
        except IOError:
            logger.log(u"Unable to start web server, is something else running on port %d?" % startPort, logger.ERROR)
            if sickbeard.LAUNCH_BROWSER and not sickbeard.DAEMON:
                logger.log(u"Launching browser and exiting", logger.ERROR)
                sickbeard.launchBrowser(startPort)
            sys.exit()

        # Fire up all our threads
        sickbeard.start()

        # Launch browser if we're supposed to
        if sickbeard.LAUNCH_BROWSER and not noLaunch:
            sickbeard.launchBrowser(startPort)

        if sickbeard.LAUNCH_BROWSER and not (noLaunch or sickbeard.DAEMON or restart):
            sickbeard.launchBrowser(startPort)

        # reset this if sickrage was restarted
        restart = False

        # start IO loop
        IOLoop.current().start()

        # close IO loop
        IOLoop.current().close(True)

        # stop all tasks
        sickbeard.halt()

        # save all shows to DB
        sickbeard.saveAll()
开发者ID:BeegorMif,项目名称:HTPC-Manager,代码行数:39,代码来源:SickBeard.py

示例9: autoreload_shutdown

 def autoreload_shutdown():
     logger.log('SickRage is now auto-reloading, please stand by ...')
     webserveInit.server.stop()
     sickbeard.halt()
     sickbeard.saveAll()
     sickbeard.cleanup_tornado_sockets(io_loop)
开发者ID:Micha77,项目名称:SickRage,代码行数:6,代码来源:SickBeard.py


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