From 894c8672e8e4fc31bacf6dddc00c4956a47e0ecc Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Mon, 26 Nov 2018 13:40:19 +0100 Subject: [PATCH] Rename ~reload to ~emptydb Reload now effectively empties the database completely, so rename the function for clarity. Change-Id: I5c30a89213e462dd3777052d6a6c2714039bbb76 --- README.rst | 4 ++-- ptgbot/bot.py | 4 ++-- ptgbot/db.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 2c6dcef..cd25bc1 100644 --- a/README.rst +++ b/README.rst @@ -133,8 +133,8 @@ You have to be a channel operator (+o) to use admin commands. ~newday Removes now/next/location entries, to be run at the start of a new day -~reload - Resets the database entirely (reloads from configuration) +~emptydb + Resets the database entirely to minimal contents ~fetchdb URL Fetches JSON DB from specified URL. Any JSON key specified will replace diff --git a/ptgbot/bot.py b/ptgbot/bot.py index 9d75a3d..f94aebf 100644 --- a/ptgbot/bot.py +++ b/ptgbot/bot.py @@ -153,8 +153,8 @@ class PTGBot(SASL, SSL, irc.bot.SingleServerIRCBot): return words = msg.split() command = words[0][1:].lower() - if command == 'reload': - self.data.reload() + if command == 'emptydb': + self.data.empty() elif command == 'fetchdb': url = words[1] self.send(chan, "Loading DB from %s ..." % url) diff --git a/ptgbot/db.py b/ptgbot/db.py index e57706f..a90ac28 100644 --- a/ptgbot/db.py +++ b/ptgbot/db.py @@ -165,7 +165,7 @@ class PTGDataBase(): self.data['location'] = {} self.save() - def reload(self): + def empty(self): self.data = copy.deepcopy(self.BASE) self.save()