From e70474fd1409d742320a7666d4a5d15d99fd4ee7 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 26 Apr 2013 20:33:45 +0200 Subject: [PATCH] docs: Add ConfigSchema.serialize() docstring --- mopidy/config/schemas.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mopidy/config/schemas.py b/mopidy/config/schemas.py index 7364530f..becf978f 100644 --- a/mopidy/config/schemas.py +++ b/mopidy/config/schemas.py @@ -44,7 +44,7 @@ class ConfigSchema(object): """Logical group of config values that correspond to a config section. Schemas are set up by assigning config keys with config values to - instances. Once setup :meth:`deserialize` can be called with a dict of + instances. Once setup :meth:`deserialize` can be called with a dict of values to process. For convienience we also support :meth:`format` method that can used for converting the values to a dict that can be printed and :meth:`serialize` for converting the values to a form suitable for @@ -91,6 +91,12 @@ class ConfigSchema(object): return result, errors def serialize(self, values, display=False): + """Converts the given ``values`` to a format suitable for persistence. + + If ``display`` is :class:`True` secret config values, like passwords, + will be masked out. + + Returns a dict of config keys and values.""" result = ordered_dict() # TODO: 2.6 cleanup (#344). for key in self._order: if key in values: