Ejemplo n.º 1
0
    def Quit(self):
        """Removes this object from the DBUS connection and exits."""
        loop.quit()


# smoke test
if __name__ == "__main__":
    if os.environ.get("SCARLETT_DEBUG_MODE"):
        import faulthandler

        faulthandler.register(signal.SIGUSR2, all_threads=True)

        from scarlett_os.internal.debugger import init_debugger
        from scarlett_os.internal.debugger import set_gst_grapviz_tracing

        init_debugger()
        set_gst_grapviz_tracing()
        # Example of how to use it

    from pydbus import SessionBus

    bus = SessionBus()
    # TODO: own_name() is deprecated, use request_name() instead.
    bus.own_name(name="org.scarlett")
    sl = ScarlettListener(bus=bus.con, path="/org/scarlett/Listener")
    loop.run()

    def sigint_handler(*args):
        """Exit on Ctrl+C"""

        # Unregister handler, next Ctrl-C will kill app
Ejemplo n.º 2
0
                    self._config_path
                )
            )


if __name__ == "__main__":
    import signal

    if os.environ.get("SCARLETT_DEBUG_MODE"):
        import faulthandler

        faulthandler.register(signal.SIGUSR2, all_threads=True)

        from scarlett_os.internal.debugger import init_debugger

        init_debugger()

        from scarlett_os.internal.debugger import enable_remote_debugging

        enable_remote_debugging()

    from scarlett_os.logger import setup_logger

    setup_logger()

    import imp  # pylint: disable=W0611
    import os.path
    import sys

    import tempfile
    import shutil