#!/usr/bin/env python3
""" turtle service interface

This file is part of Turtle.

Turtle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Turtle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Turtle. If not, see <https://www.gnu.org/licenses/>. 
"""
import dbus
import dbus.service
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
from turtlevcs import TURTLE_APP_ID
from turtlevcs.service import TurtleService, TURTLE_OBJECT_PATH

if __name__ == "__main__":
    DBusGMainLoop(set_as_default=True)
    _mainloop = GLib.MainLoop()
    _session_bus = dbus.SessionBus()
    _name = dbus.service.BusName(TURTLE_APP_ID, _session_bus)
    _object = TurtleService(_session_bus, TURTLE_OBJECT_PATH)
    _mainloop.run()
