Index: /pkipplib/trunk/notifiers/samplenotifier
===================================================================
--- /pkipplib/trunk/notifiers/samplenotifier (revision 45)
+++ /pkipplib/trunk/notifiers/samplenotifier (revision 3437)
@@ -1,4 +1,4 @@
 #! /usr/bin/env python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkipplib : IPP and CUPS support for Python
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -38,13 +38,13 @@
     # First thing we do is put stdin in non-blocking mode.
     fd = sys.stdin.fileno()
-    fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, 
+    fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL,
                     fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK)
 
     # then we read the notification CUPS sent us to our stdin
     notification = pkipplib.IPPRequest(sys.stdin.read())
-    
+
     # now we parse it
     notification.parse()
-    
+
     # then we act one way or another, depending on the event received.
     event = notification.event_notification["notify-subscribed-event"][0][1]
@@ -53,5 +53,5 @@
         if event.endswith("-added") :
             action = "add"
-        else :    
+        else :
             action = "delete"
         os.system('/usr/bin/pkprinters --%s "%s"' % (action, printername))
Index: /pkipplib/trunk/tests/test.py
===================================================================
--- /pkipplib/trunk/tests/test.py (revision 45)
+++ /pkipplib/trunk/tests/test.py (revision 3437)
@@ -1,4 +1,4 @@
 #! /usr/bin/env python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkipplib : IPP and CUPS support for Python
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -23,6 +23,6 @@
 
 sys.path.insert(0, "../pkipplib")
