Index: server/lib/gutenbach/ipp/core/attribute.py
===================================================================
--- server/lib/gutenbach/ipp/core/attribute.py	(revision 793432f59cc3f6d9a34ba213d3911b9cb3b86b05)
+++ server/lib/gutenbach/ipp/core/attribute.py	(revision ffbe41dc14056c0f5a55064f93b535e455ba5f70)
@@ -59,12 +59,11 @@
         """
 
-        if name is not None:
-            assert isinstance(name, str), \
-                   "Attribute name must be a string!"
+        if name is not None and not isinstance(name, str):
+            raise ValueError("attribute name must be a string")
         if values is None:
             values = []
         for value in values:
-            assert isinstance(value, Value), \
-                   "Value %s must be of type Value" % (value,)
+            if not isinstance(value, Value):
+                raise ValueError("value %s must be of type Value" % (value,))
 
         self.name = name
@@ -83,8 +82,8 @@
         """
 
-        assert self.name is not None, \
-               "cannot pack unnamed attribute!"
-        assert len(self.values) > 0, \
-               "cannot pack empty attribute!"
+        if self.name is None:
+            raise ValueError, "cannot pack unnamed attribute"
+        if len(self.values) == 0:
+            raise ValueError, "cannot pack empty attribute"
 
         # get the binary data for all the values
@@ -94,8 +93,5 @@
             # get the name length (0 for everything but the first
             # value)
-            if i == 0:
-                name_length = len(self.name)
-            else:
-                name_length = 0
+            name_length = len(self.name) if i == 0 else 0
 
             logger.debug("dumping name : %s" % self.name)
@@ -113,25 +109,16 @@
             # the value tag in binary
             tag_bin = struct.pack('>b', v.tag)
-
             # the name length in binary
             name_length_bin = struct.pack('>h', name_length)
-
             # the name in binary
             name_bin = self.name
-
             # the value length in binary
             value_length_bin = struct.pack('>h', value_length)
 
+            # add the binary value to the list of values
+            vlist = [tag_bin, name_length_bin, value_length_bin, value_bin]
             if i == 0:
-                values.append(''.join([tag_bin,
-                                       name_length_bin,
-                                       name_bin,
-                                       value_length_bin,
-                                       value_bin]))
-            else:
-                values.append(''.join([tag_bin,
-                                       name_length_bin,
-                                       value_length_bin,
-                                       value_bin]))
+                vlist.insert(2, name_bin)
+            values.append(''.join(vlist))
 
         # concatenate everything together and return it along with the
