Browse Source

Errors that can be ignored are logged as warnings

pull/176/head
Louis 9 years ago
parent
commit
8c86f904cd
  1. 2
      patacrep/latex/__init__.py
  2. 2
      patacrep/latex/lexer.py
  3. 2
      patacrep/songs/chordpro/lexer.py
  4. 4
      patacrep/songs/syntax.py

2
patacrep/latex/__init__.py

@ -130,5 +130,5 @@ def lang2babel(lang):
try:
return BABEL_LANGUAGES[checklanguage(lang)]
except UnknownLanguage as error:
LOGGER.error(str(error))
LOGGER.warning(str(error))
return BABEL_LANGUAGES[error.fallback]

2
patacrep/latex/lexer.py

@ -72,7 +72,7 @@ class SimpleLexer:
@staticmethod
def t_error(token):
"""Manage errors"""
LOGGER.error("Illegal character '{}'".format(token.value[0]))
LOGGER.warning("Illegal character '{}'".format(token.value[0]))
token.lexer.skip(1)
class SongLexer(SimpleLexer):

2
patacrep/songs/chordpro/lexer.py

@ -142,7 +142,7 @@ class ChordProLexer:
)
if self.filename is not None:
message = "File {}: {}".format(self.filename, message)
LOGGER.error(message)
LOGGER.warning(message)
token.lexer.skip(1)
def t_error(self, token):

4
patacrep/songs/syntax.py

@ -45,9 +45,9 @@ class Parser:
else:
text += "."
if self.filename is None:
LOGGER.error(text)
LOGGER.warning(text)
else:
LOGGER.error("File {}: {}".format(self.filename, text))
LOGGER.warning("File {}: {}".format(self.filename, text))
def p_error(self, token):
"""Manage parsing errors."""

Loading…
Cancel
Save