#!/usr/bin/env python3

import gi
import sys
import os
from pathlib import Path

try:
    # 3.30 is the first one with Gtk.Template
    gi.check_version('3.30') # NOQA
except ValueError as e:
    print(e, file=sys.stderr)
    sys.exit(1)

gi.require_version('Gio', '2.0')  # NOQA
from gi.repository import Gio


  # NOQA
resource = Gio.resource_load(os.fspath(Path('/usr/share/tuhi', 'tuhi.gresource')))
Gio.Resource._register(resource)


if __name__ == "__main__":
    import gettext
    import locale

    locale.bindtextdomain('tuhi', '/usr/share/locale')
    gettext.bindtextdomain('tuhi', '/usr/share/locale')

    from tuhi.gui.application import main
    main(sys.argv)
