示例#1
0
 def do_startup(self):
     log.info(distro.linux_distribution(full_distribution_name=False))
     log.info("Starting up cozy " + __version__)
     self.ui = CozyUI(pkgdatadir, self, __version__)
     init_db()
     Gtk.Application.do_startup(self)
     self.ui.startup()
示例#2
0
文件: main.py 项目: przor3n/cozy
 def do_startup(self):
     log.info(platform.dist())
     log.info("Starting up cozy " + version)
     self.ui = CozyUI(pkgdatadir, self, version)
     init_db()
     Gtk.Application.do_startup(self)
     self.ui.startup()
示例#3
0
文件: application.py 项目: geigi/cozy
 def do_startup(self):
     log.info(distro.linux_distribution(full_distribution_name=False))
     log.info("Starting up cozy " + __version__)
     self.ui = CozyUI(self.pkgdatadir, self, __version__)
     init_db()
     Gtk.Application.do_startup(self)
     Handy.init()
     log.info("libhandy version: {}".format(Handy._version))
     self.ui.startup()
示例#4
0
class Application(Gtk.Application):
    ui: CozyUI
    app_controller: AppController

    def __init__(self, localedir: str, pkgdatadir: str):
        self.localedir = localedir
        self.pkgdatadir = pkgdatadir

        Gtk.Application.__init__(self, application_id='com.github.geigi.cozy')
        GLib.setenv("PULSE_PROP_media.role", "music", True)
        GLib.set_application_name("Cozy")

        self.old_except_hook = sys.excepthook
        sys.excepthook = self.handle_exception
        setup_thread_excepthook()

        import gettext
        locale.bindtextdomain('com.github.geigi.cozy', localedir)
        locale.textdomain('com.github.geigi.cozy')
        gettext.install('com.github.geigi.cozy', localedir)

    def do_startup(self):
        log.info(distro.linux_distribution(full_distribution_name=False))
        log.info("Starting up cozy " + __version__)
        self.ui = CozyUI(self.pkgdatadir, self, __version__)
        init_db()
        Gtk.Application.do_startup(self)
        Handy.init()
        log.info("libhandy version: {}".format(Handy._version))
        self.ui.startup()

    def do_activate(self):
        main_window_builder = self.ui.get_builder()
        self.app_controller = AppController(main_window_builder, self.ui)

        self.ui.activate(self.app_controller.library_view)

        if Settings.get().first_start:
            Settings.update(first_start=False).execute()
            path = str(Path.home()) + "/Audiobooks"
            Settings.update(path=str(Path.home()) + "/Audiobooks").execute()

            if not os.path.exists(path):
                os.makedirs(path)

        self.add_window(self.ui.window)
        mpris = MPRIS(self)
        mpris._on_current_changed(None)

    def handle_exception(self, exc_type, exc_value, exc_traceback):
        print("handle exception")
        try:
            reporter.exception("uncaught", exc_value, "\n".join(format_exception(exc_type, exc_value, exc_traceback)))
        except:
            pass

        self.old_except_hook(exc_type, exc_value, exc_traceback)
示例#5
0
class Application(Gtk.Application):
    def __init__(self, **kwargs):
        self.ui = None

        listen()
        Gtk.Application.__init__(self, application_id='com.github.geigi.cozy')
        GLib.setenv("PULSE_PROP_media.role", "music", True)
        GLib.set_application_name("Cozy")

        self.old_except_hook = sys.excepthook
        sys.excepthook = self.handle_exception

        import gettext
        locale.bindtextdomain('com.github.geigi.cozy', localedir)
        locale.textdomain('com.github.geigi.cozy')
        gettext.install('com.github.geigi.cozy', localedir)

    def do_startup(self):
        log.info(distro.linux_distribution(full_distribution_name=False))
        log.info("Starting up cozy " + __version__)
        self.ui = CozyUI(pkgdatadir, self, __version__)
        init_db()
        Gtk.Application.do_startup(self)
        self.ui.startup()

    def do_activate(self):
        self.ui.activate()

        if Settings.get().first_start:
            Settings.update(first_start=False).execute()
            path = str(Path.home()) + "/Audiobooks"
            Settings.update(path=str(Path.home()) + "/Audiobooks").execute()

            if not os.path.exists(path):
                os.makedirs(path)
            else:
                self.ui.scan(None, True)
                self.ui.refresh_content()

        self.add_window(self.ui.window)
        mpris = MPRIS(self)
        mpris._on_current_changed(None)

    def handle_exception(self, exc_type, exc_value, exc_traceback):
        print("handle exception")
        try:
            reporter.exception(
                "uncaught", exc_value,
                "\n".join(format_exception(exc_type, exc_value,
                                           exc_traceback)))
        except:
            pass

        self.old_except_hook(exc_type, exc_value, exc_traceback)
示例#6
0
文件: main.py 项目: przor3n/cozy
class Application(Gtk.Application):
    def __init__(self, **kwargs):
        self.ui = None

        GObject.threads_init()
        listen()
        Gtk.Application.__init__(self, application_id='com.github.geigi.cozy')
        GLib.setenv("PULSE_PROP_media.role", "music", True)
        GLib.set_application_name("Cozy")

        import gettext
        locale.bindtextdomain('com.github.geigi.cozy', localedir)
        locale.textdomain('com.github.geigi.cozy')
        gettext.install('com.github.geigi.cozy', localedir)

    def do_startup(self):
        log.info(platform.dist())
        log.info("Starting up cozy " + version)
        self.ui = CozyUI(pkgdatadir, self, version)
        init_db()
        Gtk.Application.do_startup(self)
        self.ui.startup()

    def do_activate(self):
        self.ui.activate()

        if Settings.get().first_start:
            Settings.update(first_start=False).execute()
            path = str(Path.home()) + "/Audiobooks"
            Settings.update(path=str(Path.home()) + "/Audiobooks").execute()

            if not os.path.exists(path):
                os.makedirs(path)
            else:
                self.ui.scan(None, True)
                self.ui.refresh_content()

        self.add_window(self.ui.window)
        mpris = MPRIS(self)
        mpris._on_current_changed(None)