From 98540fd5a8e113a118326c123df63f746156948b Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Sun, 21 May 2017 10:38:30 +0100 Subject: [PATCH] Coding style. --- tools.py | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/tools.py b/tools.py index 907f72e..be16489 100644 --- a/tools.py +++ b/tools.py @@ -934,25 +934,12 @@ def tools_all(): def tool_dependencies(tool, distribution="ubuntu"): - if distribution == "ubuntu": + if distribution not in ["ubuntu", "debian", "fedora", "archlinux"]: + raise ValueError + try: + return getattr(tool, distribution + "_dependencies") + except AttributeError: return tool.dependencies - elif distribution == "debian": - try: - return tool.debian_dependencies - except AttributeError: - return tool.dependencies - elif distribution == "fedora": - try: - return tool.fedora_dependencies - except AttributeError: - return tool.dependencies - elif distribution == "arch": - try: - return tool.arch_dependencies - except AttributeError: - return tool.dependencies - else: - raise NotImplementedError def dependencies(distribution="ubuntu"):