Index: server/lib/gutenbach/ipp/core/attributegroup.py
===================================================================
--- server/lib/gutenbach/ipp/core/attributegroup.py	(revision 793432f59cc3f6d9a34ba213d3911b9cb3b86b05)
+++ server/lib/gutenbach/ipp/core/attributegroup.py	(revision ffbe41dc14056c0f5a55064f93b535e455ba5f70)
@@ -33,7 +33,6 @@
         """
 
-        if tag is not None:
-            assert isinstance(tag, int), \
-                   "tag must be a character!"
+        if tag is not None and not isinstance(tag, int):
+            raise ValueError("tag must be a character")
 
         self.tag = tag
@@ -87,6 +86,6 @@
 
         for a in attributes:
-            assert isinstance(a, Attribute), \
-                   "attribute must be of type Attribute!"
+            if not isinstance(a, Attribute):
+                raise ValueError("attribute must be of type Attribute")
 
         for a in attributes:
Index: server/lib/gutenbach/ipp/core/request.py
===================================================================
--- server/lib/gutenbach/ipp/core/request.py	(revision ce2abc5b3d0f21e3ba1b4cfb8e693f55bb957284)
+++ server/lib/gutenbach/ipp/core/request.py	(revision ffbe41dc14056c0f5a55064f93b535e455ba5f70)
@@ -71,14 +71,21 @@
         if request is None:
             # make sure the version number isn't empty
-            assert version is not None
+            if version is None:
+                raise ValueError("version must not be None")
             # make sure verison is a tuple of length 2
-            assert isinstance(version, tuple)
-            assert len(version) == 2
+            if not hasattr(version, '__iter__'):
+                raise ValueError("version must be iterable")
+            if len(version) != 2:
+                raise ValueError("version must be of length 2")
             # make sure the operation id isn't empty
-            assert operation_id is not None
+            if operation_id is None:
+                raise ValueError("operation_id may not be None")
             # make sure the request id isn't empty
-            assert request_id is not None
+            if request_id is None:
+                raise ValueError("request_id may not be None")
             # make sure attribute_groups is a list of Attributes
-            for a in attribute_groups: assert isinstance(a, AttributeGroup)
+            for a in attribute_groups:
+                if not isinstance(a, AttributeGroup):
+                    raise ValueError("attribute not of type AttributeGroup")
             
         # if the request isn't None, then we'll read directly from
@@ -90,5 +97,5 @@
             
             # read the version-number (two signed chars)
-            self.version        = struct.unpack('>bb', request.read(2))
+            self.version = struct.unpack('>bb', request.read(2))
             length -= 2
             logger.debug("version-number : (0x%X, 0x%X)" % self.version)
@@ -96,10 +103,10 @@
             # read the operation-id (or status-code, but that's only
             # for a response) (signed short)
-            self.operation_id   = struct.unpack('>h', request.read(2))[0]
+            self.operation_id = struct.unpack('>h', request.read(2))[0]
             length -= 2
             logger.debug("operation-id : 0x%X" % self.operation_id)
 
             # read the request-id (signed int)
-            self.request_id     = struct.unpack('>i', request.read(4))[0]
+            self.request_id = struct.unpack('>i', request.read(4))[0]
             length -= 4
             logger.debug("request-id : 0x%X" % self.request_id)
@@ -130,9 +137,9 @@
                     
                     # read in the value tag (signed char)
-                    value_tag     = next_byte
+                    value_tag = next_byte
                     logger.debug("value-tag : 0x%X" % value_tag)
                     
                     # read in the length of the name (signed short)
-                    name_length   = struct.unpack('>h', request.read(2))[0]
+                    name_length = struct.unpack('>h', request.read(2))[0]
                     length -= 2
                     logger.debug("name-length : %i" % name_length)
@@ -140,15 +147,15 @@
                     if name_length != AttributeTags.ZERO_NAME_LENGTH:
                         # read the name (a string of name_length bytes)
-                        name          = request.read(name_length)
+                        name = request.read(name_length)
                         length -= name_length
                         logger.debug("name : %s" % name)
                     
                         # read in the length of the value (signed short)
-                        value_length  = struct.unpack('>h', request.read(2))[0]
+                        value_length = struct.unpack('>h', request.read(2))[0]
                         length -= 2
                         logger.debug("value-length : %i" % value_length)
                     
                         # read in the value (string of value_length bytes)
-                        value         = request.read(value_length)
+                        value = request.read(value_length)
                         length -= value_length
                         
@@ -162,10 +169,10 @@
                     else:
                         # read in the length of the value (signed short)
-                        value_length  = struct.unpack('>h', request.read(2))[0]
+                        value_length = struct.unpack('>h', request.read(2))[0]
                         length -= 2
                         logger.debug("value-length : %i" % value_length)
                     
                         # read in the value (string of value_length bytes)
-                        value         = request.read(value_length)
+                        value = request.read(value_length)
                         length -= value_length
 
@@ -214,15 +221,23 @@
 
         # make sure the version number isn't empty
-        assert self.version is not None
+        if self.version is None:
+            raise ValueError("version is None")
         # make sure verison is a tuple of length 2
-        assert isinstance(self.version, tuple)
-        assert len(self.version) == 2
+        if not hasattr(self.version, '__iter__'):
+            raise ValueError("version is not iterable")
+        if len(self.version) != 2:
+            raise ValueError("version is not of length 2")
         # make sure the operation id isn't empty
-        assert self.operation_id is not None
+        if self.operation_id is None:
+            raise ValueError("operation_id is None")
         # make sure the request id isn't empty
-        assert self.request_id is not None
+        if self.request_id is None:
+            raise ValueError("request_id is None")
         # make sure attribute_groups is a list of Attributes
-        assert len(self.attribute_groups) > 0
-        for a in self.attribute_groups: assert isinstance(a, AttributeGroup)
+        if len(self.attribute_groups) == 0:
+            raise ValueError("no attribute groups")
+        for a in self.attribute_groups:
+            if not isinstance(a, AttributeGroup):
+                raise ValueError("not of type AttributeGroup")
 
         # convert the version, operation id, and request id to binary
Index: server/lib/gutenbach/ipp/core/value.py
===================================================================
--- server/lib/gutenbach/ipp/core/value.py	(revision 793432f59cc3f6d9a34ba213d3911b9cb3b86b05)
+++ server/lib/gutenbach/ipp/core/value.py	(revision ffbe41dc14056c0f5a55064f93b535e455ba5f70)
@@ -46,12 +46,10 @@
 
         # make sure the arguments are valid
-        if value is not None:
-            assert tag is not None, \
-                   "tag must not be null because " + \
-                   "value is not null!"
+        if value is not None and tag is None:
+            raise ValueError("tag may not be None")
 
         # initialize member variables
-        self.tag = tag # one byte, the type of value
-        self.value     = value     # non-binary value of self.value
+        self.tag   = tag    # one byte, the type of value
+        self.value = value  # non-binary value of self.value
 
     def __cmp__(self, other):
@@ -76,8 +74,8 @@
         """
 
