Browse Source

move main.py and launcher to template and use symlinks

master
Nils 4 years ago
parent
commit
3b3a8433ac
  1. 16
      __main__.py
  2. 1
      __main__.py
  3. 9
      patroneo
  4. 1
      patroneo
  5. 11
      template/launcher.template
  6. 18
      template/main.py.template

16
__main__.py

@ -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

1
__main__.py

@ -0,0 +1 @@
/home/nils/lss/patroneo/template/main.py.template

9
patroneo

@ -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

1
patroneo

@ -0,0 +1 @@
/home/nils/lss/patroneo/template/launcher.template

11
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

18
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
Loading…
Cancel
Save