From f8bc0658d6be2bf5378afe6aa86b0069ab619979 Mon Sep 17 00:00:00 2001 From: TBK Date: Fri, 28 Apr 2017 12:47:45 +0200 Subject: [PATCH] Renamed options to config The options.ini file is now called config.ini --- README.md | 4 +-- ...example_options.ini => example_config.ini} | 2 +- config/example_permissions.ini | 4 +-- musicbot/bot.py | 4 +-- musicbot/config.py | 25 +++++++++---------- run.py | 4 +-- 6 files changed, 21 insertions(+), 22 deletions(-) rename config/{example_options.ini => example_config.ini} (99%) diff --git a/README.md b/README.md index 32ec54180..5e12f6b70 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ Commands are listed [here](https://github.com/DiscordMusicBot/MusicBot/wiki/Comm ### Configuration -The main configuration file is called `config/options.ini` and the permissions file is called `config/permissions.ini` by default they do not exist. +The main configuration file is called `config/config.ini` and the permissions file is called `config/permissions.ini` by default they do not exist. Read the following Wiki pages to on how to create them: -- [Options](https://github.com/DiscordMusicBot/MusicBot/wiki/Configuration) +- [Configurations](https://github.com/DiscordMusicBot/MusicBot/wiki/Configuration) - [Permissions](https://github.com/DiscordMusicBot/MusicBot/wiki/Permissions) diff --git a/config/example_options.ini b/config/example_config.ini similarity index 99% rename from config/example_options.ini rename to config/example_config.ini index fffc59c33..5040bbd35 100644 --- a/config/example_options.ini +++ b/config/example_config.ini @@ -1,7 +1,7 @@ ; DO NOT OPEN THIS FILE WITH NOTEPAD. If you don't have a preferred text ; editor, use Atom or notepad++ or any other modern text editor. ; -; If you edit example_options.ini, Save-As options.ini +; If you edit example_config.ini, Save-As config.ini ; ; This is the main configuration file for MusicBot. You will need to edit ; this file when you setup the bot. The bot must be restarted for edits to diff --git a/config/example_permissions.ini b/config/example_permissions.ini index ca2df6d2f..0ea26b5c7 100644 --- a/config/example_permissions.ini +++ b/config/example_permissions.ini @@ -60,7 +60,7 @@ ; Allows the user to skip a song without having to vote, like the owner. ; ; AllowHigherVolume = no -; Allows the user to go past 100% volume up to the MaxVolume set in options. +; Allows the user to go past 100% volume up to the MaxVolume set in config. ; Enabling this will allow users to distort the volume if the MaxVolume is set higher than 100. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -77,7 +77,7 @@ ;;;;;;;;;;;;;;;;;;; ; This is the fallback group for any users that don't get assigned to another group. Don't remove/rename this group. -; You cannot assign users or roles to this group. Those options are ignored. +; You cannot assign users or roles to this group. Those options are ignored. [Default] CommandWhitelist = play perms queue np skip search id help clean ; CommandBlacklist = diff --git a/musicbot/bot.py b/musicbot/bot.py index fb68a1b3c..3fb8a0383 100644 --- a/musicbot/bot.py +++ b/musicbot/bot.py @@ -48,7 +48,7 @@ class MusicBot(discord.Client): """ TODO """ def __init__(self, config_file=None, perms_file=None): if config_file is None: - config_file = ConfigDefaults.options_file + config_file = ConfigDefaults.config_file if perms_file is None: perms_file = PermissionsDefaults.perms_file @@ -1208,7 +1208,7 @@ def run(self): # Add if token, else raise exceptions.HelpfulError( "Bot cannot login, bad credentials.", - "Fix your %s in the options file. " + "Fix your %s in the config.ini file. " "Remember that each field should be on their own line." % ['shit', 'Token', 'Email/Password', 'Credentials'][len(self.config.auth)] diff --git a/musicbot/config.py b/musicbot/config.py index 44e3fa8bb..1ad7ef4bc 100644 --- a/musicbot/config.py +++ b/musicbot/config.py @@ -159,8 +159,7 @@ def run_checks(self): "The ID should be just a number, approximately " "18 characters long. " "If you don't know what your ID is, read the " - "instructions in the options or ask in the " - "help server.", + "instructions in the config.ini file.", preface=self._confpreface ) @@ -231,12 +230,12 @@ def run_checks(self): self.debug_mode = self.debug_level <= logging.DEBUG - # TODO: Add save function for future editing of options with commands + # TODO: Add save function for future editing of config with commands # Maybe add warnings about fields missing from the config file async def async_validate(self, bot): """ TODO """ - LOG.debug("Validating options...") + LOG.debug("Validating config...") if self.owner_id == 'auto': if not bot.user.bot: @@ -278,15 +277,15 @@ def find_config(self): you should probably turn file extensions on." .format(self.config_file + '.ini', self.config_file)) - elif os.path.isfile('config/example_options.ini'): - shutil.copy('config/example_options.ini', self.config_file) + elif os.path.isfile('config/example_config.ini'): + shutil.copy('config/example_config.ini', self.config_file) LOG.warning( - 'Options file not found, copying example_options.ini') + 'Config file not found, copying example_config.ini') else: raise HelpfulError( - "Your config files are missing. Neither options.ini nor " - "example_options.ini were found.", + "Your config files are missing. Neither config.ini nor " + "example_config.ini were found.", "Grab the files back from the archive or remake them " "yourself and copy paste the content " "from the repo. Stop removing important files!" @@ -303,7 +302,7 @@ def find_config(self): if not int(config.get('Permissions', 'OwnerID', fallback=0)): print(flush=True) LOG.critical( - """Please configure config/options.ini + """Please configure config/config.ini and re-run the bot.""") sys.exit(1) @@ -311,14 +310,14 @@ def find_config(self): raise HelpfulError( 'Invalid value "{}" for OwnerID, config cannot be loaded.' .format(config.get('Permissions', 'OwnerID', fallback=None)), - """The OwnerID option takes a user id, + """The OwnerID option takes a user id, fuck it i'll finish this message later.""" ) except Exception as error: print(flush=True) LOG.critical( - "Unable to copy config/example_options.ini to %s", + "Unable to copy config/example_config.ini to %s", self.config_file, exc_info=error) sys.exit(2) @@ -368,7 +367,7 @@ class ConfigDefaults: # TODO this will change when I add playlists autoplaylist_file = 'config/autoplaylist.txt' banned_file = 'config/banned.txt' - options_file = 'config/options.ini' + config_file = 'config/config.ini' setattr(ConfigDefaults, codecs.decode( diff --git a/run.py b/run.py index 1061e949e..bbc2c8f6c 100644 --- a/run.py +++ b/run.py @@ -343,9 +343,9 @@ def opt_check_disk_space(warnlimit_mb=200): def ensure_files(): """ TODO """ - if os.path.isfile('config/options.ini') is False and \ + if os.path.isfile('config/config.ini') is False and \ os.path.isfile('config/permissions.ini') is False: - LOG.critical("""MISSING config/options.ini and config/permissions.ini!\n + LOG.critical("""MISSING config/config.ini and config/permissions.ini!\n Either cp the config folder into the container or mount is as a volume!""") return True