diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2000-06-20 22:01:04 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2000-06-20 22:01:04 (GMT) |
commit | 8eff33b51fff0570fe3a68668073253ec18a2631 (patch) | |
tree | 9907a4db464e263a22dc598cf9d3d1b27cfd347b /Mac | |
parent | d13c3854629d605236c4d7cc8589a647b069207e (diff) | |
download | cpython-8eff33b51fff0570fe3a68668073253ec18a2631.zip cpython-8eff33b51fff0570fe3a68668073253ec18a2631.tar.gz cpython-8eff33b51fff0570fe3a68668073253ec18a2631.tar.bz2 |
Added an optional debug handler that traps and prints all unknown appleevents.
Diffstat (limited to 'Mac')
-rw-r--r-- | Mac/Demo/PICTbrowse/ICONbrowse.py | 2 | ||||
-rw-r--r-- | Mac/Demo/PICTbrowse/PICTbrowse.py | 2 | ||||
-rw-r--r-- | Mac/Demo/PICTbrowse/PICTbrowse.rsrc | bin | 785 -> 785 bytes | |||
-rw-r--r-- | Mac/Demo/PICTbrowse/PICTbrowse2.py | 2 | ||||
-rw-r--r-- | Mac/Demo/PICTbrowse/cicnbrowse.py | 2 | ||||
-rw-r--r-- | Mac/Demo/PICTbrowse/oldPICTbrowse.rsrc | bin | 502 -> 502 bytes | |||
-rw-r--r-- | Mac/Demo/cgi/realcgitest.py | 13 | ||||
-rw-r--r-- | Mac/Demo/example1/dnslookup-1.py | 2 | ||||
-rw-r--r-- | Mac/Demo/example1/dnslookup-1.rsrc | bin | 604 -> 604 bytes | |||
-rw-r--r-- | Mac/Demo/example2/dnslookup-2.py | 2 | ||||
-rw-r--r-- | Mac/Demo/example2/dnslookup-2.rsrc | bin | 707 -> 707 bytes | |||
-rw-r--r-- | Mac/Demo/waste/htmled.py | 6 | ||||
-rw-r--r-- | Mac/Demo/waste/swed.py | 6 |
13 files changed, 24 insertions, 13 deletions
diff --git a/Mac/Demo/PICTbrowse/ICONbrowse.py b/Mac/Demo/PICTbrowse/ICONbrowse.py index 4e20b7f..fe28564 100644 --- a/Mac/Demo/PICTbrowse/ICONbrowse.py +++ b/Mac/Demo/PICTbrowse/ICONbrowse.py @@ -30,7 +30,7 @@ def main(): dummy = Res.GetResource('DLOG', ID_MAIN) except Res.Error: try: - Res.OpenResFile("PICTbrowse.rsrc") + Res.FSpOpenResFile("PICTbrowse.rsrc", 1) except Res.Error, arg: EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1]) sys.exit(1) diff --git a/Mac/Demo/PICTbrowse/PICTbrowse.py b/Mac/Demo/PICTbrowse/PICTbrowse.py index 653dd5d..0771991 100644 --- a/Mac/Demo/PICTbrowse/PICTbrowse.py +++ b/Mac/Demo/PICTbrowse/PICTbrowse.py @@ -25,7 +25,7 @@ def main(): dummy = Res.GetResource('DLOG', ID_MAIN) except Res.Error: try: - Res.OpenResFile("PICTbrowse.rsrc") + Res.FSpOpenResFile("PICTbrowse.rsrc", 1) except Res.Error, arg: EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1]) sys.exit(1) diff --git a/Mac/Demo/PICTbrowse/PICTbrowse.rsrc b/Mac/Demo/PICTbrowse/PICTbrowse.rsrc Binary files differindex aae379b..526ff52 100644 --- a/Mac/Demo/PICTbrowse/PICTbrowse.rsrc +++ b/Mac/Demo/PICTbrowse/PICTbrowse.rsrc diff --git a/Mac/Demo/PICTbrowse/PICTbrowse2.py b/Mac/Demo/PICTbrowse/PICTbrowse2.py index 31169ee..c78960c 100644 --- a/Mac/Demo/PICTbrowse/PICTbrowse2.py +++ b/Mac/Demo/PICTbrowse/PICTbrowse2.py @@ -29,7 +29,7 @@ def main(): dummy = Res.GetResource('DLOG', ID_MAIN) except Res.Error: try: - Res.OpenResFile("PICTbrowse.rsrc") + Res.FSpOpenResFile("PICTbrowse.rsrc", 1) except Res.Error, arg: EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1]) sys.exit(1) diff --git a/Mac/Demo/PICTbrowse/cicnbrowse.py b/Mac/Demo/PICTbrowse/cicnbrowse.py index 67ec355..b56cd13 100644 --- a/Mac/Demo/PICTbrowse/cicnbrowse.py +++ b/Mac/Demo/PICTbrowse/cicnbrowse.py @@ -30,7 +30,7 @@ def main(): dummy = Res.GetResource('DLOG', ID_MAIN) except Res.Error: try: - Res.OpenResFile("PICTbrowse.rsrc") + Res.FSpOpenResFile("PICTbrowse.rsrc", 1) except Res.Error, arg: EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1]) sys.exit(1) diff --git a/Mac/Demo/PICTbrowse/oldPICTbrowse.rsrc b/Mac/Demo/PICTbrowse/oldPICTbrowse.rsrc Binary files differindex 6745d2f..fb7a192 100644 --- a/Mac/Demo/PICTbrowse/oldPICTbrowse.rsrc +++ b/Mac/Demo/PICTbrowse/oldPICTbrowse.rsrc diff --git a/Mac/Demo/cgi/realcgitest.py b/Mac/Demo/cgi/realcgitest.py index a91771a..e51cb97 100644 --- a/Mac/Demo/cgi/realcgitest.py +++ b/Mac/Demo/cgi/realcgitest.py @@ -4,6 +4,8 @@ from MiniAEFrame import AEServer, MiniApplication import MacOS +debug=1 + class CGITest(AEServer, MiniApplication): def __init__(self): @@ -12,6 +14,8 @@ class CGITest(AEServer, MiniApplication): self.installaehandler('aevt', 'oapp', self.open_app) self.installaehandler('aevt', 'quit', self.quit) self.installaehandler('WWW\275', 'sdoc', self.cgihandler) + if debug: + self.installaehandler('****', '****', self.otherhandler) oldparams = MacOS.SchedParams(0, 0) self.mainloop() apply(MacOS.SchedParams, oldparams) @@ -21,8 +25,15 @@ class CGITest(AEServer, MiniApplication): def open_app(self, **args): pass - + + def otherhandler(self, *args, **kwargs): + print 'Unknown AppleEvent' + print 'args', args + print 'kwargs', kwargs + def cgihandler(self, pathargs, **args): + if debug: + print 'CGI request', pathargs, args rv = """HTTP/1.0 200 OK Server: Unknown; python-cgi-script MIME-Version: 1.0 diff --git a/Mac/Demo/example1/dnslookup-1.py b/Mac/Demo/example1/dnslookup-1.py index a59fb8e..294faad 100644 --- a/Mac/Demo/example1/dnslookup-1.py +++ b/Mac/Demo/example1/dnslookup-1.py @@ -20,7 +20,7 @@ ITEM_QUIT_BUTTON=4 def main(): """Main routine: open resource file, call dialog handler""" try: - Res.OpenResFile("dnslookup-1.rsrc") + Res.FSpOpenResFile("dnslookup-1.rsrc", 1) except Res.Error: EasyDialogs.Message("Cannot open dnslookup-1.rsrc") sys.exit(1) diff --git a/Mac/Demo/example1/dnslookup-1.rsrc b/Mac/Demo/example1/dnslookup-1.rsrc Binary files differindex 2514f56..6cf9fe9 100644 --- a/Mac/Demo/example1/dnslookup-1.rsrc +++ b/Mac/Demo/example1/dnslookup-1.rsrc diff --git a/Mac/Demo/example2/dnslookup-2.py b/Mac/Demo/example2/dnslookup-2.py index 970b2ab..82568d0 100644 --- a/Mac/Demo/example2/dnslookup-2.py +++ b/Mac/Demo/example2/dnslookup-2.py @@ -19,7 +19,7 @@ def main(): dummy = Res.GetResource('DLOG', ID_MAIN) except Res.Error: try: - Res.OpenResFile("dnslookup-2.rsrc") + Res.FSpOpenResFile("dnslookup-2.rsrc", 1) except Res.Error: EasyDialogs.Message("Cannot open dnslookup-2.rsrc") sys.exit(1) diff --git a/Mac/Demo/example2/dnslookup-2.rsrc b/Mac/Demo/example2/dnslookup-2.rsrc Binary files differindex 5276ee2..17b22d9 100644 --- a/Mac/Demo/example2/dnslookup-2.rsrc +++ b/Mac/Demo/example2/dnslookup-2.rsrc diff --git a/Mac/Demo/waste/htmled.py b/Mac/Demo/waste/htmled.py index 5aa0207..c6ae2e7 100644 --- a/Mac/Demo/waste/htmled.py +++ b/Mac/Demo/waste/htmled.py @@ -72,7 +72,7 @@ class WasteWindow(ScrolledWindow): return None, None oldrf = Res.CurResFile() try: - rf = Res.OpenResFile(self.path) + rf = Res.FSpOpenResFile(self.path, 1) except Res.Error: return None, None try: @@ -241,10 +241,10 @@ class WasteWindow(ScrolledWindow): # oldresfile = Res.CurResFile() try: - rf = Res.OpenResFile(self.path) + rf = Res.FSpOpenResFile(self.path, 3) except Res.Error: Res.CreateResFile(self.path) - rf = Res.OpenResFile(self.path) + rf = Res.FSpOpenResFile(self.path, 3) styles = Res.Resource('') soup = Res.Resource('') self.ted.WECopyRange(0, 0x3fffffff, None, styles, soup) diff --git a/Mac/Demo/waste/swed.py b/Mac/Demo/waste/swed.py index 83f29b7..473d777 100644 --- a/Mac/Demo/waste/swed.py +++ b/Mac/Demo/waste/swed.py @@ -59,7 +59,7 @@ class WasteWindow(ScrolledWindow): return None, None oldrf = Res.CurResFile() try: - rf = Res.OpenResFile(self.path) + rf = Res.FSpOpenResFile(self.path, 1) except Res.Error: return None, None try: @@ -210,10 +210,10 @@ class WasteWindow(ScrolledWindow): # oldresfile = Res.CurResFile() try: - rf = Res.OpenResFile(self.path) + rf = Res.FSpOpenResFile(self.path, 3) except Res.Error: Res.CreateResFile(self.path) - rf = Res.OpenResFile(self.path) + rf = Res.FSpOpenResFile(self.path, 3) styles = Res.Resource('') soup = Res.Resource('') self.ted.WECopyRange(0, 0x3fffffff, None, styles, soup) |