From 3b3a8433acc4d464a36444872ec05d52ab91a57b Mon Sep 17 00:00:00 2001 From: Nils <> Date: Fri, 1 Jan 2021 22:07:08 +0100 Subject: [PATCH] move main.py and launcher to template and use symlinks --- __main__.py | 17 +---------------- patroneo | 10 +--------- template/launcher.template | 11 +++++++++++ template/main.py.template | 18 ++++++++++++++++++ 4 files changed, 31 insertions(+), 25 deletions(-) mode change 100644 => 120000 __main__.py mode change 100755 => 120000 patroneo create mode 100755 template/launcher.template create mode 100644 template/main.py.template diff --git a/__main__.py b/__main__.py deleted file mode 100644 index 4fe98ce..0000000 --- a/__main__.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 -# encoding: utf-8 -# file: __main__.py - -""" -This file is an alternativ to ./patroneo when using zipapp. -Any code changes in ./patroneo must be manually recplicated here. -""" - -if __name__ == '__main__': - from template import start #Executes various start up checks and sets up our environment likes search paths - from qtgui import mainwindow #which in turn imports the engine and starts the engine - with start.profiler(): - mainwindow.MainWindow().qtApp.exec_() - #Program is over. Code here does not get executed. Quit is done via NSM in mainWindow._nsmQuit - diff --git a/__main__.py b/__main__.py new file mode 120000 index 0000000..a4c86c9 --- /dev/null +++ b/__main__.py @@ -0,0 +1 @@ +/home/nils/lss/patroneo/template/main.py.template \ No newline at end of file diff --git a/patroneo b/patroneo deleted file mode 100755 index 834f613..0000000 --- a/patroneo +++ /dev/null @@ -1,9 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- - -from template import start #Executes various start up checks and sets up our environment likes search paths - -from qtgui import mainwindow #which in turn imports the engine and starts the engine -with start.profiler(): - mainwindow.MainWindow().qtApp.exec_() - #Program is over. Code here does not get executed. Quit is done via NSM in mainWindow._nsmQuit diff --git a/patroneo b/patroneo new file mode 120000 index 0000000..3e27f1a --- /dev/null +++ b/patroneo @@ -0,0 +1 @@ +/home/nils/lss/patroneo/template/launcher.template \ No newline at end of file diff --git a/template/launcher.template b/template/launcher.template new file mode 100755 index 0000000..78d468b --- /dev/null +++ b/template/launcher.template @@ -0,0 +1,11 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- + +#Symlink this to root dir as the program name without extension + +from template import start #Executes various start up checks and sets up our environment likes search paths + +from qtgui import mainwindow #which in turn imports the engine and starts the engine +with start.profiler(): + mainwindow.MainWindow().qtApp.exec_() + #Program is over. Code here does not get executed. Quit is done via NSM in mainWindow._nsmQuit diff --git a/template/main.py.template b/template/main.py.template new file mode 100644 index 0000000..4f10aa9 --- /dev/null +++ b/template/main.py.template @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +# encoding: utf-8 +# file: __main__.py + +""" +Symlink this file to root __main__.py + +This file is an alternativ to the python launcher ./$(PROGRAM) when using zipapp. +Any code changes there must be manually recplicated here. +""" + +if __name__ == '__main__': + from template import start #Executes various start up checks and sets up our environment likes search paths + from qtgui import mainwindow #which in turn imports the engine and starts the engine + with start.profiler(): + mainwindow.MainWindow().qtApp.exec_() + #Program is over. Code here does not get executed. Quit is done via NSM in mainWindow._nsmQuit +