-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
pithos.in
executable file
·48 lines (39 loc) · 1.37 KB
/
pithos.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
import os
import sys
import locale
import gettext
from gi.repository import Gio
# gst-python changes behavior if installed so just
# avoid loading it since we don't require their additions
# https://bugzilla.gnome.org/show_bug.cgi?id=736260
sys.modules['gi.overrides.Gst'] = None
sys.modules['gi.overrides.GstPbutils'] = None
VERSION = '@VERSION@'
pkgdatadir = '@pkgdatadir@'
localedir = '@localedir@'
srcdir = pkgdatadir
builddir = os.environ.get('MESON_BUILD_ROOT')
if builddir:
pkgdatadir = os.path.join(builddir, 'data')
localedir = os.path.join(builddir, 'po')
srcdir = os.environ.get('MESON_SOURCE_ROOT')
os.environ['GSETTINGS_SCHEMA_DIR'] = pkgdatadir
sys.dont_write_bytecode = True
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
theme = Gtk.IconTheme.get_default()
theme.append_search_path(os.path.join(pkgdatadir, 'icons'))
sys.path.insert(1, srcdir)
try:
locale.bindtextdomain('pithos', localedir)
locale.textdomain('pithos')
except AttributeError:
print("Could not bind to locale translation domain. Some translations won't work")
gettext.install('pithos', localedir)
resource = Gio.resource_load(os.path.join(pkgdatadir, 'pithos.gresource'))
Gio.Resource._register(resource)
if __name__ == "__main__":
from pithos import application
application.main(version=VERSION)