def __init__(self): self.quitting = 0 AE.AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, self.__runapp) AE.AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, self.__openfiles)
def __init__(self): self.preffilepath = os.path.join("Python", "Package Install Manager Prefs") Wapplication.Application.__init__(self, 'Pimp') from Carbon import AE from Carbon import AppleEvents self.defaulturl = "" AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenApplication, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEReopenApplication, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEPrintDocuments, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEQuitApplication, self.quitevent) if 1: import PyConsole # With -D option (OSX command line only) keep stderr, for debugging the IDE # itself. debug_stderr = None if len(sys.argv) >= 2 and sys.argv[1] == '-D': debug_stderr = sys.stderr del sys.argv[1] PyConsole.installoutput() if debug_stderr: sys.stderr = debug_stderr self.domenu_openstandard() self.mainloop()
def __init__(self): self.quitting = 0 if len(sys.argv) > 1 and sys.argv[1][:4] == '-psn': del sys.argv[1] AE.AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, self.__runapp) AE.AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, self.__openfiles)
def __init__(self): self.quitting = 0 AE.AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, self.__runapp) AE.AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, self.__openfiles) AE.AEInstallEventHandler(kAEInternetSuite, kAEISGetURL, self.__geturl) # The definition of kAEInternetSuite seems to be wrong, # the lines below ensures that the code will work anyway. AE.AEInstallEventHandler('GURL', 'GURL', self.__geturl)
def __init__(self): if sys.platform == "darwin": if len(sys.argv) > 1 and sys.argv[1].startswith("-psn"): home = os.getenv("HOME") if home: os.chdir(home) self.preffilepath = os.path.join("Python", "PythonIDE preferences") Wapplication.Application.__init__(self, 'Pide') from Carbon import AE from Carbon import AppleEvents AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenApplication, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEReopenApplication, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEPrintDocuments, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenDocuments, self.opendocsevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEQuitApplication, self.quitevent) import PyConsole, PyEdit Splash.wait() # With -D option (OSX command line only) keep stderr, for debugging the IDE # itself. debug_stderr = None if len(sys.argv) >= 2 and sys.argv[1] == '-D': debug_stderr = sys.stderr del sys.argv[1] PyConsole.installoutput() PyConsole.installconsole() if debug_stderr: sys.stderr = debug_stderr for path in sys.argv[1:]: if path.startswith("-p"): # process number added by the OS continue self.opendoc(path) self.mainloop()
def __init__(self): self.quitting = 0 self.ae_handlers = {} # Remove the funny -psn_xxx_xxx argument import sys if len(sys.argv) > 1 and sys.argv[1][:4] == '-psn': del sys.argv[1] ehandlers = ( (AEc.kAEOpenApplication, self.open_app), (AEc.kAEOpenDocuments, self.open_file), (AEc.kAEReopenApplication, self.reopen_app), (AEc.kAEQuitApplication, self.quit_app), (AEc.kAEApplicationDied, self.launched_app_died), ) for etype, cb in ehandlers: AE.AEInstallEventHandler(AEc.kCoreEventClass, etype, cb)
def installaehandler(self, classe, type, callback): AE.AEInstallEventHandler(classe, type, self.callback_wrapper) self.ae_handlers[classe, type] = callback
"""MiniAEFrame - A minimal AppleEvent Application framework.
"""'echo' -- an AppleEvent handler which handles all events the same.
"""AEservertest - Test AppleEvent server interface
"""PythonSlave.py
def initFontLabRemote(): """Call this in FontLab at startup of the application to switch on the remote.""" print "FontLabRemote is on." _AE.AEInstallEventHandler("Rfab", "exec", _executePython)