/[pac]/USPSWebUtilities/USPSExpressMailLabelTool.py
ViewVC logotype

Diff of /USPSWebUtilities/USPSExpressMailLabelTool.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by tvon, Thu Oct 9 22:27:30 2003 UTC revision 1.4 by tvon, Fri Oct 10 04:13:45 2003 UTC
# Line 17  import re Line 17  import re
17  import sys  import sys
18  import traceback  import traceback
19    
 from zLOG import LOG, INFO, WARNING  
   
 def log(summary='', text='', log_level=INFO):  
     LOG('USPSWebTool Debug', log_level, summary, text)  
   
20  legal_fields = (  legal_fields = (
21      'Option',      'Option',
22      'EMCAAccount',      'EMCAAccount',
# Line 95  class USPSRequest: Line 90  class USPSRequest:
90    
91      def execute(self, servername):      def execute(self, servername):
92          #print self.xml          #print self.xml
         log(text=self.xml)  
93          res = urllib.urlopen("%s?API=ExpressMailLabelCertify&%s" % (servername, urllib.urlencode({'XML' : self.xml})))          res = urllib.urlopen("%s?API=ExpressMailLabelCertify&%s" % (servername, urllib.urlencode({'XML' : self.xml})))
94    
95          return USPSResult(res.read())          return USPSResult(res.read())
# Line 124  class USPSResult: Line 118  class USPSResult:
118          for field in legal_fields:          for field in legal_fields:
119              self.fields[field] = ''              self.fields[field] = ''
120    
         log(text=xml_s)  
121          if xml_s != None:          if xml_s != None:
122              self.parser.Parse(xml_s)              self.parser.Parse(xml_s)
123              self.xml_s = xml_s              self.xml_s = xml_s

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26