mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Removed logfile command, no one uses it and it's an information leak (channel logfiles).
This commit is contained in:
parent
9db025a88a
commit
868a6684af
@ -232,36 +232,6 @@ class Status(callbacks.Privmsg):
|
||||
"""
|
||||
irc.reply(irc.server)
|
||||
|
||||
def logfile(self, irc, msg, args):
|
||||
"""[<logfile>]
|
||||
|
||||
Returns the size of the various logfiles in use. If given a specific
|
||||
logfile, returns only the size of that logfile.
|
||||
"""
|
||||
filenameArg = privmsgs.getArgs(args, required=0, optional=1)
|
||||
if filenameArg:
|
||||
if not filenameArg.endswith('.log'):
|
||||
irc.error('That filename doesn\'t appear to be a log.')
|
||||
return
|
||||
filenameArg = os.path.basename(filenameArg)
|
||||
ret = []
|
||||
dirname = conf.supybot.directories.log()
|
||||
for (dirname,_,filenames) in os.walk(dirname):
|
||||
if filenameArg:
|
||||
if filenameArg in filenames:
|
||||
filename = os.path.join(dirname, filenameArg)
|
||||
stats = os.stat(filename)
|
||||
ret.append('%s: %s' % (filename, stats.st_size))
|
||||
else:
|
||||
for filename in filenames:
|
||||
stats = os.stat(os.path.join(dirname, filename))
|
||||
ret.append('%s: %s' % (filename, stats.st_size))
|
||||
if ret:
|
||||
ret.sort()
|
||||
irc.reply(utils.commaAndify(ret))
|
||||
else:
|
||||
irc.error('I couldn\'t find any logfiles.')
|
||||
|
||||
|
||||
Class = Status
|
||||
|
||||
|
@ -69,7 +69,6 @@ class StatusTestCase(PluginTestCase, PluginDocumentation):
|
||||
self.feedMsg('list')
|
||||
self.feedMsg('list Status')
|
||||
self.assertNotError('upkeep')
|
||||
self.assertNotError('logfile')
|
||||
|
||||
def testThreads(self):
|
||||
self.assertNotError('threads')
|
||||
|
Loading…
Reference in New Issue
Block a user