Changeset 75c0cab


Ignore:
Timestamp:
Mar 10, 2011, 12:45:11 AM (13 years ago)
Author:
Quentin Smith <quentin@…>
Branches:
no-cups
Children:
a76f440
Parents:
a6a1f43
git-author:
Quentin Smith <quentin@…> (03/10/11 00:45:11)
git-committer:
Quentin Smith <quentin@…> (03/10/11 00:45:11)
Message:

More work on ippattribute to match the interface of ippvalue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/ippattribute.py

    rfc427ef r75c0cab  
    6666                   "Value must be of type Value"
    6767
    68         self.name = None
    69         self.values = None
    70 
    71         if name is not None:
    72             self.name = name
    73         if name is not None and len(values) > 0:
    74             self.values = values
    75             self.binary = self.pack()
    76             self.verify()
     68        self.name = name
     69        self.values = values
    7770
    7871    @property
     
    140133        Gets the total size of the attribute.
    141134        """
    142         return 2+len(self.name)+sum(v.total_size for v in self.values)
     135        return len(self.packed_value)
    143136
    144137    total_size = packed_value_size
     
    156149       
    157150        return "%s: %s" % (name, str(values))
     151
     152    def __repr__(self):
     153        return '<IPPAttribute (%r, %r)>' % (self.name, self.values)
Note: See TracChangeset for help on using the changeset viewer.