From: Alina Quereilhac Date: Sat, 2 Mar 2013 11:05:01 +0000 (+0100) Subject: ResourceFactory is a class with only class state and methods. X-Git-Tag: nepi-3.0.0~122^2~27 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=36766898b245c4538782bd793fd41b122c7704bf;p=nepi.git ResourceFactory is a class with only class state and methods. --- diff --git a/src/neco/execution/resource.py b/src/neco/execution/resource.py index 86d930e5..aba9d080 100644 --- a/src/neco/execution/resource.py +++ b/src/neco/execution/resource.py @@ -86,13 +86,13 @@ class Resource(object): return True class ResourceFactory(object): - def __init__(self): - self._resource_types = dict() + _resource_types = dict() - def register_type(self, rtype, rclass): - self._resource_types[rtype] = rclass + @classmethod + def register_type(cls, rtype, rclass): + cls._resource_types[rtype] = rclass - def create(self, rtype, ec, guid): - rclass = self._resource[rtype] + @classmethod + def create(cls, rtype, ec, guid): + rclass = cls._resource[rtype] return rclass(ec, guid) -