mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Added <filename> argument to logfilesize.
This commit is contained in:
parent
ea7a319157
commit
9ad27d4230
@ -158,10 +158,19 @@ class MiscCommands(callbacks.Privmsg):
|
||||
irc.reply(msg, 'My source is at http://www.sf.net/projects/supybot/')
|
||||
|
||||
def logfilesize(self, irc, msg, args):
|
||||
"""takes no arguments
|
||||
"""[<logfile>]
|
||||
|
||||
Returns the size of the various logfiles in use.
|
||||
Returns the size of the various logfiles in use. If given a specific
|
||||
logfile, returns only the size of that logfile.
|
||||
"""
|
||||
filename = privmsgs.getArgs(needed=0, optional=1)
|
||||
if filename:
|
||||
if not file.endswith('.log'):
|
||||
irc.error(msg, 'That filename doesn\'t appear to be a log.')
|
||||
return
|
||||
filenames = [filename]
|
||||
else:
|
||||
filenames = os.listdir(conf.logDir)
|
||||
result = []
|
||||
for file in os.listdir(conf.logDir):
|
||||
if file.endswith('.log'):
|
||||
|
Loading…
Reference in New Issue
Block a user