diff options
author | 2021-08-28 00:53:59 +0200 | |
---|---|---|
committer | 2021-08-28 00:53:59 +0200 | |
commit | 15205e11fa132e076f992bfdbad2dd95894d2216 (patch) | |
tree | ebcb5751844e9f2dfb6861e437a1dc84bd047423 | |
parent | Remove unnecessary line in help (diff) |
simplify assignment and add comment explaining its purpose
-rw-r--r-- | bot/exts/info/tags.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/info/tags.py b/bot/exts/info/tags.py index 91046c654..931c01e3a 100644 --- a/bot/exts/info/tags.py +++ b/bot/exts/info/tags.py @@ -146,9 +146,9 @@ class Tags(Cog): for file in base_path.glob("**/*"): if file.is_file(): parent_dir = file.relative_to(base_path).parent - tag_name = file.stem - tag_group = parent_dir.name if parent_dir.name else None + # Files directly under `base_path` have an empty string as the parent directory name + tag_group = parent_dir.name or None self.tags[TagIdentifier(tag_group, tag_name)] = Tag(file) |