def __init__(self, parentWidget=None): super().__init__(parentWidget) self.ui = UiTargetClass() self.ui.setupUi(self) self.fileChanged.connect(self._fileChanged, QtCore.Qt.QueuedConnection) self.ui.autoScrollCB.stateChanged.connect(self._autoScrollChanged) self.ui.autoScrollCB.setChecked(True) self.ui.splitByThredCB.stateChanged.connect(self._splitThreadsChanged) # self.ui.splitByThredCB.setChecked( True ) self.logFile = get_logging_output_file() ## prevents infinite feedback loop logging.getLogger('watchdog.observers.inotify_buffer').setLevel( logging.INFO) event_handler = PatternMatchingEventHandler(patterns=[self.logFile]) event_handler.on_any_event = self._logFileCallback dirPath = os.path.dirname(self.logFile) self.observer = Observer() self.observer.schedule(event_handler, path=dirPath, recursive=False) self.updateLogView() self.observer.start()
import logging from PyQt5.QtWidgets import QApplication from stockmonitor import logger from stockmonitor.datatypes.datatypes import MarkerEntry from stockmonitor.gui.dataobject import DataObject from stockmonitor.gui.sigint import setup_interrupt_handling from stockmonitor.gui.widget.markerswidget import MarkersWidget ## ============================= main section =================================== if __name__ != '__main__': sys.exit(0) logFile = logger.get_logging_output_file() logger.configure(logFile) _LOGGER = logging.getLogger(__name__) app = QApplication(sys.argv) app.setApplicationName("StockMonitor") app.setOrganizationName("arnet") dataObject = DataObject() dataObject.loadDownloadedStocks() # dataObject.wallet.add( "ALR", 111, 11.1 ) # dataObject.wallet.add( "EAT", 222, 22.2 ) # dataObject.wallet.add( "CDR", 333, 33.3 ) # dataObject.wallet.add( "XXX", 444, 44.4 )