Skip to content

Commit

Permalink
Merge pull request #325 from pfafflabatuiuc/merging_appman
Browse files Browse the repository at this point in the history
Adding the AppManager. Still missing GUI.
  • Loading branch information
wpfff committed Oct 24, 2022
2 parents ee5d80b + e943fcc commit af42b2f
Show file tree
Hide file tree
Showing 8 changed files with 763 additions and 0 deletions.
15 changes: 15 additions & 0 deletions plottr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging
import os
import sys
import signal

if TYPE_CHECKING:
from PyQt5 import QtCore, QtGui, QtWidgets
Expand All @@ -27,6 +28,20 @@
plottrPath = os.path.split(os.path.abspath(__file__))[0]


def qtsleep(delay_sec: float) -> None:
"""sleep function that allows QT event processing in the background."""
loop = QtCore.QEventLoop()
QtCore.QTimer.singleShot(int(delay_sec * 1000), loop.quit)
loop.exec_()


def qtapp() -> QtWidgets.QApplication:
"""make a QT application that can be interrupted by Ctrl+C in the terminal."""
signal.signal(signal.SIGINT, signal.SIG_DFL)
app = QtWidgets.QApplication(sys.argv)
return app


def configPaths() -> Tuple[str, str, str]:
"""Get the folders where plottr looks for config files.
Expand Down

0 comments on commit af42b2f

Please sign in to comment.