Homec4science

BibFormat: migrate to exception logging

Description

BibFormat: migrate to exception logging

  • Migrates error logging to new exception-based technique. (addresses #580)
  • Creates classes InvenioBibFormatError, InvenioBibFormatWarning, InvenioBibFormatBfxError and InvenioBibFormatBfxWarning .
  • Deletes calls to 'get_msgs_for_code_list' and 'register_errors', and add code for these situations.
  • Deletes CFG_BIBFORMAT_ERROR_MESSAGES, CFG_BIBFORMAT_WARNING_MESSAGES, CFG_BIBFORMAT_BFX_ERROR_MESSAGES, CFG_BIBFORMAT_BFX_WARNING_MESSAGES vars.
  • Deletes 'errors' and warnings vars whenever it is needed.
  • Modifies error message for error called 'ERR_BIBFORMAT_CANNOT_READ_TEMPLATE_FILE': 'Could not read format template named'
  • Uses function 'string.find(error message)' in the cases where is checked the error code.
  • Updates comments of functions.
  • Uses python module 'logging' instead of 'print' statements.
  • Includes 'req' parameter in calls to 'register_exception' whenever it is available.
  • Adds calls to 'gettext_set_language' to translate the exception messages.
  • Changes the return value for function 'eval_format_element': (value, []) to (value, dummy)
  • In calls to function 'format_with_format_template' remove the access by tuple because of this function does not return a tuple now.
  • The same in 'bibformat_engine_tests.py -> test_format_with_format_template, removes access by tuple and removes the line code to check if the result is a tuple because now is returned just one element.

Details

Committed
Tibor Simko <tibor.simko@cern.ch>Feb 10 2012, 15:55
Parents
R3600:52f132724a86: WebBasket: small search fix for external records
Branches
Unknown
Tags
Unknown

Event Timeline

Tibor Simko <tibor.simko@cern.ch> committed R3600:45415b4c8791: BibFormat: migrate to exception logging (authored by Raquel Jimenez Encinar <raquel.jimenez.encinar@cern.ch>).Feb 10 2012, 15:55