#!/usr/bin/python

# gwe
#
# Copyright (C) 2016 Roberto Leinardi <roberto@leinardi.com>
#
# This program 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.
#
# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import sys
import signal
import gettext

sys.path.insert(1, '/usr/lib/python3.14/site-packages')

VERSION = '0.15.9'
PKGDATA_DIR = '/usr/share/gwe'
localedir = '/usr/share/locale'
builddir = os.environ.get('MESON_BUILD_ROOT')
if builddir:
    PKGDATA_DIR = os.path.join(builddir, 'data')
    os.environ['GSETTINGS_SCHEMA_DIR'] = PKGDATA_DIR
    sys.dont_write_bytecode = True
    sys.path.insert(1, os.environ['MESON_SOURCE_ROOT'])

signal.signal(signal.SIGINT, signal.SIG_DFL)

# gettext.install('trg', localedir)

if __name__ == '__main__':
    import gi

    gi.require_version('Gtk', '3.0')
    gi.require_version('Dazzle', '1.0')
    gi.require_version('Gdk', '3.0')
    gi.require_version('Notify', '0.7')

    from gi.repository import Gio
    resource = Gio.Resource.load(os.path.join(PKGDATA_DIR, 'com.leinardi.gwe.gresource'))
    resource._register()

    from gwe import __main__
    __main__.main()
