chiark / gitweb /
blame: Put the filename in the loadblame result
[irc.git] / Servus-chiark.py
index 2158903c91033c6821d2e42758296bea8a264e20..6d3af24c258625c62231c49635d0b79722e6337c 100755 (executable)
@@ -70,13 +70,8 @@ def loadblame(filename):
             thing=' '.join(l[2:])
             bdb[thing]=commit
     keys=bdb.keys()
-    return bdb,keys
+    return bdb,keys,filename
     
-#set up blame dbs for trouts/flirts/slashes
-tbdb,tbdbk=loadblame("trouts")
-fbdb,fbdbk=loadblame("flirts")
-sbdb,sbdbk=loadblame("slashes")
-
 # load a file full of flirts or trouts
 def __load(filename):
     try:
@@ -95,7 +90,9 @@ troutcfg = (
        "Who do you wish me to trout?",
        "Fish stocks exhausted.",
        fish,
-       0.1)
+       0.1,
+       loadblame("trouts"),
+       )
 
 flirtcfg = (
        __load("flirts"),
@@ -104,7 +101,9 @@ flirtcfg = (
        "Who do you wish me to flirt with?",
        "My libido is over-used!",
        fish,
-       0.1)
+       0.1,
+       loadblame("flirts"),
+       )
 
 slashcfg= ( 
        __load("slashes"),
@@ -113,7 +112,9 @@ slashcfg= (
        "Who do you want to slash?",
        "I have writer's block!",
        fish,
-       0.1)
+       0.1,
+       loadblame("slashes")
+       )
 
 # Hacky command to output the current fishpond state
 def fishq(bot, cmd, nick, conn, public,f):
@@ -222,7 +223,7 @@ commands = {"karma": (c.karmaq,karmadb),
            "nws": (c.nsfwq,urldb),
            "units": c.unitq,
            "currency":c.currencyq,
-            "blame": (c.blameq,fish,tbdb,tbdbk,fbdb,fbdbk,sbdb,sbdbk),
+            "blame": (c.blameq,fish, [troutcfg,flirtcfg,slashcfg]),
            "help": c.helpq,
             "say": c.sayq,
             "do": c.doq,