Add support for multiple types in packages list

This commit is contained in:
rubenwardy
2018-07-28 18:12:22 +01:00
parent 404200b8f0
commit a3e82ad42f
2 changed files with 18 additions and 9 deletions

View File

@@ -211,6 +211,13 @@ class PackageType(enum.Enum):
def __str__(self):
return self.name
@classmethod
def get(cls, name):
try:
return PackageType[name.upper()]
except KeyError:
return None
@classmethod
def choices(cls):
return [(choice, choice.value) for choice in cls]