Coding style.

This commit is contained in:
Andrew Hamilton 2017-05-21 10:38:30 +01:00
parent f2e8240427
commit 98540fd5a8

View file

@ -934,25 +934,12 @@ def tools_all():
def tool_dependencies(tool, distribution="ubuntu"): 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 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"): def dependencies(distribution="ubuntu"):