/
githubmirror
/
cheat.sh
Обзор
Документация
Войти
/
githubmirror
/
cheat.sh
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/globals.py
39 строк
821 B
Igor Chubin
Format python code using black
29 июл 2025, 21:07
29 июл 2025, 21:07
e82797a
Код
Авторство
О чём код?
""" Global functions that our used everywhere in the project. Please, no global variables here. For the configuration related things see `config.py` """ from __future__ import print_function import sys import logging 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) def error(text): """ Log error `text` and produce a RuntimeError exception """ if not text.startswith("Too many queries"): print(text) logging.error("ERROR %s", text) raise RuntimeError(text) def log(text): """ Log error `text` (if it does not start with 'Too many queries') """ if not text.startswith("Too many queries"): print(text) logging.info(text)