Sort methods

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-23 19:27:10 -04:00
parent 87b0be65d4
commit 3789d5cfcf
+11 -11
View File
@@ -33,8 +33,15 @@ class BaseTransformation(object):
return result.hexdigest() return result.hexdigest()
@classmethod @classmethod
def register(cls, transformation): def get(cls, name):
cls._registry[transformation.name] = transformation return cls._registry[name]
@classmethod
def get_label(cls):
if cls.arguments:
return string_concat(cls.label, ': ', ', '.join(cls.arguments))
else:
return cls.label
@classmethod @classmethod
def get_transformation_choices(cls): def get_transformation_choices(cls):
@@ -45,15 +52,8 @@ class BaseTransformation(object):
) )
@classmethod @classmethod
def get(cls, name): def register(cls, transformation):
return cls._registry[name] cls._registry[transformation.name] = transformation
@classmethod
def get_label(cls):
if cls.arguments:
return string_concat(cls.label, ': ', ', '.join(cls.arguments))
else:
return cls.label
def __init__(self, **kwargs): def __init__(self, **kwargs):
self.kwargs = {} self.kwargs = {}