Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 5408:e46ce04d5bbc
Python 3 preparation: update xmlrpclib / SimpleXMLRPCServer imports.
New roundup/anypy/xmlrpc_.py added. Manual patch.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Wed, 25 Jul 2018 00:16:00 +0000 |
| parents | 23b8e6067f7c |
| children | c749d6795bc2 |
comparison
equal
deleted
inserted
replaced
| 5407:f004824563a3 | 5408:e46ce04d5bbc |
|---|---|
| 40 | 40 |
| 41 from roundup.anypy.cookie_ import CookieError, BaseCookie, SimpleCookie, \ | 41 from roundup.anypy.cookie_ import CookieError, BaseCookie, SimpleCookie, \ |
| 42 get_cookie_date | 42 get_cookie_date |
| 43 from roundup.anypy import http_ | 43 from roundup.anypy import http_ |
| 44 from roundup.anypy import urllib_ | 44 from roundup.anypy import urllib_ |
| 45 from roundup.anypy import xmlrpc_ | |
| 45 | 46 |
| 46 from email.MIMEBase import MIMEBase | 47 from email.MIMEBase import MIMEBase |
| 47 from email.MIMEText import MIMEText | 48 from email.MIMEText import MIMEText |
| 48 from email.MIMEMultipart import MIMEMultipart | 49 from email.MIMEMultipart import MIMEMultipart |
| 49 import roundup.anypy.email_ | 50 import roundup.anypy.email_ |
| 50 import xmlrpclib | |
| 51 | 51 |
| 52 def initialiseSecurity(security): | 52 def initialiseSecurity(security): |
| 53 '''Create some Permissions and Roles on the security object | 53 '''Create some Permissions and Roles on the security object |
| 54 | 54 |
| 55 This function is directly invoked by security.Security.__init__() | 55 This function is directly invoked by security.Security.__init__() |
| 464 # raises exception on check failure. | 464 # raises exception on check failure. |
| 465 csrf_ok = self.handle_csrf(xmlrpc=True) | 465 csrf_ok = self.handle_csrf(xmlrpc=True) |
| 466 except (Unauthorised, UsageError) as msg: | 466 except (Unauthorised, UsageError) as msg: |
| 467 # report exception back to server | 467 # report exception back to server |
| 468 exc_type, exc_value, exc_tb = sys.exc_info() | 468 exc_type, exc_value, exc_tb = sys.exc_info() |
| 469 output = xmlrpclib.dumps( | 469 output = xmlrpc_.client.dumps( |
| 470 xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)), | 470 xmlrpc_.client.Fault(1, "%s:%s" % (exc_type, exc_value)), |
| 471 allow_none=True) | 471 allow_none=True) |
| 472 csrf_ok = False # we had an error, failed check | 472 csrf_ok = False # we had an error, failed check |
| 473 | 473 |
| 474 if csrf_ok == True: | 474 if csrf_ok == True: |
| 475 handler = xmlrpc.RoundupDispatcher(self.db, | 475 handler = xmlrpc.RoundupDispatcher(self.db, |
