diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2021-02-05 01:38:33 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2021-02-05 01:38:33 +0100 |
| commit | a3e983f78dc4cbcf6f75f78fa2b3c57e09cd1b2b (patch) | |
| tree | 41e580d778fce9baa00dd3850b8cf79b9ac820e9 /src/suite/suite.py | |
| parent | e3fd7b2f1de32dfedce03470571f383b407096cb (diff) | |
| download | minishell_test-a3e983f78dc4cbcf6f75f78fa2b3c57e09cd1b2b.tar.gz minishell_test-a3e983f78dc4cbcf6f75f78fa2b3c57e09cd1b2b.tar.bz2 minishell_test-a3e983f78dc4cbcf6f75f78fa2b3c57e09cd1b2b.zip | |
Added a few flake8 plugin
Diffstat (limited to 'src/suite/suite.py')
| -rw-r--r-- | src/suite/suite.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/suite/suite.py b/src/suite/suite.py index f3d58b1..836cac0 100644 --- a/src/suite/suite.py +++ b/src/suite/suite.py @@ -6,7 +6,7 @@ # By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 18:24:29 by charles #+# #+# # -# Updated: 2021/01/31 04:40:22 by charles ### ########.fr # +# Updated: 2021/02/04 16:13:08 by charles ### ########.fr # # # # ############################################################################ # @@ -28,7 +28,7 @@ class Suite: break @classmethod - def setup(cls, asked_names: List[str]): + def setup(cls, asked_names: List[str]) -> None: """ Remove not asked suite from available suites Tries to autocomplete the asked names """ @@ -49,7 +49,7 @@ class Suite: or n.startswith(name)] if len(matches) == 1: names.append(matches[0]) - elif len(matches) != 0 and all([n.startswith(name) for n in matches]): + elif len(matches) != 0 and all(n.startswith(name) for n in matches): names.extend(matches) elif len(matches) > 2: print(("Ambiguous name `{}` match the following suites\n\t{}\n" @@ -64,7 +64,7 @@ class Suite: cls.available = list(set( [s for s in cls.available if s.name in names] - + [s for s in cls.available if any([g for g in s.groups if g in names])] + + [s for s in cls.available if any(g for g in s.groups if g in names)] )) cls.available.sort(key=lambda s: s.name) for s in cls.available: @@ -79,7 +79,7 @@ class Suite: @classmethod def list(cls): print("Groups:") - print("\n".join(set([" - " + ', '.join(s.groups) for s in Suite.available]))) + print("\n".join({" - " + ', '.join(s.groups) for s in Suite.available})) print("The available suites are:") max_name_width = max(len(s.name) for s in Suite.available) + 5 lines = [ |
