def event(self, event): if isinstance(event, QtGui.QFileOpenEvent): fname = str(event.file()) if fname and fname != 'pyzo': 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)
import sys import locale # Check Python version if sys.version < '3': raise RuntimeError('Pyzo requires Python 3.x to run.') # Import yoton as an absolute package from pyzo import yotonloader from pyzo.util import paths # If there already is an instance of Pyzo, and the user is trying an # Pyzo 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 pyzo.core 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 pyzo.util import zon as ssdf # zon is ssdf-light from pyzo.util.qt import QtCore, QtGui
# Check pyzolib version import pyzolib if pyzolib.__version__ < '0.2.5': raise RuntimeError('Pyzo requires Pyzolib 0.2.5 or higher.') elif pyzolib.__version__ < '0.2.9': print('Warning: pyzolib 0.2.9 is recommended to run Pyzo.') # Import yoton as an absolute package from pyzo import yotonloader # If there already is an instance of Pyzo, and the user is trying an # Pyzo 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 pyzo.core 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