Act as an app.

topo-mov
LEdoian 1 year ago
parent e962ec9cdb
commit c83c545c43

@ -0,0 +1,4 @@
#!/usr/bin/env python3
from birdvisu.ui import main
main()

@ -1,4 +1,11 @@
#!/usr/bin/env python3 """This module contains the UI. Most of interfacing Qt happens here, especially if not related to the Graphics view framework
The MainWindow class acts as the coordinator for the whole project. Apart from
it, there is at least one dialog window used by the MainWindow.
The function :func:main can be used as the entrypoint to the program, if run in
standalone mode.
"""
from birdvisu.annotations import AnnotatedTopology, AnnotatorID from birdvisu.annotations import AnnotatedTopology, AnnotatorID
from birdvisu.annotations.analysis import TopologyDifference, ShortestPathTree from birdvisu.annotations.analysis import TopologyDifference, ShortestPathTree
@ -16,8 +23,6 @@ from PySide6.QtCore import Slot, QObject
from random import randint from random import randint
import sys import sys
app = QtWidgets.QApplication([])
class BirdTopologyLoader(QtWidgets.QDialog): class BirdTopologyLoader(QtWidgets.QDialog):
def __init__(self, *a, **kwa): def __init__(self, *a, **kwa):
super().__init__(*a, **kwa) super().__init__(*a, **kwa)
@ -140,7 +145,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.statusbar.showMessage('Hello!') self.statusbar.showMessage('Hello!')
self.create_menus() self.create_menus()
self.edgeWeightMode() self.edgeWeightMode()
self.autoLoad() #self.autoLoad()
#Hack #Hack
@Slot() @Slot()
@ -331,8 +336,9 @@ class MainWindow(QtWidgets.QMainWindow):
def create_edge(self, edge): def create_edge(self, edge):
return EdgeGraphicsItem(edge, self) return EdgeGraphicsItem(edge, self)
def main():
main_window = MainWindow() app = QtWidgets.QApplication([])
main_window.show() main_window = MainWindow()
app.exec() main_window.show()
app.exec()

@ -8,6 +8,9 @@ dependencies = [
'PySide6', 'PySide6',
] ]
[project.gui-scripts]
visu = "birdvisu.ui:main"
[build-system] [build-system]
requires = ["flit_core >=3.2,<4"] requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi" build-backend = "flit_core.buildapi"

@ -0,0 +1,4 @@
#!/usr/bin/env python3
from birdvisu.ui import main
main()
Loading…
Cancel
Save