From 0060f6c8fc8789e80290979b9e1113ac4738ae75 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Tue, 30 Apr 2019 22:52:54 +0200 Subject: [PATCH] a couple of functions documented --- lib/adapter/adapter.py | 10 ++++++++++ lib/globals.py | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/lib/adapter/adapter.py b/lib/adapter/adapter.py index 94f544a..7dce5e1 100644 --- a/lib/adapter/adapter.py +++ b/lib/adapter/adapter.py @@ -78,6 +78,16 @@ class Adapter(with_metaclass(AdapterMC, object)): """ return self._cache_needed + @staticmethod + def _format_page(text): + """ + Preformatting page hook. + Converts `text` (as in the initial repository) + to text (as to be displayed). + """ + + return text + @abc.abstractmethod def _get_page(self, topic, request_options=None): """ diff --git a/lib/globals.py b/lib/globals.py index ef086b0..c026e10 100644 --- a/lib/globals.py +++ b/lib/globals.py @@ -85,6 +85,11 @@ COLOR_STYLES = sorted(list(get_all_styles())) MALFORMED_RESPONSE_HTML_PAGE = open(os.path.join(STATIC, 'malformed-response.html')).read() def fatal(text): + """ + Fatal error function. + + The function is being used in the standalone mode only + """ sys.stderr.write("ERROR: %s\n" % text) sys.exit(1)