mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-11-16 07:15:24 +01:00
4988ab6ae1
Added flag to disable ansi colours. Fixes #10 Now passing plugin loader to plugins onEnable
17 lines
509 B
Python
17 lines
509 B
Python
class IRC:
|
|
options = None
|
|
writeFile = None
|
|
|
|
def onEnable(self, parser, pluginloader):
|
|
parser.add_option("-q", "--irc-out-file", dest="ircDump", default="ircdump.txt",
|
|
help="file to dump messages to")
|
|
|
|
def onDisable(self):
|
|
if (self.writeFile != None):
|
|
self.writeFile.close()
|
|
|
|
def optionsParsed(self, parsedOptions):
|
|
self.options = parsedOptions
|
|
if (self.options.ircDump):
|
|
self.writeFile = open(self.options.filename, 'w')
|