mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-25 19:44:13 +01:00
PyChecker fixes.
This commit is contained in:
parent
efb7891f46
commit
cafd724d30
32
src/Admin.py
32
src/Admin.py
@ -41,10 +41,6 @@ import supybot.fix as fix
|
|||||||
|
|
||||||
import time
|
import time
|
||||||
import pprint
|
import pprint
|
||||||
import string
|
|
||||||
import logging
|
|
||||||
import smtplib
|
|
||||||
import textwrap
|
|
||||||
from itertools import imap
|
from itertools import imap
|
||||||
|
|
||||||
import supybot.log as log
|
import supybot.log as log
|
||||||
@ -387,34 +383,6 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
else:
|
else:
|
||||||
irc.reply('I\'m not currently globally ignoring anyone.')
|
irc.reply('I\'m not currently globally ignoring anyone.')
|
||||||
|
|
||||||
def reportbug(self, irc, msg, args):
|
|
||||||
"""<description>
|
|
||||||
|
|
||||||
Reports a bug to a private mailing list supybot-bugs. <description>
|
|
||||||
will be the subject of the email. The most recent 10 or so messages
|
|
||||||
the bot receives will be sent in the body of the email.
|
|
||||||
"""
|
|
||||||
description = privmsgs.getArgs(args)
|
|
||||||
messages = pprint.pformat(irc.state.history[-10:])
|
|
||||||
email = textwrap.dedent("""
|
|
||||||
Subject: %s
|
|
||||||
From: jemfinch@users.sourceforge.net
|
|
||||||
To: supybot-bugs@lists.sourceforge.net
|
|
||||||
Date: %s
|
|
||||||
|
|
||||||
Bug report for Supybot %s.
|
|
||||||
%s
|
|
||||||
""") % (description, time.ctime(), conf.version, messages)
|
|
||||||
email = email.strip()
|
|
||||||
email = email.replace('\n', '\r\n')
|
|
||||||
smtp = smtplib.SMTP('mail.sourceforge.net', 25)
|
|
||||||
smtp.sendmail('jemfinch@users.sf.net',
|
|
||||||
['supybot-bugs@lists.sourceforge.net'],
|
|
||||||
email)
|
|
||||||
smtp.quit()
|
|
||||||
irc.replySuccess()
|
|
||||||
reportbug = privmsgs.thread(reportbug)
|
|
||||||
|
|
||||||
|
|
||||||
Class = Admin
|
Class = Admin
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ import supybot.conf as conf
|
|||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
import supybot.world as world
|
import supybot.world as world
|
||||||
import supybot.ircdb as ircdb
|
import supybot.ircdb as ircdb
|
||||||
import supybot.plugins as plugins
|
|
||||||
import supybot.ircutils as ircutils
|
import supybot.ircutils as ircutils
|
||||||
import supybot.privmsgs as privmsgs
|
import supybot.privmsgs as privmsgs
|
||||||
import supybot.registry as registry
|
import supybot.registry as registry
|
||||||
|
@ -191,7 +191,7 @@ class Misc(callbacks.Privmsg):
|
|||||||
return
|
return
|
||||||
name = privmsgs.getArgs(args)
|
name = privmsgs.getArgs(args)
|
||||||
cb = irc.getCallback(name)
|
cb = irc.getCallback(name)
|
||||||
if cb is not None and cb.__doc__ and not getattr(cb, '_original'):
|
if cb is not None and cb.__doc__ and not hasattr(cb, '_original'):
|
||||||
irc.reply(utils.normalizeWhitespace(cb.__doc__))
|
irc.reply(utils.normalizeWhitespace(cb.__doc__))
|
||||||
return
|
return
|
||||||
command = callbacks.canonicalName(name)
|
command = callbacks.canonicalName(name)
|
||||||
|
18
src/Owner.py
18
src/Owner.py
@ -43,7 +43,6 @@ import gc
|
|||||||
import os
|
import os
|
||||||
import imp
|
import imp
|
||||||
import sys
|
import sys
|
||||||
import sets
|
|
||||||
import getopt
|
import getopt
|
||||||
import logging
|
import logging
|
||||||
import linecache
|
import linecache
|
||||||
@ -54,7 +53,6 @@ import supybot.utils as utils
|
|||||||
import supybot.world as world
|
import supybot.world as world
|
||||||
import supybot.ircdb as ircdb
|
import supybot.ircdb as ircdb
|
||||||
import supybot.ircmsgs as ircmsgs
|
import supybot.ircmsgs as ircmsgs
|
||||||
import supybot.drivers as drivers
|
|
||||||
import supybot.ircutils as ircutils
|
import supybot.ircutils as ircutils
|
||||||
import supybot.privmsgs as privmsgs
|
import supybot.privmsgs as privmsgs
|
||||||
import supybot.registry as registry
|
import supybot.registry as registry
|
||||||
@ -174,18 +172,6 @@ class LogProxy(object):
|
|||||||
return getattr(self.log, attr)
|
return getattr(self.log, attr)
|
||||||
|
|
||||||
|
|
||||||
class LogErrorHandler(logging.Handler):
|
|
||||||
irc = None
|
|
||||||
def handle(self, record):
|
|
||||||
if record.levelno >= logging.ERROR:
|
|
||||||
if record.exc_info:
|
|
||||||
(_, e, _) = record.exc_info
|
|
||||||
s = 'Uncaught exception in %s: %s' % (record.module, e)
|
|
||||||
else:
|
|
||||||
s = record.msg
|
|
||||||
# Send to the owner dudes.
|
|
||||||
|
|
||||||
|
|
||||||
class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
||||||
# This plugin must be first; its priority must be lowest; otherwise odd
|
# This plugin must be first; its priority must be lowest; otherwise odd
|
||||||
# things will happen when adding callbacks.
|
# things will happen when adding callbacks.
|
||||||
@ -241,9 +227,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
self.log.error('Error loading src/ plugin %s. '
|
self.log.error('Error loading src/ plugin %s. '
|
||||||
'This is usually rather '
|
'This is usually rather '
|
||||||
'serious; these plugins are '
|
'serious; these plugins are '
|
||||||
'almost always be loaded.',
|
'almost always be loaded.',name)
|
||||||
name)
|
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
log.exception('Failed to load %s:', name)
|
log.exception('Failed to load %s:', name)
|
||||||
else:
|
else:
|
||||||
|
@ -33,25 +33,20 @@ __revision__ = "$Id$"
|
|||||||
|
|
||||||
import supybot.fix as fix
|
import supybot.fix as fix
|
||||||
|
|
||||||
import re
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import socket
|
import socket
|
||||||
import asyncore
|
import asyncore
|
||||||
import asynchat
|
import asynchat
|
||||||
|
|
||||||
import supybot.log as log
|
|
||||||
import supybot.conf as conf
|
import supybot.conf as conf
|
||||||
import supybot.ircdb as ircdb
|
|
||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
import supybot.world as world
|
import supybot.world as world
|
||||||
import supybot.drivers as drivers
|
import supybot.drivers as drivers
|
||||||
import supybot.ircmsgs as ircmsgs
|
|
||||||
import supybot.schedule as schedule
|
import supybot.schedule as schedule
|
||||||
|
|
||||||
class AsyncoreRunnerDriver(drivers.IrcDriver):
|
class AsyncoreRunnerDriver(drivers.IrcDriver):
|
||||||
def run(self):
|
def run(self):
|
||||||
#log.debug(repr(asyncore.socket_map))
|
|
||||||
try:
|
try:
|
||||||
timeout = conf.supybot.drivers.poll()
|
timeout = conf.supybot.drivers.poll()
|
||||||
if not asyncore.socket_map:
|
if not asyncore.socket_map:
|
||||||
|
@ -40,7 +40,6 @@ __revision__ ="$Id$"
|
|||||||
import supybot.fix as fix
|
import supybot.fix as fix
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import atexit
|
|
||||||
import select
|
import select
|
||||||
import socket
|
import socket
|
||||||
from itertools import imap
|
from itertools import imap
|
||||||
@ -50,7 +49,6 @@ import supybot.conf as conf
|
|||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
import supybot.world as world
|
import supybot.world as world
|
||||||
import supybot.drivers as drivers
|
import supybot.drivers as drivers
|
||||||
import supybot.ircmsgs as ircmsgs
|
|
||||||
import supybot.schedule as schedule
|
import supybot.schedule as schedule
|
||||||
|
|
||||||
reconnectWaits = (0, 60, 300)
|
reconnectWaits = (0, 60, 300)
|
||||||
|
@ -38,9 +38,6 @@ __revision__ = "$Id$"
|
|||||||
import supybot.fix as fix
|
import supybot.fix as fix
|
||||||
|
|
||||||
import types
|
import types
|
||||||
import pprint
|
|
||||||
import string
|
|
||||||
import threading
|
|
||||||
from itertools import imap
|
from itertools import imap
|
||||||
|
|
||||||
class RingBuffer(object):
|
class RingBuffer(object):
|
||||||
|
@ -42,7 +42,6 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import sre
|
import sre
|
||||||
import time
|
import time
|
||||||
import types
|
|
||||||
import atexit
|
import atexit
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user