Index: server/lib/ippattribute.py
===================================================================
--- server/lib/ippattribute.py	(revision c269bc7fb4d107878536921b17ef5bd63edabf68)
+++ server/lib/ippattribute.py	(revision fc427efea9498e7a614f7cff5639b844731cef56)
@@ -7,5 +7,5 @@
 logger = logging.getLogger("ippLogger")
 
-class Attribute():
+class Attribute(object):
     """
     In addition to what the RFC reports, an attribute has an
@@ -76,5 +76,6 @@
             self.verify()
 
-    def pack(self):
+    @property
+    def packed_value(self):
         """
         Packs the attribute data into binary data.
@@ -88,5 +89,4 @@
         # get the binary data for all the values
         values = []
-        length = 0
         for v, i in zip(self.values, xrange(len(self.values))):
 
@@ -99,13 +99,14 @@
 
             # get the value length and binary value
-            value_length, value_bin = v.pack()
+            value_bin = v.packed_value
+            value_length = len(value_bin)
 
             logger.debug("dumping name_length : %i" % name_length)
             logger.debug("dumping name : %s" % self.name)
             logger.debug("dumping value_length : %i" % value_length)
-            logger.debug("dumping value : %s" % v.getValue())
+            logger.debug("dumping value : %s" % v.value)
 
             # the value tag in binary
-            value_tag_bin = struct.pack('>b', v.getValueTag())
+            value_tag_bin = struct.pack('>b', v.value_tag)
 
             # the name length in binary
@@ -130,85 +131,16 @@
                                        value_bin]))
 
-            length += 2            # name-length
-            length += name_length  # name
-            length += value_length # value
-                
         # concatenate everything together and return it along with the
         # total length of the attribute
-        return length, ''.join(values)
+        return ''.join(values)
 
-    def getName(self):
-        """
-        Get the attribute's name.
-        """
-        
-        return self.name
-
-    def getValues(self):
-        """
-        Get the list of values contained in the attribute.
-        """
-        
-        return self.values
-
-    def setName(self, name):
-        """
-        Set the attribute's name.
-        """
-
-        assert isinstance(name, str), \
-               "name must be a string!"
-        
-        self.name = name
-
-    def setValues(self, values):
-        """
-        Set the list of values contained in the attribute.
-        """
-
-        for v in values:
-            assert isinstance(v, Value), \
-                   "value must be of type Value!"
-        
-        self.values = values
-
-    def addValue(self, value):
-        """
-        Add a new value to the list of values contained in the
-        attribute."
-
-        assert isinstance(value, Value), \
-               "value must be of type Value!"
-
-        self.values.append(value)
-
-    def getSize(self):
+    @property
+    def packed_value_size(self):
         """
         Gets the total size of the attribute.
         """
+        return 2+len(self.name)+sum(v.total_size for v in self.values)
 
-        size = 2 + len(self.name)
-        for v in self.values:
-            size += v.getTotalSize()
-
-    def verify(self):
-        """
-        Check to make sure that the Attribute is valid.  This means
-        that is should have a name and a list of values, and that its
-        binary representation should match up to the stored binary
-        representation.
-        """
-        
-        assert self.name is not None, \
-               "attribute has no name!"
-        assert len(self.value) > 0, \
-               "attribute has no values!"
-
-        size, bindata = self.pack()
-
-        assert size == self.getSize(), \
-               "pack size does not match self.getSize()!"
-        assert bindata == self.binary_data, \
-               "packed binary data does not match self.binary_data!"
+    total_size = packed_value_size
 
     def __str__(self):
