File Supybot-0.83.3.diff of Package Supybot
--- plugins/Gateway/gwssh.py
+++ plugins/Gateway/gwssh.py
@@ -28,7 +28,6 @@
###
import os
-import md5
from twisted.conch import avatar, credentials
from Crypto.PublicKey import RSA
from twisted.python import components
--- plugins/Owner/plugin.py
+++ plugins/Owner/plugin.py
@@ -560,8 +560,8 @@ class Owner(callbacks.Plugin):
"""
try:
if plugin:
- command = '%s.%s' % (plugin.name(), command)
self._disabled.remove(command, plugin.name())
+ command = '%s.%s' % (plugin.name(), command)
else:
self._disabled.remove(command)
conf.supybot.commands.disabled().remove(command)
--- plugins/Sshd/plugin.py
+++ plugins/Sshd/plugin.py
@@ -70,7 +70,6 @@ import twisted.conch.credentials as conc
# Standard library imports
import os
-import md5
import sys
import code
import time
--- plugins/String/plugin.py
+++ plugins/String/plugin.py
@@ -27,9 +27,8 @@
# POSSIBILITY OF SUCH DAMAGE.
###
-import md5
-import sha
import types
+import hashlib
import supybot.utils as utils
from supybot.commands import *
@@ -156,7 +155,7 @@ class String(callbacks.Plugin):
http://www.rsasecurity.com/rsalabs/faq/3-6-6.html for more information
about md5.
"""
- irc.reply(md5.md5(text).hexdigest())
+ irc.reply(hashlib.md5(text).hexdigest())
md5 = wrap(md5, ['text'])
def sha(self, irc, msg, args, text):
@@ -166,7 +165,7 @@ class String(callbacks.Plugin):
http://www.secure-hash-algorithm-md5-sha-1.co.uk/ for more information
about SHA.
"""
- irc.reply(sha.sha(text).hexdigest())
+ irc.reply(hashlib.sha1(text).hexdigest())
sha = wrap(sha, ['text'])
Class = String
--- plugins/__init__.py
+++ plugins/__init__.py
@@ -33,7 +33,6 @@ import re
import csv
import sys
import math
-import sets
import time
import random
import fnmatch
@@ -533,7 +532,7 @@ class PeriodicFileDownloader(object):
self.lastDownloaded[filename] = 0
else:
self.lastDownloaded[filename] = 0
- self.currentlyDownloading = sets.Set()
+ self.currentlyDownloading = set()
self.downloadedCounter[filename] = 0
self.getFile(filename)
--- src/callbacks.py
+++ src/callbacks.py
@@ -1051,7 +1051,6 @@ class BasePlugin(object):
setattr(self, attr, cb)
self.cbs.append(cb)
cb.log = log.getPluginLogger('%s.%s' % (self.name(),cb.name()))
- super(BasePlugin, self).__init__(*args, **kwargs)
class SynchronizedAndFirewalled(log.MetaFirewall, utils.python.Synchronized):
pass # Necessary for the metaclass compatibility issue.
--- src/drivers/__init__.py
+++ src/drivers/__init__.py
@@ -69,7 +69,6 @@ class ServersMixin(object):
def __init__(self, irc, servers=()):
self.networkGroup = conf.supybot.networks.get(irc.network)
self.servers = servers
- super(ServersMixin, self).__init__(irc)
def _getServers(self):
# We do this, rather than utils.iter.cycle the servers in __init__,
--- src/irclib.py
+++ src/irclib.py
@@ -79,7 +79,9 @@ class IrcCallback(IrcCommandDispatcher):
}
def __init__(self, *args, **kwargs):
- super(IrcCallback, self).__init__(*args, **kwargs)
+ #object doesn't take any args, so the buck stops here.
+ #super(IrcCallback, self).__init__(*args, **kwargs)
+ pass
def __repr__(self):
return '<%s %s %s>' % \
--- src/utils/file.py
+++ src/utils/file.py
@@ -28,11 +28,10 @@
###
import os
-import md5
-import sha
import time
import random
import shutil
+import hashlib
import os.path
from iter import ifilter
@@ -81,7 +80,7 @@ def touch(filename):
def mktemp(suffix=''):
"""Gives a decent random string, suitable for a filename."""
r = random.Random()
- m = md5.md5(suffix)
+ m = hashlib.md5(suffix)
r.seed(time.time())
s = str(r.getstate())
period = random.random()
@@ -93,7 +92,7 @@ def mktemp(suffix=''):
m.update(s)
m.update(str(now))
s = m.hexdigest()
- return sha.sha(s + str(time.time())).hexdigest() + suffix
+ return hashlib.sha1(s + str(time.time())).hexdigest() + suffix
def nonCommentLines(fd):
for line in fd:
--- src/utils/gen.py
+++ src/utils/gen.py
@@ -29,11 +29,10 @@
import os
import sys
-import md5
import new
-import sha
import time
import types
+import hashlib
import compiler
import textwrap
import UserDict
@@ -133,9 +132,9 @@ def saltHash(password, salt=None, hash='
if salt is None:
salt = mktemp()[:8]
if hash == 'sha':
- hasher = sha.sha
+ hasher = hashlib.sha1
elif hash == 'md5':
- hasher = md5.md5
+ hasher = hashlib.md5
return '|'.join([salt, hasher(salt + password).hexdigest()])
def safeEval(s, namespace={'True': True, 'False': False, 'None': None}):