Changeset 638 for tea4cups

Show
Ignore:
Timestamp:
05/29/05 00:05:02 (19 years ago)
Author:
jerome
Message:

Backported PyKota's fix for unsupported IPP attributes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tea4cups/trunk/tea4cups

    r636 r638  
    107107                     print "  %s : %s" % (key, attrdict[key]) 
    108108    """ 
     109    attributes_types = ("operation", "job", "printer", "unsupported") 
    109110    def __init__(self, data, debug=0) : 
    110111        """Initializes and parses IPP Message object. 
     
    117118        self.debug = debug 
    118119        self.data = data 
    119         self.operation_attributes = {} 
    120         self.job_attributes = {} 
    121         self.printer_attributes = {} 
    122         self.unsupported_attributes = {} 
     120        for attrtype in self.attributes_types : 
     121            setattr(self, "%s_attributes" % attrtype, {}) 
    123122        self.tags = [ None ] * 256      # by default all tags reserved 
    124123         
     
    247246             
    248247        # Now transform all one-element lists into single values 
    249         for attrtype in ("operation", "job", "printer") : 
     248        for attrtype in self.attributes_types : 
    250249            attrdict = getattr(self, "%s_attributes" % attrtype) 
    251250            for (key, value) in attrdict.items() :