Permalink
Browse files

Merge remote-tracking branch 'origin/master'

  • Loading branch information...
2 parents c902a29 + 4c89e63 commit e5444555ff25a40008c71e05fc0069ad0ef1e194 @brownan committed Oct 6, 2012
Showing with 37 additions and 17 deletions.
  1. +3 −0 abbott/entrypt.py
  2. +18 −1 abbott/pluginbase.py
  3. +16 −16 abbott/plugins/ircutil.py
View
@@ -7,6 +7,9 @@
import sys
def main():
+ if len(sys.argv) < 2:
+ print "Usage: %s <config dir>" % sys.argv[0]
+ sys.exit(1)
transportobj = transport.Transport()
boss = pluginbase.PluginBoss(sys.argv[1], transportobj)
View
@@ -3,6 +3,7 @@
import UserDict
import os
import os.path
+import sys
from twisted.internet import defer
@@ -16,7 +17,7 @@ def __init__(self, jsonfile):
"""Initialize a config from a json file."""
self._jsonfile = jsonfile
with open(jsonfile, 'r') as inp:
- self.data= json.load(inp)
+ self.data = json.load(inp)
def save(self):
with open(self._jsonfile+"~", 'w') as out:
@@ -38,6 +39,12 @@ def __init__(self, config, transport):
self._filename = os.path.join(config, "config.json")
self.loaded_plugins = {}
+
+ if not os.path.exists(self._configdir):
+ os.mkdir(self._configdir)
+ elif not os.path.isdir(self._configdir):
+ print("The config parameter should be a directory. Please make the necessary adjustments")
+ sys.exit(1)
try:
self._load()
@@ -91,8 +98,15 @@ def _seed_defaults(self):
'irc.IRCBotPlugin',
'irc.IRCController',
'ircutil.ReplyInserter',
+ # whois and names probably aren't necessary unless
+ # you're also running the ircadmin plugins, but just
+ # in case, it can't hurt.
+ 'ircutil.IRCWhois',
+ 'ircutil.Names',
'auth.Auth',
'plugincontroller.PluginController',
+ 'corecontrol.CoreControl',
+ 'corecontrol.Help',
],
},
'plugin_config': {
@@ -112,6 +126,9 @@ def _seed_defaults(self):
},
},
},
+ 'command': {
+ "prefix": None,
+ },
}
self.save()
View
@@ -44,14 +44,14 @@ def start(self):
self.listen_for_event("irc.on_unknown")
- self.install_command(
- cmdname="whois",
- argmatch=r"(?P<nick>[^ ]+)",
- callback=self.do_whois,
- cmdusage="<nick>",
- helptext="Does a whois and prints the results. This command is meant for debugging.",
- permission="irc.whois",
- )
+ #self.install_command(
+ # cmdname="whois",
+ # argmatch=r"(?P<nick>[^ ]+)",
+ # callback=self.do_whois,
+ # cmdusage="<nick>",
+ # helptext="Does a whois and prints the results. This command is meant for debugging.",
+ # permission="irc.whois",
+ # )
# nick of the current whois that is coming in on the wire right this
# moment
@@ -142,14 +142,14 @@ def start(self):
self.listen_for_event("irc.on_unknown")
- self.install_command(
- cmdname="names",
- argmatch=r"(?P<channel>\S+)?$",
- cmdusage="[channel]",
- callback=self.do_names,
- helptext="Does an IRC NAMES command and replies with the result",
- permission="irc.names",
- )
+ #self.install_command(
+ # cmdname="names",
+ # argmatch=r"(?P<channel>\S+)?$",
+ # cmdusage="[channel]",
+ # callback=self.do_names,
+ # helptext="Does an IRC NAMES command and replies with the result",
+ # permission="irc.names",
+ # )
self.currentinfo = []
self.pending = defaultdict(set)

0 comments on commit e544455

Please sign in to comment.