Rename ~reload to ~emptydb
Reload now effectively empties the database completely, so rename the function for clarity. Change-Id: I5c30a89213e462dd3777052d6a6c2714039bbb76
This commit is contained in:
parent
42451c744b
commit
894c8672e8
|
@ -133,8 +133,8 @@ You have to be a channel operator (+o) to use admin commands.
|
||||||
~newday
|
~newday
|
||||||
Removes now/next/location entries, to be run at the start of a new day
|
Removes now/next/location entries, to be run at the start of a new day
|
||||||
|
|
||||||
~reload
|
~emptydb
|
||||||
Resets the database entirely (reloads from configuration)
|
Resets the database entirely to minimal contents
|
||||||
|
|
||||||
~fetchdb URL
|
~fetchdb URL
|
||||||
Fetches JSON DB from specified URL. Any JSON key specified will replace
|
Fetches JSON DB from specified URL. Any JSON key specified will replace
|
||||||
|
|
|
@ -153,8 +153,8 @@ class PTGBot(SASL, SSL, irc.bot.SingleServerIRCBot):
|
||||||
return
|
return
|
||||||
words = msg.split()
|
words = msg.split()
|
||||||
command = words[0][1:].lower()
|
command = words[0][1:].lower()
|
||||||
if command == 'reload':
|
if command == 'emptydb':
|
||||||
self.data.reload()
|
self.data.empty()
|
||||||
elif command == 'fetchdb':
|
elif command == 'fetchdb':
|
||||||
url = words[1]
|
url = words[1]
|
||||||
self.send(chan, "Loading DB from %s ..." % url)
|
self.send(chan, "Loading DB from %s ..." % url)
|
||||||
|
|
|
@ -165,7 +165,7 @@ class PTGDataBase():
|
||||||
self.data['location'] = {}
|
self.data['location'] = {}
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def reload(self):
|
def empty(self):
|
||||||
self.data = copy.deepcopy(self.BASE)
|
self.data = copy.deepcopy(self.BASE)
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue