X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~matthewv/git?a=blobdiff_plain;f=Servus-chiark.py;h=f0be526abdf5f855cf5cb77ac6ac126032397c23;hb=d8ac6968378475b0946a0602ea0e4f78f3a94d59;hp=828a17f2a5b465c32e2b0753dcf97f55435b2847;hpb=5bf30b6ddca2d6aa9384917324e442415368b799;p=irc.git diff --git a/Servus-chiark.py b/Servus-chiark.py index 828a17f..f0be526 100755 --- a/Servus-chiark.py +++ b/Servus-chiark.py @@ -42,17 +42,15 @@ import commands as c # This fishpond is shared between trouts and flirts. It doesn't have to be; # you can define as many ponds as you like. -class fish: +class Fish (c.FishPond): cur_fish=5 max_fish=5 nofish_time=60 fish_time_inc=60 fish_inc=2 - DoS=0 Boring_Git='Nobody' - quotatime=0 - last="" - last_cfg=None + +fish = Fish() # load the "blame" details for a file def loadblame(filename): @@ -70,13 +68,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 +88,9 @@ troutcfg = ( "Who do you wish me to trout?", "Fish stocks exhausted.", fish, - 0.1) + 0.1, + loadblame("trouts"), + ) flirtcfg = ( __load("flirts"), @@ -104,7 +99,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 +110,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,10 +221,7 @@ commands = {"karma": (c.karmaq,karmadb), "nws": (c.nsfwq,urldb), "units": c.unitq, "currency":c.currencyq, - "blame": (c.blameq,fish, - troutcfg,tbdb,tbdbk, - flirtcfg,fbdb,fbdbk, - slashcfg,sbdb,sbdbk), + "blame": (c.blameq,fish, [troutcfg,flirtcfg,slashcfg]), "help": c.helpq, "say": c.sayq, "do": c.doq,