Currently SerializableConfigParser.Loads is a static method that returns
a SerializableConfigParser. With this patch we change it to a class
method that returns a member of the class. This way a subclass calling
Loads on itself will get its own member, rather than a bare
SerializableConfigParser.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Balazs Lecz <leczb@google.com>
self.write(buf)
return buf.getvalue()
- @staticmethod
- def Loads(data):
+ @classmethod
+ def Loads(cls, data):
"""Load data from a string."""
buf = StringIO(data)
- cfp = SerializableConfigParser()
+ cfp = cls()
cfp.readfp(buf)
return cfp