forked from Pidgeot/python-lnp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch.py
executable file
·34 lines (32 loc) · 945 Bytes
/
launch.py
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is used to launch the program."""
from __future__ import absolute_import, print_function
import sys, os
from core import lnp
sys.path.insert(0, os.path.dirname(__file__))
#pylint: disable=redefined-builtin, bare-except
__package__ = ""
try:
lnp.PyLNP()
except SystemExit:
raise
except:
import traceback
message = traceback.format_exception(*sys.exc_info())
#Log exception to stderr if possible
try:
print(message, file=sys.stderr)
except:
pass
# Also show error in Tkinter message box if possible
try:
if sys.version_info[0] == 3: # Alternate import names
# pylint:disable=import-error
import tkinter.messagebox as messagebox
else:
# pylint:disable=import-error
import tkMessageBox as messagebox
messagebox.showerror(message=message)
except:
pass