Removed logfile command, no one uses it and it's an information leak (channel logfiles).

This commit is contained in:
Jeremy Fincher 2004-08-23 21:35:43 +00:00
parent 9db025a88a
commit 868a6684af
2 changed files with 0 additions and 31 deletions

View File

@ -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

View File

@ -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')