def event(self, event): if isinstance(event, QtGui.QFileOpenEvent): fname = str(event.file()) if fname and fname != 'iep': sys.argv[1:] = [] sys.argv.append(fname) res = commandline.handle_cmd_args() if not commandline.is_our_server_running(): print(res) sys.exit() return QtGui.QApplication.event(self, event)
# Check pyzolib version import pyzolib if pyzolib.__version__ < '0.2.5': raise RuntimeError('IEP requires Pyzolib 0.2.5 or higher.') elif pyzolib.__version__ < '0.2.9': print('Warning: pyzolib 0.2.9 is recommended to run IEP.') # Import yoton as an absolute package from iep import yotonloader # If there already is an instance of IEP, and the user is trying an # IEP command, we should send the command to the other process and quit. # We do this here, were we have not yet loaded Qt, so we are very light. from iep.iepcore import commandline if commandline.is_our_server_running(): print('Started our command server') else: # Handle command line args now res = commandline.handle_cmd_args() if res: print(res) sys.exit() else: # No args, proceed with starting up print('Our command server is *not* running') from pyzolib import ssdf, paths from pyzolib.qt import QtCore, QtGui