Update of /cvsroot/pywin32/pywin32/isapi/samples
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/isapi/samples
Modified Files:
Tag: py3k
advanced.py redirector.py test.py
Log Message:
many more upgrades to py3k syntax
Index: test.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/samples/test.py,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -C2 -d -r1.1 -r1.1.4.1
*** test.py 12 Oct 2006 07:00:37 -0000 1.1
--- test.py 26 Nov 2008 09:03:30 -0000 1.1.4.1
***************
*** 35,39 ****
win32event.INFINITE)
win32file.FindNextChangeNotification(self.handle)
! except win32event.error, details:
# handle closed - thread should terminate.
if details[0] != winerror.ERROR_INVALID_HANDLE:
--- 35,39 ----
win32event.INFINITE)
win32file.FindNextChangeNotification(self.handle)
! except win32event.error as details:
# handle closed - thread should terminate.
if details[0] != winerror.ERROR_INVALID_HANDLE:
***************
*** 42,46 ****
this_time = os.stat(self.filename)[stat.ST_MTIME]
if this_time != last_time:
! print "Detected file change - flagging for reload."
self.change_detected = True
last_time = this_time
--- 42,46 ----
this_time = os.stat(self.filename)[stat.ST_MTIME]
if this_time != last_time:
! print("Detected file change - flagging for reload.")
self.change_detected = True
last_time = this_time
***************
*** 50,54 ****
def TransmitFileCallback(ecb, hFile, cbIO, errCode):
! print "Transmit complete!"
ecb.close()
--- 50,54 ----
def TransmitFileCallback(ecb, hFile, cbIO, errCode):
! print("Transmit complete!")
ecb.close()
***************
*** 67,71 ****
# rendered to the browser.
if self.reload_watcher.change_detected:
! print "Doing reload"
raise InternalReloadException
--- 67,71 ----
# rendered to the browser.
if self.reload_watcher.change_detected:
! print("Doing reload")
raise InternalReloadException
***************
*** 91,97 ****
# default response
ecb.SendResponseHeaders("200 OK", "Content-Type: text/html\r\n\r\n", 0)
! print >> ecb, "<HTML><BODY>"
! print >> ecb, "The root of this site is at", ecb.MapURLToPath("/")
! print >> ecb, "</BODY></HTML>"
ecb.close()
return isapicon.HSE_STATUS_SUCCESS
--- 91,97 ----
# default response
ecb.SendResponseHeaders("200 OK", "Content-Type: text/html\r\n\r\n", 0)
! print("<HTML><BODY>", file=ecb)
! print("The root of this site is at", ecb.MapURLToPath("/"), file=ecb)
! print("</BODY></HTML>", file=ecb)
ecb.close()
return isapicon.HSE_STATUS_SUCCESS
***************
*** 114,125 ****
# Post install hook for our entire script
def PostInstall(params, options):
! print
! print "The sample has been installed."
! print "Point your browser to /PyISAPITest"
# Handler for our custom 'status' argument.
def status_handler(options, log, arg):
"Query the status of something"
! print "Everything seems to be fine!"
custom_arg_handlers = {"status": status_handler}
--- 114,125 ----
# Post install hook for our entire script
def PostInstall(params, options):
! print()
! print("The sample has been installed.")
! print("Point your browser to /PyISAPITest")
# Handler for our custom 'status' argument.
def status_handler(options, log, arg):
"Query the status of something"
! print("Everything seems to be fine!")
custom_arg_handlers = {"status": status_handler}
Index: advanced.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/samples/advanced.py,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** advanced.py 9 Sep 2006 03:29:30 -0000 1.2
--- advanced.py 26 Nov 2008 09:03:30 -0000 1.2.4.1
***************
*** 76,80 ****
win32event.INFINITE)
win32file.FindNextChangeNotification(self.handle)
! except win32event.error, details:
# handle closed - thread should terminate.
if details[0] != winerror.ERROR_INVALID_HANDLE:
--- 76,80 ----
win32event.INFINITE)
win32file.FindNextChangeNotification(self.handle)
! except win32event.error as details:
# handle closed - thread should terminate.
if details[0] != winerror.ERROR_INVALID_HANDLE:
***************
*** 83,87 ****
this_time = os.stat(self.filename)[stat.ST_MTIME]
if this_time != last_time:
! print "Detected file change - flagging for reload."
self.change_detected = True
last_time = this_time
--- 83,87 ----
this_time = os.stat(self.filename)[stat.ST_MTIME]
if this_time != last_time:
! print("Detected file change - flagging for reload.")
self.change_detected = True
last_time = this_time
***************
*** 104,115 ****
# rendered to the browser.
if self.reload_watcher.change_detected:
! print "Doing reload"
raise InternalReloadException
ecb.SendResponseHeaders("200 OK", "Content-Type: text/html\r\n\r\n", 0)
! print >> ecb, "<HTML><BODY>"
! print >> ecb, "This module has been imported"
! print >> ecb, "%d times" % (reload_counter,)
! print >> ecb, "</BODY></HTML>"
ecb.close()
return isapicon.HSE_STATUS_SUCCESS
--- 104,115 ----
# rendered to the browser.
if self.reload_watcher.change_detected:
! print("Doing reload")
raise InternalReloadException
ecb.SendResponseHeaders("200 OK", "Content-Type: text/html\r\n\r\n", 0)
! print("<HTML><BODY>", file=ecb)
! print("This module has been imported", file=ecb)
! print("%d times" % (reload_counter,), file=ecb)
! print("</BODY></HTML>", file=ecb)
ecb.close()
return isapicon.HSE_STATUS_SUCCESS
***************
*** 132,145 ****
# Post install hook for our entire script
def PostInstall(params, options):
! print
! print "The sample has been installed."
! print "Point your browser to /AdvancedPythonSample"
! print "If you modify the source file and reload the page,"
! print "you should see the reload counter increment"
# Handler for our custom 'status' argument.
def status_handler(options, log, arg):
"Query the status of something"
! print "Everything seems to be fine!"
custom_arg_handlers = {"status": status_handler}
--- 132,145 ----
# Post install hook for our entire script
def PostInstall(params, options):
! print()
! print("The sample has been installed.")
! print("Point your browser to /AdvancedPythonSample")
! print("If you modify the source file and reload the page,")
! print("you should see the reload counter increment")
# Handler for our custom 'status' argument.
def status_handler(options, log, arg):
"Query the status of something"
! print("Everything seems to be fine!")
custom_arg_handlers = {"status": status_handler}
Index: redirector.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/samples/redirector.py,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** redirector.py 12 Oct 2006 01:48:44 -0000 1.2
--- redirector.py 26 Nov 2008 09:03:30 -0000 1.2.4.1
***************
*** 56,60 ****
if url.startswith(virtualdir):
new_url = proxy + url[len(virtualdir):]
! print "Opening", new_url
fp = urllib.urlopen(new_url)
headers = fp.info()
--- 56,60 ----
if url.startswith(virtualdir):
new_url = proxy + url[len(virtualdir):]
! print("Opening", new_url)
fp = urllib.urlopen(new_url)
headers = fp.info()
***************
*** 62,70 ****
ecb.WriteClient(fp.read())
ecb.DoneWithSession()
! print "Returned data from '%s'!" % (new_url,)
else:
# this should never happen - we should only see requests that
# start with our virtual directory name.
! print "Not proxying '%s'" % (url,)
--- 62,70 ----
ecb.WriteClient(fp.read())
ecb.DoneWithSession()
! print("Returned data from '%s'!" % (new_url,))
else:
# this should never happen - we should only see requests that
# start with our virtual directory name.
! print("Not proxying '%s'" % (url,))
***************
*** 87,91 ****
if not url.startswith(prefix):
new_url = prefix + url
! print "New proxied URL is '%s'" % (new_url,)
pp.SetHeader("url", new_url)
# For the sake of demonstration, show how the FilterContext
--- 87,91 ----
if not url.startswith(prefix):
new_url = prefix + url
! print("New proxied URL is '%s'" % (new_url,))
pp.SetHeader("url", new_url)
# For the sake of demonstration, show how the FilterContext
***************
*** 96,103 ****
fc.FilterContext = 0
fc.FilterContext += 1
! print "This is request number", fc.FilterContext, "on this connection"
return isapicon.SF_STATUS_REQ_HANDLED_NOTIFICATION
else:
! print "Filter ignoring URL '%s'" % (url,)
# Some older code that handled SF_NOTIFY_URL_MAP.
--- 96,103 ----
fc.FilterContext = 0
fc.FilterContext += 1
! print("This is request number", fc.FilterContext, "on this connection")
return isapicon.SF_STATUS_REQ_HANDLED_NOTIFICATION
else:
! print("Filter ignoring URL '%s'" % (url,))
# Some older code that handled SF_NOTIFY_URL_MAP.
|