The configuration class `fish' appears in every bot, but it also
contains initial values of state variables used by the implementation.
Move those into their own class, and make it a base class of
Servus-chiark's pond. Since we are duck typing, it is OK to not yet
update the other bots.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
# 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
# load the "blame" details for a file
def loadblame(filename):
(bot.revision.split()[1], bot.channel, conn.get_nickname(),
bot.owner, len(karma.keys())))
+class FishPond:
+ DoS=0
+ quotatime=0
+ last=""
+ last_cfg=None
+
# Check on fish stocks
def fish_quota(pond):
if pond.DoS: