toxygen/toxygen/main.py

503 lines
20 KiB
Python
Raw Normal View History

2016-03-15 18:05:19 +01:00
import sys
2016-02-18 17:15:38 +01:00
from loginscreen import LoginScreen
2016-07-06 15:25:04 +02:00
import profile
2016-04-03 22:51:46 +02:00
from settings import *
2017-04-11 20:10:03 +02:00
from PyQt5 import QtCore, QtGui, QtWidgets
2016-03-15 18:05:19 +01:00
from bootstrap import node_generator
from mainscreen import MainWindow
2016-08-01 17:00:03 +02:00
from callbacks import init_callbacks, stop, start
2016-10-31 22:04:48 +01:00
from util import curr_directory, program_version, remove, is_64_bit
2016-03-21 11:55:50 +01:00
import styles.style
2016-07-12 18:40:26 +02:00
import platform
2017-02-11 18:07:28 +01:00
import toxes
2016-07-10 16:51:33 +02:00
from passwordscreen import PasswordScreen, UnlockAppScreen, SetProfilePasswordScreen
2016-05-28 12:06:13 +02:00
from plugin_support import PluginLoader
2016-09-23 19:37:32 +02:00
import updater
2016-02-18 17:15:38 +01:00
2016-06-22 13:35:22 +02:00
class Toxygen:
2016-02-19 16:04:53 +01:00
2016-06-06 12:29:17 +02:00
def __init__(self, path_or_uri=None):
2016-03-15 18:05:19 +01:00
super(Toxygen, self).__init__()
2016-10-22 19:31:34 +02:00
self.tox = self.ms = self.init = self.app = self.tray = self.mainloop = self.avloop = None
2016-06-06 12:29:17 +02:00
if path_or_uri is None:
self.uri = self.path = None
elif path_or_uri.startswith('tox:'):
self.path = None
self.uri = path_or_uri[4:]
else:
self.path = path_or_uri
self.uri = None
2016-05-15 18:54:44 +02:00
def enter_pass(self, data):
2016-05-15 16:39:49 +02:00
"""
Show password screen
"""
2016-05-15 18:54:44 +02:00
tmp = [data]
2017-02-11 18:07:28 +01:00
p = PasswordScreen(toxes.ToxES.get_instance(), tmp)
2016-05-15 18:54:44 +02:00
p.show()
2017-04-11 20:10:03 +02:00
self.app.lastWindowClosed.connect(self.app.quit)
2016-05-15 18:54:44 +02:00
self.app.exec_()
if tmp[0] == data:
raise SystemExit()
else:
return tmp[0]
2016-05-15 16:39:49 +02:00
2016-03-15 18:05:19 +01:00
def main(self):
2016-02-19 16:04:53 +01:00
"""
2016-04-03 22:51:46 +02:00
Main function of app. loads login screen if needed and starts main screen
2016-03-15 18:05:19 +01:00
"""
2017-04-11 20:10:03 +02:00
app = QtWidgets.QApplication(sys.argv)
2016-03-15 18:05:19 +01:00
app.setWindowIcon(QtGui.QIcon(curr_directory() + '/images/icon.png'))
2016-05-15 18:54:44 +02:00
self.app = app
2016-07-12 18:40:26 +02:00
if platform.system() == 'Linux':
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads)
# application color scheme
with open(curr_directory() + '/styles/style.qss') as fl:
dark_style = fl.read()
app.setStyleSheet(dark_style)
2016-05-15 16:39:49 +02:00
2017-02-11 18:07:28 +01:00
encrypt_save = toxes.ToxES()
2016-05-15 16:39:49 +02:00
if self.path is not None:
path = os.path.dirname(self.path) + '/'
name = os.path.basename(self.path)[:-4]
2016-05-14 12:18:17 +02:00
data = ProfileHelper(path, name).open_profile()
2016-05-15 16:39:49 +02:00
if encrypt_save.is_data_encrypted(data):
data = self.enter_pass(data)
2016-04-03 22:51:46 +02:00
settings = Settings(name)
2016-07-06 15:25:04 +02:00
self.tox = profile.tox_factory(data, settings)
else:
auto_profile = Settings.get_auto_profile()
2016-06-18 21:32:14 +02:00
if not auto_profile[0]:
# show login screen if default profile not found
current_locale = QtCore.QLocale()
curr_lang = current_locale.languageToString(current_locale.language())
langs = Settings.supported_languages()
2016-06-18 22:50:12 +02:00
if curr_lang in langs:
lang_path = langs[curr_lang]
translator = QtCore.QTranslator()
translator.load(curr_directory() + '/translations/' + lang_path)
app.installTranslator(translator)
app.translator = translator
ls = LoginScreen()
ls.setWindowIconText("Toxygen")
profiles = ProfileHelper.find_profiles()
ls.update_select(map(lambda x: x[1], profiles))
_login = self.Login(profiles)
ls.update_on_close(_login.login_screen_close)
ls.show()
app.exec_()
if not _login.t:
return
elif _login.t == 1: # create new profile
_login.name = _login.name.strip()
name = _login.name if _login.name else 'toxygen_user'
2016-07-10 21:32:35 +02:00
pr = map(lambda x: x[1], ProfileHelper.find_profiles())
if name in list(pr):
2017-04-11 20:10:03 +02:00
msgBox = QtWidgets.QMessageBox()
2016-07-10 21:32:35 +02:00
msgBox.setWindowTitle(
2017-04-11 20:10:03 +02:00
QtWidgets.QApplication.translate("MainWindow", "Error"))
text = (QtWidgets.QApplication.translate("MainWindow",
'Profile with this name already exists'))
2016-07-10 21:32:35 +02:00
msgBox.setText(text)
msgBox.exec_()
return
2016-07-06 15:25:04 +02:00
self.tox = profile.tox_factory()
self.tox.self_set_name(bytes(_login.name, 'utf-8') if _login.name else b'Toxygen User')
self.tox.self_set_status_message(b'Toxing on Toxygen')
2017-04-11 20:10:03 +02:00
reply = QtWidgets.QMessageBox.question(None,
2016-07-10 16:51:33 +02:00
'Profile {}'.format(name),
2017-04-11 20:10:03 +02:00
QtWidgets.QApplication.translate("login",
'Do you want to set profile password?'),
QtWidgets.QMessageBox.Yes,
QtWidgets.QMessageBox.No)
if reply == QtWidgets.QMessageBox.Yes:
2016-07-10 16:51:33 +02:00
set_pass = SetProfilePasswordScreen(encrypt_save)
set_pass.show()
2017-04-11 20:10:03 +02:00
self.app.lastWindowClosed.connect(self.app.quit)
2016-07-10 16:51:33 +02:00
self.app.exec_()
2017-04-11 20:10:03 +02:00
reply = QtWidgets.QMessageBox.question(None,
2016-07-27 16:13:57 +02:00
'Profile {}'.format(name),
2017-04-11 20:10:03 +02:00
QtWidgets.QApplication.translate("login",
'Do you want to save profile in default folder? If no, profile will be saved in program folder'),
QtWidgets.QMessageBox.Yes,
QtWidgets.QMessageBox.No)
if reply == QtWidgets.QMessageBox.Yes:
2016-07-27 16:13:57 +02:00
path = Settings.get_default_path()
else:
2016-10-31 22:04:48 +01:00
path = curr_directory() + '/'
2016-11-03 13:46:49 +01:00
try:
ProfileHelper(path, name).save_profile(self.tox.get_savedata())
except Exception as ex:
print(str(ex))
log('Profile creation exception: ' + str(ex))
2017-04-11 20:10:03 +02:00
msgBox = QtWidgets.QMessageBox()
msgBox.setText(QtWidgets.QApplication.translate("login",
'Profile saving error! Does Toxygen have permission to write to this directory?'))
2016-11-03 13:46:49 +01:00
msgBox.exec_()
return
path = Settings.get_default_path()
settings = Settings(name)
2016-07-03 23:41:37 +02:00
if curr_lang in langs:
settings['language'] = curr_lang
settings.save()
else: # load existing profile
path, name = _login.get_data()
if _login.default:
Settings.set_auto_profile(path, name)
2016-05-14 12:18:17 +02:00
data = ProfileHelper(path, name).open_profile()
2016-05-15 16:39:49 +02:00
if encrypt_save.is_data_encrypted(data):
data = self.enter_pass(data)
settings = Settings(name)
2016-07-06 15:25:04 +02:00
self.tox = profile.tox_factory(data, settings)
else:
path, name = auto_profile
2016-05-14 12:18:17 +02:00
data = ProfileHelper(path, name).open_profile()
2016-05-15 16:39:49 +02:00
if encrypt_save.is_data_encrypted(data):
data = self.enter_pass(data)
settings = Settings(name)
2016-07-06 15:25:04 +02:00
self.tox = profile.tox_factory(data, settings)
2016-06-18 21:32:14 +02:00
if Settings.is_active_profile(path, name): # profile is in use
2017-04-11 20:10:03 +02:00
reply = QtWidgets.QMessageBox.question(None,
2016-04-03 22:51:46 +02:00
'Profile {}'.format(name),
2017-04-11 20:10:03 +02:00
QtWidgets.QApplication.translate("login", 'Other instance of Toxygen uses this profile or profile was not properly closed. Continue?'),
QtWidgets.QMessageBox.Yes,
QtWidgets.QMessageBox.No)
if reply != QtWidgets.QMessageBox.Yes:
2016-04-03 22:51:46 +02:00
return
else:
settings.set_active_profile()
2016-06-18 22:50:12 +02:00
lang = Settings.supported_languages()[settings['language']]
2016-04-04 11:20:32 +02:00
translator = QtCore.QTranslator()
2016-06-19 18:07:42 +02:00
translator.load(curr_directory() + '/translations/' + lang)
2016-04-04 11:20:32 +02:00
app.installTranslator(translator)
app.translator = translator
2016-03-15 20:12:37 +01:00
# tray icon
2017-04-11 20:10:03 +02:00
self.tray = QtWidgets.QSystemTrayIcon(QtGui.QIcon(curr_directory() + '/images/icon.png'))
2016-04-04 11:20:32 +02:00
self.tray.setObjectName('tray')
2016-04-04 13:00:50 +02:00
2016-06-03 12:48:41 +02:00
self.ms = MainWindow(self.tox, self.reset, self.tray)
2016-09-26 20:58:14 +02:00
app.aboutToQuit.connect(self.ms.close_window)
2016-06-03 12:48:41 +02:00
2017-04-11 20:10:03 +02:00
class Menu(QtWidgets.QMenu):
2016-05-24 20:08:52 +02:00
def newStatus(self, status):
2017-02-11 20:04:32 +01:00
if not Settings.get_instance().locked:
profile.Profile.get_instance().set_status(status)
2017-04-11 20:10:03 +02:00
self.aboutToShowHandler()
2017-02-11 20:04:32 +01:00
self.hide()
2016-05-24 20:08:52 +02:00
2017-04-11 20:10:03 +02:00
def aboutToShowHandler(self):
2016-07-06 15:25:04 +02:00
status = profile.Profile.get_instance().status
2016-05-24 20:08:52 +02:00
act = self.act
2016-07-02 14:40:06 +02:00
if status is None or Settings.get_instance().locked:
2016-05-24 20:08:52 +02:00
self.actions()[1].setVisible(False)
else:
self.actions()[1].setVisible(True)
act.actions()[0].setChecked(False)
act.actions()[1].setChecked(False)
act.actions()[2].setChecked(False)
act.actions()[status].setChecked(True)
2016-07-02 14:40:06 +02:00
self.actions()[2].setVisible(not Settings.get_instance().locked)
2016-05-24 20:08:52 +02:00
2016-04-04 13:00:50 +02:00
def languageChange(self, *args, **kwargs):
2017-04-11 20:10:03 +02:00
self.actions()[0].setText(QtWidgets.QApplication.translate('tray', 'Open Toxygen'))
self.actions()[1].setText(QtWidgets.QApplication.translate('tray', 'Set status'))
self.actions()[2].setText(QtWidgets.QApplication.translate('tray', 'Exit'))
self.act.actions()[0].setText(QtWidgets.QApplication.translate('tray', 'Online'))
self.act.actions()[1].setText(QtWidgets.QApplication.translate('tray', 'Away'))
self.act.actions()[2].setText(QtWidgets.QApplication.translate('tray', 'Busy'))
2016-04-04 13:00:50 +02:00
m = Menu()
2017-04-11 20:10:03 +02:00
show = m.addAction(QtWidgets.QApplication.translate('tray', 'Open Toxygen'))
sub = m.addMenu(QtWidgets.QApplication.translate('tray', 'Set status'))
onl = sub.addAction(QtWidgets.QApplication.translate('tray', 'Online'))
away = sub.addAction(QtWidgets.QApplication.translate('tray', 'Away'))
busy = sub.addAction(QtWidgets.QApplication.translate('tray', 'Busy'))
2016-05-24 20:08:52 +02:00
onl.setCheckable(True)
away.setCheckable(True)
busy.setCheckable(True)
m.act = sub
2017-04-11 20:10:03 +02:00
exit = m.addAction(QtWidgets.QApplication.translate('tray', 'Exit'))
def show_window():
2017-03-26 23:04:32 +02:00
s = Settings.get_instance()
2016-07-02 14:40:06 +02:00
def show():
if not self.ms.isActiveWindow():
self.ms.setWindowState(self.ms.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
self.ms.activateWindow()
self.ms.show()
2017-03-26 23:04:32 +02:00
if not s.locked:
2016-07-02 14:40:06 +02:00
show()
else:
def correct_pass():
show()
2017-03-26 23:04:32 +02:00
s.locked = False
s.unlockScreen = False
if not s.unlockScreen:
s.unlockScreen = True
self.p = UnlockAppScreen(toxes.ToxES.get_instance(), correct_pass)
self.p.show()
2016-07-26 19:36:50 +02:00
def tray_activated(reason):
2017-04-11 20:10:03 +02:00
if reason == QtWidgets.QSystemTrayIcon.DoubleClick:
2016-08-05 14:58:25 +02:00
show_window()
def close_app():
2017-02-11 20:04:32 +01:00
if not Settings.get_instance().locked:
settings.closing = True
self.ms.close()
2016-07-26 19:36:50 +02:00
2017-04-11 20:10:03 +02:00
show.triggered.connect(show_window)
exit.triggered.connect(close_app)
m.aboutToShow.connect(lambda: m.aboutToShowHandler())
onl.triggered.connect(lambda: m.newStatus(0))
away.triggered.connect(lambda: m.newStatus(1))
busy.triggered.connect(lambda: m.newStatus(2))
2016-06-03 12:48:41 +02:00
2016-04-01 16:09:45 +02:00
self.tray.setContextMenu(m)
2016-03-15 20:12:37 +01:00
self.tray.show()
2016-07-26 19:36:50 +02:00
self.tray.activated.connect(tray_activated)
2016-03-15 20:12:37 +01:00
2016-10-29 20:30:39 +02:00
self.ms.show()
updating = False
2016-10-22 19:31:34 +02:00
if settings['update'] and updater.updater_available() and updater.connection_available(): # auto update
version = updater.check_for_updates()
if version is not None:
if settings['update'] == 2:
updater.download(version)
updating = True
else:
2017-04-11 20:10:03 +02:00
reply = QtWidgets.QMessageBox.question(None,
2016-10-29 20:30:39 +02:00
'Toxygen',
2017-04-11 20:10:03 +02:00
QtWidgets.QApplication.translate("login",
'Update for Toxygen was found. Download and install it?'),
QtWidgets.QMessageBox.Yes,
QtWidgets.QMessageBox.No)
if reply == QtWidgets.QMessageBox.Yes:
updater.download(version)
updating = True
if updating:
data = self.tox.get_savedata()
ProfileHelper.get_instance().save_profile(data)
settings.close()
del self.tox
return
2016-05-28 12:06:13 +02:00
plugin_helper = PluginLoader(self.tox, settings) # plugin support
plugin_helper.load()
2016-08-01 17:00:03 +02:00
start()
2016-03-15 18:05:19 +01:00
# init thread
2016-03-15 20:12:37 +01:00
self.init = self.InitThread(self.tox, self.ms, self.tray)
2016-03-15 18:05:19 +01:00
self.init.start()
2016-02-19 22:10:24 +01:00
2016-04-24 12:45:11 +02:00
# starting threads for tox iterate and toxav iterate
2016-03-15 18:05:19 +01:00
self.mainloop = self.ToxIterateThread(self.tox)
self.mainloop.start()
2016-04-24 12:45:11 +02:00
self.avloop = self.ToxAVIterateThread(self.tox.AV)
self.avloop.start()
2016-05-28 12:06:13 +02:00
2016-06-06 12:29:17 +02:00
if self.uri is not None:
self.ms.add_contact(self.uri)
2017-04-11 20:10:03 +02:00
app.lastWindowClosed.connect(app.quit)
2016-03-15 18:05:19 +01:00
app.exec_()
2016-09-23 19:37:32 +02:00
2016-03-15 21:35:15 +01:00
self.init.stop = True
2016-03-15 18:05:19 +01:00
self.mainloop.stop = True
2016-04-24 12:45:11 +02:00
self.avloop.stop = True
2016-05-28 12:06:13 +02:00
plugin_helper.stop()
2016-08-01 14:26:11 +02:00
stop()
2016-03-15 18:05:19 +01:00
self.mainloop.wait()
2016-03-15 21:35:15 +01:00
self.init.wait()
2016-04-24 12:45:11 +02:00
self.avloop.wait()
2016-03-15 18:05:19 +01:00
data = self.tox.get_savedata()
2016-05-14 12:18:17 +02:00
ProfileHelper.get_instance().save_profile(data)
2016-04-12 15:11:10 +02:00
settings.close()
2016-03-15 18:05:19 +01:00
del self.tox
2016-02-19 16:04:53 +01:00
2016-03-15 18:05:19 +01:00
def reset(self):
"""
Create new tox instance (new network settings)
:return: tox instance
"""
self.mainloop.stop = True
2016-03-15 20:42:24 +01:00
self.init.stop = True
2016-04-24 12:45:11 +02:00
self.avloop.stop = True
2016-03-15 18:05:19 +01:00
self.mainloop.wait()
2016-03-15 20:42:24 +01:00
self.init.wait()
2016-04-24 12:45:11 +02:00
self.avloop.wait()
2016-03-15 18:05:19 +01:00
data = self.tox.get_savedata()
2016-05-14 12:18:17 +02:00
ProfileHelper.get_instance().save_profile(data)
2016-03-15 18:05:19 +01:00
del self.tox
# create new tox instance
2016-07-06 15:25:04 +02:00
self.tox = profile.tox_factory(data, Settings.get_instance())
2016-03-15 18:05:19 +01:00
# init thread
2016-03-15 20:12:37 +01:00
self.init = self.InitThread(self.tox, self.ms, self.tray)
2016-03-15 18:05:19 +01:00
self.init.start()
2016-04-24 12:45:11 +02:00
# starting threads for tox iterate and toxav iterate
2016-03-15 18:05:19 +01:00
self.mainloop = self.ToxIterateThread(self.tox)
self.mainloop.start()
2016-04-24 12:45:11 +02:00
self.avloop = self.ToxAVIterateThread(self.tox.AV)
self.avloop.start()
2016-05-28 12:06:13 +02:00
plugin_helper = PluginLoader.get_instance()
plugin_helper.set_tox(self.tox)
2016-03-15 18:05:19 +01:00
return self.tox
2016-03-15 21:54:01 +01:00
# -----------------------------------------------------------------------------------------------------------------
# Inner classes
# -----------------------------------------------------------------------------------------------------------------
2016-03-15 18:05:19 +01:00
class InitThread(QtCore.QThread):
2016-03-15 20:12:37 +01:00
def __init__(self, tox, ms, tray):
2016-03-15 18:05:19 +01:00
QtCore.QThread.__init__(self)
2016-03-15 20:12:37 +01:00
self.tox, self.ms, self.tray = tox, ms, tray
2016-03-15 20:42:24 +01:00
self.stop = False
2016-03-15 18:05:19 +01:00
def run(self):
# initializing callbacks
2016-03-15 20:12:37 +01:00
init_callbacks(self.tox, self.ms, self.tray)
2016-03-15 18:05:19 +01:00
# bootstrap
2016-03-16 16:15:55 +01:00
try:
2016-03-15 18:05:19 +01:00
for data in node_generator():
2016-04-03 22:51:46 +02:00
if self.stop:
return
2016-03-15 18:05:19 +01:00
self.tox.bootstrap(*data)
2016-07-10 16:51:33 +02:00
self.tox.add_tcp_relay(*data)
2016-03-16 16:15:55 +01:00
except:
pass
2016-06-21 13:58:11 +02:00
for _ in range(10):
2016-04-03 22:51:46 +02:00
if self.stop:
return
self.msleep(1000)
while not self.tox.self_get_connection_status():
2016-03-16 16:15:55 +01:00
try:
for data in node_generator():
2016-04-03 22:51:46 +02:00
if self.stop:
return
2016-03-16 16:15:55 +01:00
self.tox.bootstrap(*data)
2016-07-10 16:51:33 +02:00
self.tox.add_tcp_relay(*data)
2016-03-16 16:15:55 +01:00
except:
pass
finally:
self.msleep(5000)
2016-03-15 18:05:19 +01:00
class ToxIterateThread(QtCore.QThread):
def __init__(self, tox):
QtCore.QThread.__init__(self)
self.tox = tox
self.stop = False
def run(self):
while not self.stop:
self.tox.iterate()
self.msleep(self.tox.iteration_interval())
2016-04-24 12:45:11 +02:00
class ToxAVIterateThread(QtCore.QThread):
def __init__(self, toxav):
QtCore.QThread.__init__(self)
self.toxav = toxav
self.stop = False
def run(self):
while not self.stop:
self.toxav.iterate()
self.msleep(self.toxav.iteration_interval())
2016-06-22 13:35:22 +02:00
class Login:
2016-03-15 18:05:19 +01:00
def __init__(self, arr):
self.arr = arr
def login_screen_close(self, t, number=-1, default=False, name=None):
""" Function which processes data from login screen
:param t: 0 - window was closed, 1 - new profile was created, 2 - profile loaded
2016-04-14 14:01:59 +02:00
:param number: num of chosen profile in list (-1 by default)
:param default: was or not chosen profile marked as default
2016-03-15 18:05:19 +01:00
:param name: name of new profile
"""
self.t = t
self.num = number
self.default = default
self.name = name
def get_data(self):
return self.arr[self.num]
2016-07-06 15:25:04 +02:00
def clean():
2016-07-11 16:24:39 +02:00
"""Removes all windows libs from libs folder"""
2016-07-06 15:25:04 +02:00
d = curr_directory() + '/libs/'
2016-10-22 19:31:34 +02:00
remove(d)
2016-07-06 15:25:04 +02:00
def configure():
2016-07-11 16:24:39 +02:00
"""Removes unused libs"""
2016-07-06 15:25:04 +02:00
d = curr_directory() + '/libs/'
2016-10-31 22:04:48 +01:00
is_64bits = is_64_bit()
2016-07-06 15:25:04 +02:00
if not is_64bits:
if os.path.exists(d + 'libtox64.dll'):
os.remove(d + 'libtox64.dll')
if os.path.exists(d + 'libsodium64.a'):
os.remove(d + 'libsodium64.a')
else:
if os.path.exists(d + 'libtox.dll'):
os.remove(d + 'libtox.dll')
if os.path.exists(d + 'libsodium.a'):
os.remove(d + 'libsodium.a')
try:
os.rename(d + 'libtox64.dll', d + 'libtox.dll')
os.rename(d + 'libsodium64.a', d + 'libsodium.a')
except:
pass
2017-01-04 17:46:23 +01:00
def reset():
Settings.reset_auto_profile()
2016-07-05 20:43:51 +02:00
def main():
if len(sys.argv) == 1:
toxygen = Toxygen()
2016-07-11 16:24:39 +02:00
else: # started with argument(s)
2016-07-05 20:43:51 +02:00
arg = sys.argv[1]
if arg == '--version':
2016-07-27 16:13:57 +02:00
print('Toxygen v' + program_version)
2016-07-05 20:43:51 +02:00
return
elif arg == '--help':
2017-01-13 19:08:54 +01:00
print('Usage:\ntoxygen path_to_profile\ntoxygen tox_id\ntoxygen --version\ntoxygen --reset')
2016-07-05 20:43:51 +02:00
return
2016-07-06 15:25:04 +02:00
elif arg == '--configure':
configure()
return
elif arg == '--clean':
clean()
return
2017-01-04 17:46:23 +01:00
elif arg == '--reset':
reset()
return
2016-07-05 20:43:51 +02:00
else:
toxygen = Toxygen(arg)
2016-03-15 18:05:19 +01:00
toxygen.main()
2016-07-05 20:43:51 +02:00
if __name__ == '__main__':
main()