bot: clean
This commit is contained in:
parent
1e38901c11
commit
ed6c0e47dd
|
@ -20,7 +20,7 @@ class Bot(irc.client.SimpleIRCClient, Logger):
|
|||
self.logger = logger
|
||||
self.plugins = []
|
||||
self.values = {}
|
||||
self.storage = self._get_storage()
|
||||
self.storage = self.__get_storage()
|
||||
|
||||
@property
|
||||
def nick(self):
|
||||
|
@ -41,7 +41,7 @@ class Bot(irc.client.SimpleIRCClient, Logger):
|
|||
self.values[self.CHANNELS_RUNTIME_KEY] = []
|
||||
return self.values[self.CHANNELS_RUNTIME_KEY]
|
||||
|
||||
def _get_storage(self):
|
||||
def __get_storage(self):
|
||||
"""Load data from storage."""
|
||||
try:
|
||||
with open(self.config["storage_file"], "rt") as storage_file:
|
||||
|
@ -54,7 +54,7 @@ class Bot(irc.client.SimpleIRCClient, Logger):
|
|||
" data when closing the program.")
|
||||
return {}
|
||||
|
||||
def _save_storage(self):
|
||||
def __save_storage(self):
|
||||
"""Save storage data to disk."""
|
||||
try:
|
||||
with open(self.config["storage_file"], "wt") as storage_file:
|
||||
|
@ -114,7 +114,7 @@ class Bot(irc.client.SimpleIRCClient, Logger):
|
|||
self.start()
|
||||
except KeyboardInterrupt:
|
||||
self.log_i("Stopping Edmond.")
|
||||
self._save_storage()
|
||||
self.__save_storage()
|
||||
|
||||
def load_plugins(self):
|
||||
"""Load all installed plugins."""
|
||||
|
|
Loading…
Reference in a new issue