Changeset 2273 for pykota

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

Cleaned the ipp class a bit

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/ipp.py

    r2272 r2273  
    4242        return self.message 
    4343    __str__ = __repr__ 
    44  
    45 attributes_types = ("operation", "job", "printer", "unsupported") 
    4644 
    4745class IPPMessage : 
     
    6361                     print "  %s : %s" % (key, attrdict[key]) 
    6462    """ 
     63    attributes_types = ("operation", "job", "printer", "unsupported") 
    6564    def __init__(self, data, debug=0) : 
    6665        """Initializes and parses IPP Message object. 
     
    7372        self.debug = debug 
    7473        self.data = data 
    75         for attrtype in attributes_types : 
     74        for attrtype in self.attributes_types : 
    7675            setattr(self, "%s_attributes" % attrtype, {}) 
    7776        self.tags = [ None ] * 256      # by default all tags reserved 
     
    201200             
    202201        # Now transform all one-element lists into single values 
    203         for attrtype in attributes_types : 
     202        for attrtype in self.attributes_types : 
    204203            attrdict = getattr(self, "%s_attributes" % attrtype) 
    205204            for (key, value) in attrdict.items() : 
     
    217216        print "IPP operation Id : %s" % message.operation_id 
    218217        print "IPP request Id : %s" % message.request_id 
    219         for attrtype in attributes_types : 
     218        for attrtype in message.attributes_types : 
    220219            attrdict = getattr(message, "%s_attributes" % attrtype) 
    221220            if attrdict :