-
Notifications
You must be signed in to change notification settings - Fork 8
/
eos-clubhouse
executable file
·62 lines (50 loc) · 1.81 KB
/
eos-clubhouse
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python3
#
# Copyright © 2020 Endless OS Foundation LLC.
#
# This file is part of clubhouse
# (see https://github.com/endlessm/clubhouse).
#
# 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 2 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, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Authors:
# Joaquim Rocha <[email protected]>
#
import os
def _run_clubhouse():
import signal
import sys
import locale
import gettext
from gi.repository import GLib
from eosclubhouse.clubhouse import ClubhouseApplication
from eosclubhouse import config
locale.bindtextdomain('clubhouse', config.LOCALEDIR)
locale.textdomain('clubhouse')
gettext.bindtextdomain('clubhouse', config.LOCALEDIR)
gettext.textdomain('clubhouse')
app = ClubhouseApplication()
# Make sure the GTK+ event loop is quit if the script is interrupted (Ctrl+C)
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, app.quit)
app.run(sys.argv)
if __name__ == '__main__':
run_profile = os.environ.get("CLUBHOUSE_PROFILING", False)
if run_profile:
import cProfile
prof = cProfile.Profile()
res = prof.runcall(_run_clubhouse)
prof.dump_stats("clubhouse-runstats")
else:
_run_clubhouse()