updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / hellanzb / python_26_fixes.diff
blob79988420da8b6960db8a438fec59bd823a9806a8
1 Index: Hellanzb/Growl.py
2 ===================================================================
3 --- Hellanzb/Growl.py (Revision 1094)
4 +++ Hellanzb/Growl.py (Arbeitskopie)
5 @@ -7,7 +7,13 @@
6 __contributors__ = "Ingmar J Stein (Growl Team)"
8 import struct
9 -import md5
11 +# The md5 module has been deprecated as of Python 2.6.
12 +try:
13 + from hashlib import md5
14 +except ImportError:
15 + from md5 import md5
17 from socket import AF_INET, SOCK_DGRAM, socket
19 GROWL_UDP_PORT=9887
20 @@ -51,7 +57,7 @@
21 self.data += encoded
22 for default in self.defaults:
23 self.data += struct.pack("B", default)
24 - self.checksum = md5.new()
25 + self.checksum = md5()
26 self.checksum.update(self.data)
27 if self.password:
28 self.checksum.update(self.password)
29 @@ -89,7 +95,7 @@
30 self.data += self.title
31 self.data += self.description
32 self.data += self.application
33 - self.checksum = md5.new()
34 + self.checksum = md5()
35 self.checksum.update(self.data)
36 if password:
37 self.checksum.update(password)
38 Index: Hellanzb/Util.py
39 ===================================================================
40 --- Hellanzb/Util.py (Revision 1094)
41 +++ Hellanzb/Util.py (Arbeitskopie)
42 @@ -28,9 +28,6 @@
44 class FatalError(Exception):
45 """ An error that will cause the program to exit """
46 - def __init__(self, message):
47 - self.args = [message]
48 - self.message = message
50 class EmptyForThisPool(Empty):
51 """ The queue is empty in terms of our current serverPool, but there are still segments to
52 Index: Hellanzb/HellaXMLRPC/HtPasswdAuth.py
53 ===================================================================
54 --- Hellanzb/HellaXMLRPC/HtPasswdAuth.py (Revision 1094)
55 +++ Hellanzb/HellaXMLRPC/HtPasswdAuth.py (Arbeitskopie)
56 @@ -8,7 +8,13 @@
57 (c) Copyright 2005 Philip Jenvey
58 [See end of file]
59 """
60 -import md5
62 +# The md5 module has been deprecated as of Python 2.6.
63 +try:
64 + from hashlib import md5
65 +except ImportError:
66 + from md5 import md5
68 from twisted.web import static
69 from twisted.web.resource import Resource
71 @@ -70,7 +76,7 @@
73 self.user = user
75 - m = md5.new()
76 + m = md5()
77 m.update(password)
78 del password
79 self.passwordDigest = m.digest()
80 @@ -90,7 +96,7 @@
81 def authenticateUser(self, request):
82 username, password = request.getUser(), request.getPassword()
84 - m = md5.new()
85 + m = md5()
86 m.update(password)
88 authenticated = username == self.user and self.passwordDigest == m.digest()