Пример #1
0
def startup():
    theme = None
    # Should have code to figure out the theme.

    from miro.plat import pipeipc
    try:
        pipe_server = pipeipc.Server()
    except pipeipc.PipeExists:
        pipeipc.send_command_line_args()
        return
    pipe_server.start_process()

    from miro.plat import prelogger
    prelogger.install()

    from miro.plat.utils import initialize_locale
    initialize_locale()

    from miro import bootstrap
    bootstrap.bootstrap()

    from miro.plat import fontinfo
    fontinfo.init()

    from miro.plat import commandline
    args = commandline.get_command_line()[1:]
    if '--theme' in args:
        index = args.index('--theme')
        theme = args[index + 1]
        del args[index:index+1]

    from miro import startup
    startup.initialize(theme)

    from miro.plat import migrateappname
    migrateappname.migrateSupport('Democracy', 'Miro')

    from miro import commandline
    commandline.set_command_line_args(args)

    # Kick off the application
    from miro.plat.frontends.widgets.application import WindowsApplication
    WindowsApplication().run()
    pipe_server.quit()

    # sys.exit isn't sufficient--need to really end the process
    from miro.plat.utils import exit_miro
    exit_miro(0)
Пример #2
0
    def on_shutdown(self):
        try:
            logging.info("Shutting down icon cache updates")
            iconcache.icon_cache_updater.shutdown()
            logging.info("Shutting down movie data updates")
            moviedata.movie_data_updater.shutdown()

            logging.info("Joining event loop ...")
            eventloop.join()
            logging.info("Saving preferences...")
            app.config.save()

            logging.info("Done shutting down.")
            logging.info("Remaining threads are:")
            for thread in threading.enumerate():
                logging.info("%s", thread)

        except StandardError:
            signals.system.failed_exn("while shutting down")
            exit_miro(1)
Пример #3
0
    def on_shutdown(self):
        try:
            logging.info("Shutting down icon cache updates")
            iconcache.icon_cache_updater.shutdown()
            logging.info("Shutting down movie data updates")
            moviedata.movie_data_updater.shutdown()

            logging.info("Joining event loop ...")
            eventloop.join()
            logging.info("Saving preferences...")
            app.config.save()

            logging.info("Done shutting down.")
            logging.info("Remaining threads are:")
            for thread in threading.enumerate():
                logging.info("%s", thread)

        except StandardError:
            signals.system.failed_exn("while shutting down")
            exit_miro(1)
Пример #4
0
    def on_shutdown(self):
        try:
            eventloop.join()
            logging.info("Saving preferences...")
            app.config.save()

            logging.info("Shutting down icon cache updates")
            iconcache.iconCacheUpdater.shutdown()
            logging.info("Shutting down movie data updates")
            moviedata.movie_data_updater.shutdown()

            logging.info("Done shutting down.")
            logging.info("Remaining threads are:")
            for thread in threading.enumerate():
                logging.info("%s", thread)

        except (SystemExit, KeyboardInterrupt):
            raise
        except:
            signals.system.failed_exn("while shutting down")
            exit_miro(1)
Пример #5
0
    import sys
    import logging
    logging.basicConfig(level=logging.CRITICAL)

    from miro import app
    app.debugmode = True

    from miro.plat import utils
    utils.initialize_locale()

    from miro import bootstrap
    bootstrap.bootstrap()

    from miro import test
    from miro.plat import resources

    sys.path.append(resources.app_root())
    test.run_tests()


if __name__ == "__main__":
    if "--unittest" in sys.argv:
        sys.argv.remove("--unittest")
        test_startup(sys.argv)
    else:
        startup(sys.argv)

    # sys.exit isn't sufficient--need to really end the process
    from miro.plat.utils import exit_miro
    exit_miro(0)
Пример #6
0
    import sys
    import logging
    logging.basicConfig(level=logging.CRITICAL)

    from miro import app
    app.debugmode = True

    from miro.plat import utils
    utils.initialize_locale()

    from miro import bootstrap
    bootstrap.bootstrap()

    from miro import test
    from miro.plat import resources

    sys.path.append(resources.app_root())
    test.run_tests()

if __name__ == "__main__":
    if "--unittest" in sys.argv:
        sys.argv.remove("--unittest")
        test_startup(sys.argv)
    else:
        startup(sys.argv)

    # sys.exit isn't sufficient--need to really end the process
    from miro.plat.utils import exit_miro
    exit_miro(0)