def __init__(self, parent=None): super(QtCore.QObject, self).__init__(parent=parent) self.settings = QtCore.QSettings() #self.settings.clear() self.win = parent GlobalOptions.n_recent_files = 10 self._defaultFlowchartFileName = projectPath('resources/defaultFlowchart.dfc') self._defaultLibFileName = projectPath('resources/defaultLibrary.json') self.initLibrary() self.readSettingsOnStart()
def __init__(self, parent=None): super(QtCore.QObject, self).__init__(parent=parent) self.settings = QtCore.QSettings() #self.settings.clear() self.win = parent GlobalOptions.n_recent_files = 10 self._defaultFlowchartFileName = projectPath( 'resources/defaultFlowchart.dfc') self._defaultLibFileName = projectPath('resources/defaultLibrary.json') self.initLibrary() self.readSettingsOnStart()
def __init__(self, app=None): super(MainWindow, self).__init__() self._unittestmode = False #set this to True if running a unittest self._application = app uic.loadUi(projectPath('resources/mainwindow.ui'), self) self.uiData = uiData(self) self.connectActions() self.initUI() self.initGlobalShortcuts() # everything has been inited. Now do some actions # 1) check crash status self.uiData.on_crash_LoadBakFile()
def readXLS(self, path=None): ''' Read XLS and return the node''' if path is None: # now set test_data file path = projectPath('../TUTORIALS/test_data.xlsx') n = self.fc.createNode('readXLS', pos=(0, 0)) p = n.ctrlWidget().param #alias to method p('Select File').setValue(path) #set some params... p('Parameters', 'skiprows').setValue(0) p('Parameters', 'skip_footer').setValue(0) p('Parameters', 'na_values').setValue(u'---') #load data p('Load File').activate() return n
def main(): # load logging configuration pygwa_logger.setup_logging() logger.info('\n|\n|\n|\n|\n|\n...Starting the application...\n') app = QtWidgets.QApplication(sys.argv) app.setWindowIcon(QtGui.QIcon(projectPath('resources/icon.gif'))) # is needed for QSettings app.setOrganizationName("pygwa") app.setApplicationName("pygwa") ex = MainWindow(app=app) ex.show() sys.exit(app.exec_())
from PyQt5 import QtWidgets import lib.common.syntaxPython as syntaxPython from lib import projectPath app = QtWidgets.QApplication([]) editor = QtWidgets.QPlainTextEdit() highlight = syntaxPython.PythonHighlighter(editor.document()) editor.show() # Load syntax.py into the editor for demo purposes infile = open(projectPath('../lib/common/syntaxPython.py'), 'r') editor.setPlainText(infile.read()) app.exec_()