From a055bc29a0e41b5b3e5aff0fdd35d27f89e2b9ae Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 3 Oct 2004 22:36:50 +0000 Subject: [PATCH] Added export command. --- src/Config.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Config.py b/src/Config.py index 6dc5b92b7..c88b28cfa 100644 --- a/src/Config.py +++ b/src/Config.py @@ -45,6 +45,7 @@ import supybot.conf as conf import supybot.utils as utils import supybot.world as world import supybot.ircdb as ircdb +from supybot.commands import * import supybot.ircutils as ircutils import supybot.privmsgs as privmsgs import supybot.registry as registry @@ -276,6 +277,19 @@ class Config(callbacks.Privmsg): irc.replySuccess() reload = privmsgs.checkCapability(reload, 'owner') + def export(self, irc, msg, args, filename): + """ + + Exports the public variables of your configuration to . + If you want to show someone your configuration file, but you don't + want that person to be able to see things like passwords, etc., this + command will export a "sanitized" configuration file suitable for + showing publicly. + """ + registry.close(conf.supybot, filename, private=False) + irc.replySuccess() + export = wrap(export, [('checkCapability', 'owner'), 'filename']) + Class = Config