1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-12-13 22:42:44 +03:00
cheat.sh/lib/globals.py
2017-05-26 09:17:39 +00:00

30 lines
900 B
Python

import logging
import os
MYDIR = os.path.abspath(os.path.dirname( os.path.dirname('__file__') ))
ANSI2HTML = os.path.join( MYDIR, "share/ansi2html.sh" )
LOG_FILE = os.path.join( MYDIR, 'log/main.log' )
FILE_QUERIES_LOG = os.path.join( MYDIR, 'log/queries.log' )
TEMPLATES = os.path.join( MYDIR, 'share/templates' )
STATIC = os.path.join( MYDIR, 'share/static' )
PATH_TLDR_PAGES = "/home/igor/.tldr/cache/pages/*/*.md"
PATH_CHEAT_PAGES = "/usr/local/lib/python2.7/dist-packages/cheat/cheatsheets/*"
PATH_CHEAT_SHEETS = "/home/igor/cheat.sheets/sheets/"
PATH_CHEAT_SHEETS_SPOOL = "/home/igor/cheat.sheets/spool/"
def error(text):
if not text.startswith('Too many queries'):
print text
logging.error("ERROR "+text)
raise RuntimeError(text)
def log(text):
if not text.startswith('Too many queries'):
print text
logging.info(text)