From e3c1aca12ab6aafff54d91d33f50c0bd20dbbe5d Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Thu, 8 Feb 2018 14:26:11 -0300 Subject: [PATCH] Reordered moulder directory --- moulder/__init__.py | 15 +++++++++++++++ moulder/{moulder.py => main_window.py} | 16 ++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) rename moulder/{moulder.py => main_window.py} (95%) diff --git a/moulder/__init__.py b/moulder/__init__.py index e69de29..f4102c3 100644 --- a/moulder/__init__.py +++ b/moulder/__init__.py @@ -0,0 +1,15 @@ +import sys +from PyQt5.QtWidgets import QApplication +from .main_window import MoulderApp + + +def main(): + app = QApplication(sys.argv) + app.setApplicationName("Moulder") + moulder_app = MoulderApp() + moulder_app.show() + sys.exit(app.exec_()) + + +if __name__ == "__main__": + main() diff --git a/moulder/moulder.py b/moulder/main_window.py similarity index 95% rename from moulder/moulder.py rename to moulder/main_window.py index 49a325c..65f5f4d 100644 --- a/moulder/moulder.py +++ b/moulder/main_window.py @@ -6,13 +6,13 @@ import numpy from matplotlib.backends.backend_qt5 import NavigationToolbar2QT from PyQt5.QtGui import QIcon from PyQt5.QtCore import Qt -from PyQt5.QtWidgets import QMainWindow, QApplication, QAction +from PyQt5.QtWidgets import QMainWindow, QAction from PyQt5.QtWidgets import QWidget, QVBoxLayout, QMessageBox, QDoubleSpinBox from PyQt5.QtWidgets import QSlider, QLabel -from double_slider import QDoubleSlider -from interactive import Moulder -from configure_dialog import ConfigureMeassurementDialog +from .double_slider import QDoubleSlider +from .interactive import Moulder +from .configure_dialog import ConfigureMeassurementDialog DENSITY_RANGE = [-2000, 2000] @@ -190,11 +190,3 @@ class MoulderApp(QMainWindow): QMessageBox.Yes, QMessageBox.No) if answer == QMessageBox.Yes: sys.exit() - - -if __name__ == "__main__": - app = QApplication(sys.argv) - app.setApplicationName("Moulder") - moulder_app = MoulderApp() - moulder_app.show() - sys.exit(app.exec_())