1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 13:16:44 +02:00

a couple of functions documented

This commit is contained in:
Igor Chubin
2019-04-30 22:52:54 +02:00
parent be47625960
commit 0060f6c8fc
2 changed files with 15 additions and 0 deletions
+10
View File
@@ -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):
"""
+5
View File
@@ -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)