-import pkipplib        
-    
+import pkipplib
+
 cups = pkipplib.CUPS()
 answer = cups.createSubscription("ipp://localhost/", ["printer-added", "printer-deleted"],
Index: /pkipplib/trunk/tests/printjob.py
===================================================================
--- /pkipplib/trunk/tests/printjob.py (revision 46)
+++ /pkipplib/trunk/tests/printjob.py (revision 3437)
@@ -1,3 +1,3 @@
-#! /usr/bin/env python
+y#! /usr/bin/env python
 # -*- coding: ISO-8859-15 -*-
 #
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
Index: /pkipplib/trunk/setup.py
===================================================================
--- /pkipplib/trunk/setup.py (revision 45)
+++ /pkipplib/trunk/setup.py (revision 3437)
@@ -1,4 +1,4 @@
 #! /usr/bin/env python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkipplib : IPP and CUPS support for Python
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
Index: /pkipplib/trunk/bin/pksubscribe
===================================================================
--- /pkipplib/trunk/bin/pksubscribe (revision 45)
+++ /pkipplib/trunk/bin/pksubscribe (revision 3437)
@@ -1,4 +1,4 @@
 #! /usr/bin/env python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkipplib : IPP and CUPS support for Python
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -28,7 +28,7 @@
 import optparse
 
-from pkipplib import pkipplib        
-    
-if __name__ == "__main__" :    
+from pkipplib import pkipplib
+
+if __name__ == "__main__" :
     try :
         locale.setlocale(locale.LC_ALL, "")
@@ -40,49 +40,49 @@
         gettext.NullTranslations().install()
     parser = optparse.OptionParser(usage="pksubscribe [options] [subscriptions ids]")
-    parser.add_option("-v", "--version", 
-                            action="store_true", 
+    parser.add_option("-v", "--version",
+                            action="store_true",
                             dest="version",
                             help=_("show pksubscribe's version number and exit."))
-    parser.add_option("-c", "--cups", 
-                            default="http://localhost:631", 
+    parser.add_option("-c", "--cups",
+                            default="http://localhost:631",
                             dest="cups",
                             help=_("the CUPS server to connect to. Defaults to http://localhost:631"))
-    parser.add_option("-d", "--debug", 
-                            action="store_true", 
+    parser.add_option("-d", "--debug",
+                            action="store_true",
                             dest="debug",
                             help=_("activate debug mode."))
-    parser.add_option("-X", "--delete", 
-                            action="store_true", 
+    parser.add_option("-X", "--delete",
+                            action="store_true",
                             dest="delete",
                             help=_("deletes subscriptions."))
-    parser.add_option("-p", "--printer", 
+    parser.add_option("-p", "--printer",
                             dest="printer",
                             help=_("the printer's name for a printer subscription."))
-    parser.add_option("-j", "--job", 
-                            type="int", 
+    parser.add_option("-j", "--job",
+                            type="int",
                             dest="job",
                             help=_("the job's id for a job subscripition."))
-    parser.add_option("-r", "--recipient",                        
+    parser.add_option("-r", "--recipient",
                             dest="recipient",
                             help=_("the recipient's uri."))
-    parser.add_option("-C", "--charset",                        
+    parser.add_option("-C", "--charset",
                             dest="charset",
                             help=_("the charset to use in notifications sent for this subscription."))
-    parser.add_option("-L", "--language",                        
+    parser.add_option("-L", "--language",
                             dest="language",
                             help=_("the language to use in notifications sent for this subscription."))
-    parser.add_option("-u", "--userdata",                        
+    parser.add_option("-u", "--userdata",
                             dest="userdata",
                             help=_("the user's data to use in notifications for this subscription."))
-    parser.add_option("-U", "--username",                        
+    parser.add_option("-U", "--username",
                             dest="username",
                             help=_("the user's name to use when connecting to the CUPS server."))
-    parser.add_option("-W", "--password",                        
+    parser.add_option("-W", "--password",
                             dest="password",
                             help=_("the user's password to use when connecting to the CUPS server."))
-    parser.add_option("-E", "--events",                        
+    parser.add_option("-E", "--events",
                             dest="events",
                             help=_("a comma separated list of events to subscribe to."))
-    parser.add_option("-P", "--pullmethod",                        
+    parser.add_option("-P", "--pullmethod",
                             dest="pullmethod",
                             help=_("the optional pull method's name."))
@@ -91,9 +91,9 @@
                             dest="duration",
                             help=_("the duration of the subscription."))
-    parser.add_option("-I", "--interval",                        
+    parser.add_option("-I", "--interval",
                             type="int",
                             dest="interval",
                             help=_("the time interval of the subscription."))
-                            
+
     (options, arguments) = parser.parse_args()
     if options.version :
@@ -102,9 +102,9 @@
         if not options.events and not options.delete :
             sys.stderr.write(_("You MUST pass a list of events to subscribe to.\n"))
-        elif not options.recipient and not options.delete :    
+        elif not options.recipient and not options.delete :
             sys.stderr.write(_("You MUST pass a recipient for the subscription.\n"))
-        elif options.delete and not arguments :    
+        elif options.delete and not arguments :
             sys.stderr.write(_("You MUST pass a subscriptions ids at the end of your command line.\n"))
-        else :    
+        else :
             cups = pkipplib.CUPS(options.cups,
                                  options.username,
@@ -112,13 +112,13 @@
                                  debug=options.debug)
             baseurl = options.cups.replace("http://", "ipp://")
-            if baseurl.endswith(":631") : 
+            if baseurl.endswith(":631") :
                 baseurl = baseurl[:-4]
             if options.printer :
                 url = "%s/printers/%s" % (baseurl, options.printer)
-            elif options.job :     
+            elif options.job :
                 url = "%s/jobs/%i" % (baseurl, options.job)
-            else :    
+            else :
                 url = baseurl
-            if not options.delete :    
+            if not options.delete :
                 answer = cups.createSubscription(url,
                                                  [e.strip() for e in options.events.split(",")],
@@ -131,11 +131,11 @@
                                                  timeinterval=options.interval,
                                                  jobid=options.job)
-                try :                                 
+                try :
                     subscriptionid = answer.subscription["notify-subscription-id"][0][1]
                 except KeyError :
                     sys.stderr.write("%s\n" % answer.operation["status-message"][0][1])
-                else :    
+                else :
                     print _("Subscription %i registered.") % subscriptionid
-            else :        
+            else :
                 for subid in [int(arg) for arg in arguments] :
                     answer = cups.cancelSubscription(url, subid, options.job)
@@ -143,9 +143,9 @@
                         try :
                             error = answer.operation["status-message"][0][1]
-                        except KeyError :    
+                        except KeyError :
                             print _("Subscription %i cancelled.") % subid
                         else :
                             sys.stderr.write("%s\n" % error)
-                    else :        
+                    else :
                         sys.stderr.write(_("Incorrect answer (None)\n"))
 
Index: /pkipplib/trunk/pkipplib/pkipplib.py
===================================================================
--- /pkipplib/trunk/pkipplib/pkipplib.py (revision 45)
+++ /pkipplib/trunk/pkipplib/pkipplib.py (revision 3437)
@@ -1,4 +1,4 @@
 #! /usr/bin/env python
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkipplib : IPP and CUPS support for Python
@@ -9,10 +9,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -238,5 +238,5 @@
 IPP_MULTIPLE_JOBS_NOT_SUPPORTED = 0x0509
 IPP_PRINTER_IS_DEACTIVATED = 0x50a
-  
+
 CUPS_PRINTER_LOCAL = 0x0000
 CUPS_PRINTER_CLASS = 0x0001
@@ -265,6 +265,6 @@
 CUPS_PRINTER_COMMANDS = 0x8000
 CUPS_PRINTER_OPTIONS = 0xe6ff
-  
-  
+
+
 class IPPError(Exception) :
     """An exception for IPP related stuff."""
@@ -282,5 +282,5 @@
         self.request = request
         self.name = name
-        
+
     def __setitem__(self, key, value) :
         """Appends the value to the real attribute."""
@@ -293,6 +293,6 @@
                     attribute[j][1].append(value)
                     return
-            attribute.append((key, [value]))        
-            
+            attribute.append((key, [value]))
+
     def __getitem__(self, key) :
         """Returns an attribute's value."""
@@ -307,18 +307,18 @@
         if answer :
             return answer
-        raise KeyError, key            
-    
+        raise KeyError, key
+
 class IPPRequest :
     """A class for IPP requests."""
     attributes_types = ("operation", "job", "printer", "unsupported", \
                                      "subscription", "event_notification")
-    def __init__(self, data="", version=IPP_VERSION, 
+    def __init__(self, data="", version=IPP_VERSION,
                                 operation_id=None, \
                                 request_id=None, \
                                 debug=False) :
         """Initializes an IPP Message object.
-        
+
            Parameters :
-           
+
              data : the complete IPP Message's content.
              debug : a boolean value to output debug info on stderr.
@@ -327,17 +327,17 @@
         self._data = data
         self.parsed = False
-        
+
         # Initializes message
-        self.setVersion(version)                
+        self.setVersion(version)
         self.setOperationId(operation_id)
         self.setRequestId(request_id)
         self.data = ""
-        
+
         for attrtype in self.attributes_types :
             setattr(self, "_%s_attributes" % attrtype, [[]])
-        
-        # Initialize tags    
+
+        # Initialize tags
         self.tags = [ None ] * 256 # by default all tags reserved
-        
+
         # Delimiter tags
         self.tags[0x01] = "operation-attributes-tag"
@@ -348,5 +348,5 @@
         self.tags[0x06] = "subscription-attributes-tag"
         self.tags[0x07] = "event_notification-attributes-tag"
-        
+
         # out of band values
         self.tags[0x10] = "unsupported"
@@ -357,5 +357,5 @@
         self.tags[0x16] = "delete-attribute"
         self.tags[0x17] = "admin-define"
-  
+
         # integer values
         self.tags[0x20] = "generic-integer"
@@ -363,5 +363,5 @@
         self.tags[0x22] = "boolean"
         self.tags[0x23] = "enum"
-        
+
         # octetString
         self.tags[0x30] = "octetString-with-an-unspecified-format"
@@ -373,5 +373,5 @@
         self.tags[0x36] = "nameWithLanguage"
         self.tags[0x37] = "endCollection"
-        
+
         # character strings
         self.tags[0x40] = "generic-character-string"
@@ -385,5 +385,5 @@
         self.tags[0x49] = "mimeMediaType"
         self.tags[0x4a] = "memberAttrName"
-        
+
         # Reverse mapping to generate IPP messages
         self.tagvalues = {}
@@ -392,6 +392,6 @@
             if value is not None :
                 self.tagvalues[value] = i
-                                     
-    def __getattr__(self, name) :                                 
+
+    def __getattr__(self, name) :
         """Fakes attribute access."""
         if name in self.attributes_types :
@@ -399,6 +399,6 @@
         else :
             raise AttributeError, name
-            
-    def __str__(self) :        
+
+    def __str__(self) :
         """Returns the parsed IPP message in a readable form."""
         if not self.parsed :
@@ -414,14 +414,14 @@
                 for (name, value) in attribute :
                     mybuffer.append("  %s : %s" % (name, value))
-        if self.data :            
+        if self.data :
             mybuffer.append("IPP datas : %s" % repr(self.data))
         return "\n".join(mybuffer)
-        
-    def logDebug(self, msg) :    
+
+    def logDebug(self, msg) :
         """Prints a debug message."""
         if self.debug :
             sys.stderr.write("%s\n" % msg)
             sys.stderr.flush()
-            
+
     def setVersion(self, version) :
         """Sets the request's operation id."""
@@ -432,23 +432,23 @@
                 if len(version) == 2 : # 2-tuple
                     self.version = version
-                else :    
+                else :
                     try :
                         self.version = [int(p) for p in str(float(version)).split(".")]
                     except :
                         self.version = [int(p) for p in IPP_VERSION.split(".")]
-        
-    def setOperationId(self, opid) :        
+
+    def setOperationId(self, opid) :
         """Sets the request's operation id."""
         self.operation_id = opid
-        
-    def setRequestId(self, reqid) :        
+
+    def setRequestId(self, reqid) :
         """Sets the request's request id."""
         self.request_id = reqid
-        
-    def dump(self) :    
+
+    def dump(self) :
         """Generates an IPP Message.
-        
+
            Returns the message as a string of text.
-        """    
+        """
         mybuffer = []
         if None not in (self.version, self.operation_id) :
@@ -468,5 +468,5 @@
                                 mybuffer.append(attrname)
                                 nameprinted = 1
-                            else :     
+                            else :
                                 mybuffer.append(pack(">H", 0))
                             if vtype in ("integer", "enum") :
@@ -476,19 +476,19 @@
                                 mybuffer.append(pack(">H", 1))
                                 mybuffer.append(chr(val))
-                            else :    
+                            else :
                                 mybuffer.append(pack(">H", len(val)))
                                 mybuffer.append(val)
             mybuffer.append(chr(self.tagvalues["end-of-attributes-tag"]))
-        mybuffer.append(self.data)    
+        mybuffer.append(self.data)
         return "".join(mybuffer)
-            
+
     def parse(self) :
         """Parses an IPP Request.
-        
+
            NB : Only a subset of RFC2910 is implemented.
         """
         self._curname = None
         self._curattributes = None
-        
+
         try :
             self.setVersion((ord(self._data[0]), ord(self._data[1])))
@@ -509,5 +509,5 @@
                         self.position -= 1
                         continue
-                oldtag = tag        
+                oldtag = tag
                 tag = ord(self._data[self.position])
                 if tag == oldtag :
@@ -515,9 +515,9 @@
         except IndexError :
             raise IPPError, "Unexpected end of IPP message."
-            
-        self.data = self._data[self.position+1:]            
+
+        self.data = self._data[self.position+1:]
         self.parsed = True
-        
-    def parseTag(self) :    
+
+    def parseTag(self) :
         """Extracts information from an IPP tag."""
         pos = self.position
@@ -528,5 +528,5 @@
         if not namelength :
             name = self._curname
-        else :    
+        else :
             posend += namelength
             self._curname = name = self._data[pos2:posend]
@@ -537,48 +537,48 @@
         if tagtype in ("integer", "enum") :
             value = unpack(">I", value)[0]
-        elif tagtype == "boolean" :    
+        elif tagtype == "boolean" :
             value = ord(value)
-        try :    
+        try :
             (oldname, oldval) = self._curattributes[-1][-1]
             if oldname == name :
                 oldval.append((tagtype, value))
-            else :    
+            else :
                 raise IndexError
-        except IndexError :    
+        except IndexError :
             self._curattributes[-1].append((name, [(tagtype, value)]))
         self.logDebug("%s(%s) : %s" % (name, tagtype, value))
         return posend - self.position
-        
-    def operation_attributes_tag(self) : 
+
+    def operation_attributes_tag(self) :
         """Indicates that the parser enters into an operation-attributes-tag group."""
         self._curattributes = self._operation_attributes
         return self.parseTag()
-        
-    def job_attributes_tag(self) : 
+
+    def job_attributes_tag(self) :
         """Indicates that the parser enters into a job-attributes-tag group."""
         self._curattributes = self._job_attributes
         return self.parseTag()
-        
-    def printer_attributes_tag(self) : 
+
+    def printer_attributes_tag(self) :
         """Indicates that the parser enters into a printer-attributes-tag group."""
         self._curattributes = self._printer_attributes
         return self.parseTag()
-        
-    def unsupported_attributes_tag(self) : 
+
+    def unsupported_attributes_tag(self) :
         """Indicates that the parser enters into an unsupported-attributes-tag group."""
         self._curattributes = self._unsupported_attributes
         return self.parseTag()
-        
-    def subscription_attributes_tag(self) : 
+
+    def subscription_attributes_tag(self) :
         """Indicates that the parser enters into a subscription-attributes-tag group."""
         self._curattributes = self._subscription_attributes
         return self.parseTag()
-        
-    def event_notification_attributes_tag(self) : 
+
+    def event_notification_attributes_tag(self) :
         """Indicates that the parser enters into an event-notification-attributes-tag group."""
         self._curattributes = self._event_notification_attributes
         return self.parseTag()
-        
-            
+
+
 class CUPS :
     """A class for a CUPS instance."""
@@ -589,11 +589,11 @@
             if self.url.endswith("/") :
                 self.url = self.url[:-1]
-        else :        
+        else :
             self.url = self.getDefaultURL()
-            
+
         # If no username or password, use the ones set by CUPS, if any
         self.username = username or os.environ.get("AUTH_USERNAME")
         self.password = password or os.environ.get("AUTH_PASSWORD")
-        
+
         self.charset = charset
         self.language = language
@@ -602,6 +602,6 @@
         self.lastErrorMessage = None
         self.requestId = None
-        
-    def getDefaultURL(self) :    
+
+    def getDefaultURL(self) :
         """Builds a default URL."""
         # TODO : encryption methods.
@@ -613,7 +613,7 @@
             return "http://localhost:%s" % port
             #return "socket:%s" % server # TODO : make this work !
-        else :    
+        else :
             return "http://%s:%s" % (server, port)
-            
+
     def identifierToURI(self, service, ident) :
         """Transforms an identifier into a particular URI depending on requested service."""
@@ -621,13 +621,13 @@
                              service,
                              ident)
-        
-    def nextRequestId(self) :        
+
+    def nextRequestId(self) :
         """Increments the current request id and returns the new value."""
         try :
             self.requestId += 1
-        except TypeError :    
+        except TypeError :
             self.requestId = 1
         return self.requestId
-            
+
     def newRequest(self, operationid=None) :
         """Generates a new empty request."""
@@ -641,9 +641,9 @@
                 req.operation["requesting-user-name"] = ("nameWithoutLanguage", self.username)
             return req
-    
+
     def doRequest(self, req, url=None) :
         """Sends a request to the CUPS server.
            returns a new IPPRequest object, containing the parsed answer.
-        """   
+        """
         url = url or self.url
         connection = urllib2.Request(url=url, \
@@ -657,9 +657,9 @@
                                    self.username, \
                                    self.password or "")
-            authhandler = urllib2.HTTPBasicAuthHandler(pwmanager)                       
+            authhandler = urllib2.HTTPBasicAuthHandler(pwmanager)
             opener = urllib2.build_opener(authhandler)
             urllib2.install_opener(opener)
-        else : # TODO : also do this in the 'if' part     
-            if url.startswith("socket:") : 
+        else : # TODO : also do this in the 'if' part
+            if url.startswith("socket:") :
                 class SocketHandler(urllib2.HTTPHandler) :
                     """A class to handle IPP connections over an Unix domain socket."""
@@ -675,17 +675,17 @@
                         sys.stderr.write("Opened [%s]\n" % req.get_selector())
                         return s.makefile(mode="r+b")
-                        
-                opener = urllib2.build_opener(SocketHandler())  
+
+                opener = urllib2.build_opener(SocketHandler())
                 urllib2.install_opener(opener)
                 sys.stderr.write("Opener installed\n")
-        self.lastError = None    
+        self.lastError = None
         self.lastErrorMessage = None
-        try :    
+        try :
             response = urllib2.urlopen(connection)
-        except (urllib2.URLError, urllib2.HTTPError, socket.error), error :    
+        except (urllib2.URLError, urllib2.HTTPError, socket.error), error :
             self.lastError = error
             self.lastErrorMessage = str(error)
             return None
-        else :    
+        else :
             bytes = []
             try :
@@ -694,9 +694,9 @@
                         try :
                             byte = response.read(1)
-                        except AttributeError :    
+                        except AttributeError :
                             byte = response.recv(1)
                         if not byte :
                             break
-                        else :    
+                        else :
                             bytes.append(byte)
                 except socket.error :
@@ -711,6 +711,6 @@
             else :
                 return None
-    
-    def getPPD(self, queuename) :    
+
+    def getPPD(self, queuename) :
         """Retrieves the PPD for a particular queuename."""
         req = self.newRequest(IPP_GET_PRINTER_ATTRIBUTES)
@@ -719,16 +719,16 @@
             req.operation["requested-attributes"] = ("nameWithoutLanguage", attrib)
         return self.doRequest(req)  # TODO : get the PPD from the actual print server
-        
+
     def getDefault(self) :
         """Retrieves CUPS' default printer."""
         return self.doRequest(self.newRequest(CUPS_GET_DEFAULT))
-    
-    def getJobAttributes(self, jobid) :    
+
+    def getJobAttributes(self, jobid) :
         """Retrieves a print job's attributes."""
         req = self.newRequest(IPP_GET_JOB_ATTRIBUTES)
         req.operation["job-uri"] = ("uri", self.identifierToURI("jobs", jobid))
         return self.doRequest(req)
-        
-    def getPrinters(self) :    
+
+    def getPrinters(self) :
         """Returns the list of print queues names."""
         req = self.newRequest(CUPS_GET_PRINTERS)
@@ -737,6 +737,6 @@
         req.operation["printer-type-mask"] = ("enum", CUPS_PRINTER_CLASS)
         return [printer[1] for printer in self.doRequest(req).printer["printer-name"]]
-        
-    def getDevices(self) :    
+
+    def getDevices(self) :
         """Returns a list of devices as (deviceclass, deviceinfo, devicemakeandmodel, deviceuri) tuples."""
         answer = self.doRequest(self.newRequest(CUPS_GET_DEVICES))
@@ -745,6 +745,6 @@
                    [d[1] for d in answer.printer["device-make-and-model"]], \
                    [d[1] for d in answer.printer["device-uri"]])
-                   
-    def getPPDs(self) :    
+
+    def getPPDs(self) :
         """Returns a list of PPDs as (ppdnaturallanguage, ppdmake, ppdmakeandmodel, ppdname) tuples."""
         answer = self.doRequest(self.newRequest(CUPS_GET_PPDS))
@@ -753,5 +753,5 @@
                    [d[1] for d in answer.printer["ppd-make-and-model"]], \
                    [d[1] for d in answer.printer["ppd-name"]])
-                   
+
     def createSubscription(self, uri, events=["all"],
                                       userdata=None,
@@ -764,5 +764,5 @@
                                       jobid=None) :
         """Creates a job, printer or server subscription.
-         
+
            uri : the subscription's uri, e.g. ipp://server
            events : a list of events to subscribe to, e.g. ["printer-added", "printer-deleted"]
@@ -774,5 +774,5 @@
            timeinterval : the interval of time during notifications
            jobid : the optional job id in case of a job subscription
-        """   
+        """
         if jobid is not None :
             opid = IPP_CREATE_JOB_SUBSCRIPTION
@@ -785,7 +785,7 @@
         for event in events :
             req.subscription["notify-events"] = ("keyword", event)
-        if userdata is not None :    
+        if userdata is not None :
             req.subscription["notify-user-data"] = ("octetString-with-an-unspecified-format", userdata)
-        if recipient is not None :    
+        if recipient is not None :
             req.subscription["notify-recipient"] = ("uri", recipient)
         if pullmethod is not None :
@@ -802,8 +802,8 @@
             req.subscription["notify-job-id"] = ("integer", jobid)
         return self.doRequest(req)
-            
-    def cancelSubscription(self, uri, subscriptionid, jobid=None) :    
+
+    def cancelSubscription(self, uri, subscriptionid, jobid=None) :
         """Cancels a subscription.
-        
+
            uri : the subscription's uri.
            subscriptionid : the subscription's id.
@@ -818,13 +818,13 @@
         req.event_notification["notify-subscription-id"] = ("integer", subscriptionid)
         return self.doRequest(req)
-        
-if __name__ == "__main__" :            
+
+if __name__ == "__main__" :
     if (len(sys.argv) < 2) or (sys.argv[1] == "--debug") :
         print "usage : python pkipplib.py /var/spool/cups/c00005 [--debug] (for example)\n"
-    else :    
+    else :
         infile = open(sys.argv[1], "rb")
         filedata = infile.read()
         infile.close()
-        
+
         msg = IPPRequest(filedata, debug=(sys.argv[-1]=="--debug"))
         msg.parse()
@@ -832,12 +832,12 @@
         msg2.parse()
         filedata2 = msg2.dump()
-        
+
         if filedata == filedata2 :
             print "Test OK : parsing original and parsing the output of the dump produce the same dump !"
             print str(msg)
-        else :    
+        else :
             print "Test Failed !"
             print str(msg)
             print
             print str(msg2)
-        
+
Index: /pkipplib/trunk/pkipplib/__init__.py
===================================================================
--- /pkipplib/trunk/pkipplib/__init__.py (revision 45)
+++ /pkipplib/trunk/pkipplib/__init__.py (revision 3437)
@@ -1,3 +1,3 @@
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkipplib : IPP and CUPS support for Python
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
Index: /pkipplib/trunk/pkipplib/version.py
===================================================================
--- /pkipplib/trunk/pkipplib/version.py (revision 45)
+++ /pkipplib/trunk/pkipplib/version.py (revision 3437)
@@ -1,3 +1,3 @@
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
 #
 # pkipplib : IPP and CUPS support for Python
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
Index: /pkipplib/trunk/MANIFEST.in
===================================================================
--- /pkipplib/trunk/MANIFEST.in (revision 36)
+++ /pkipplib/trunk/MANIFEST.in (revision 3437)
@@ -1,2 +1,2 @@
-include README COPYING NEWS MANIFEST.in clean.sh bin/pksubscribe
+yinclude README COPYING NEWS MANIFEST.in clean.sh bin/pksubscribe
 recursive-include notifiers *
Index: /pkipplib/trunk/clean.sh
===================================================================
--- /pkipplib/trunk/clean.sh (revision 45)
+++ /pkipplib/trunk/clean.sh (revision 3437)
@@ -1,3 +1,3 @@
-#! /bin/sh
+y#! /bin/sh
 #
 # pkipplib : IPP support for Python
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
Index: /pkipplib/trunk/README
===================================================================
--- /pkipplib/trunk/README (revision 3380)
+++ /pkipplib/trunk/README (revision 3437)
@@ -1,3 +1,3 @@
-pkipplib : IPP and CUPS support for Python
+ypkipplib : IPP and CUPS support for Python
 
 $Id$
@@ -8,10 +8,10 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -29,5 +29,5 @@
 and its instance methods.
 
-Finally, a CUPS class can be leveraged to easily deal with CUPS 
+Finally, a CUPS class can be leveraged to easily deal with CUPS
 print servers.
 
@@ -42,13 +42,13 @@
 
         1 - Grab the latest version of this library from :
-        
+
             http://www.pykota.com/software/pkipplib/
-            
-        2 - Extract the tarball :    
-        
+
+        2 - Extract the tarball :
+
             $ tar -zxf pkipplib-x.yy.tar.gz
-            
-        3 - Install the Python module :    
-        
+
+        3 - Install the Python module :
+
             $ cd pkipplib-x.yy
             $ python setup.py install
@@ -78,5 +78,5 @@
 print request
 
-# Access one of the job's attributes directly 
+# Access one of the job's attributes directly
 print request.job["job-name"]
 --- CUT ---
@@ -119,14 +119,14 @@
 # Lower level API :
 request = cups.newRequest(pkipplib.IPP_GET_PRINTER_ATTRIBUTES)
-request.operation["printer-uri"] = ("uri", 
+request.operation["printer-uri"] = ("uri",
                                     cups.identifierToURI("printers", "HP2100"))
-for attribute in ("printer-uri-supported",                                     
+for attribute in ("printer-uri-supported",
                   "printer-type",
                   "member-uris") :
-    # IMPORTANT : here, despite the unusual syntax, we append to              
+    # IMPORTANT : here, despite the unusual syntax, we append to
     # the list of requested attributes :
     request.operation["requested-attributes"] = ("nameWithoutLanguage", attribute)
-    
-# Sends this request to the CUPS server    
+
+# Sends this request to the CUPS server
 answer = cups.doRequest(request)
 
@@ -140,24 +140,24 @@
 
   pkipplib currently includes the following command line tools :
-  
+
     * pksubscribe : can create or delete IPP subscriptions.
-    
+
           See pksubscribe --help for details.
-        
+
           examples :
-          
+
             $ pksubscribe --cups http://localhost:631 \
                           --events printer-added,printer-deleted \
                           --recipient mynotifier \
                           --duration 0
-                          
-            $ pksubscribe --username root \              
+
+            $ pksubscribe --username root \
                           --password HacKMe \
                           --delete 34 58 98
-                          
+
     * samplenotifier : can handle printer-added and printer-deleted
       notifications and automatically create or remove printers
       from PyKota's database (just adapt the code for other needs).
-      
+
       samplenotifier is present in the notifiers/ directory, but
       won't be installed automatically. You must put it into
@@ -165,5 +165,5 @@
 
   In the future more command line tools will be included.
-  
+
 =======================================================================
 
