summaryrefslogtreecommitdiff
path: root/Mac/Demo/cgi/realcgitest.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-06-20 22:01:04 +0000
committerJack Jansen <jack.jansen@cwi.nl>2000-06-20 22:01:04 +0000
commit8eff33b51fff0570fe3a68668073253ec18a2631 (patch)
tree9907a4db464e263a22dc598cf9d3d1b27cfd347b /Mac/Demo/cgi/realcgitest.py
parentd13c3854629d605236c4d7cc8589a647b069207e (diff)
downloadcpython-git-8eff33b51fff0570fe3a68668073253ec18a2631.tar.gz
Added an optional debug handler that traps and prints all unknown appleevents.
Diffstat (limited to 'Mac/Demo/cgi/realcgitest.py')
-rw-r--r--Mac/Demo/cgi/realcgitest.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/Mac/Demo/cgi/realcgitest.py b/Mac/Demo/cgi/realcgitest.py
index a91771a83f..e51cb97820 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