-        assert tag is not None, \
-               "Cannot unpack values with unspecified value tag!"
-        assert packed_value is not None, \
-               "Cannot unpack null values!"
+        if tag is None:
+            raise ValueError("cannot unpack values with no value tag")
+        if packed_value is None:
+            raise ValueError("cannot unpack null values")
 
         value = None
@@ -172,9 +170,9 @@
 
         """
-        
-        assert self.tag is not None, \
-               "cannot pack value with null value tag!"
-        assert self.value is not None, \
-               "cannot pack null value!"
+
+        if self.tag is None:
+            raise ValueError("cannot pack value with null tag")
+        if self.value is None:
+            raise ValueError("cannot pack null value")
 
         packed_value = None
@@ -221,5 +219,5 @@
             # contains the units
 
-            packed_value = truct.pack('>iib', *self.value)
+            packed_value = struct.pack('>iib', *self.value)
             
         elif self.tag == OctetStringTags.RANGE_OF_INTEGER:
@@ -291,8 +289,4 @@
         return self.packed_value_size + 1
 
-    @property
-    def pyobj(self):
-        return (self.tag, self.value)
-
     def __str__(self):
         return str(self.value)
Index: server/lib/gutenbach/server/printer.py
===================================================================
--- server/lib/gutenbach/server/printer.py	(revision ce2abc5b3d0f21e3ba1b4cfb8e693f55bb957284)
+++ server/lib/gutenbach/server/printer.py	(revision ffbe41dc14056c0f5a55064f93b535e455ba5f70)
@@ -1,3 +1,2 @@
-#import alsaaudio as aa
 from . import InvalidJobException, InvalidPrinterStateException
 from . import Job
@@ -45,5 +44,4 @@
         
 
-    #def __init__(self, name, card, mixer):
     def __init__(self, name):
 
@@ -52,14 +50,4 @@
         self.time_created = int(time.time())
         self.state = "idle"
-
-	# if card >= len(aa.cards()):
-	#     raise aa.ALSAAudioError(
-	# 	"Audio card at index %d does not exist!" % card)
-	# elif mixer not in aa.mixers(card):
-	#     raise aa.ALSAAudioError(
-	# 	"Audio mixer '%s' does not exist!" % mixer)
-	
-	# self.card = card
-	# self.mixer = mixer
 
 	self.finished_jobs = []
Index: server/lib/gutenbach/server/requests.py
===================================================================
--- server/lib/gutenbach/server/requests.py	(revision e58af053711ea43159e19ceeb7875364174b2b1f)
+++ server/lib/gutenbach/server/requests.py	(revision ffbe41dc14056c0f5a55064f93b535e455ba5f70)
@@ -281,5 +281,4 @@
         """
 
-
         operation = request.attribute_groups[0]
 
Index: server/lib/gutenbach/server/server.py
===================================================================
--- server/lib/gutenbach/server/server.py	(revision e58af053711ea43159e19ceeb7875364174b2b1f)
+++ server/lib/gutenbach/server/server.py	(revision ffbe41dc14056c0f5a55064f93b535e455ba5f70)
@@ -79,5 +79,7 @@
                 chunk = self.rfile.read(size)
                 clrf = self.rfile.read(2)
-                assert clrf == "\r\n"
+                if clrf != "\r\n":
+                    raise ipp.errors.ServerErrorInternalError(
+                        "clrf != \\r\\n (is '%s')" % clrf)
                 tmp.write(chunk)
 
