Update utils.py

add color
 + other stuff
This commit is contained in:
Erreur32 2018-02-24 17:52:17 +01:00 committed by GitHub
parent 93288cb38b
commit 6e36b13df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,12 @@ def colorize(sheet_content):
except ImportError: except ImportError:
return sheet_content return sheet_content
# GMFTBY add
if sheet_content == '' :
# can not find the content about the term
die('Can not find the content !')
return
first_line = sheet_content.splitlines()[0] first_line = sheet_content.splitlines()[0]
lexer = get_lexer_by_name('bash') lexer = get_lexer_by_name('bash')
if first_line.startswith('```'): if first_line.startswith('```'):