Package qm :: Module diagnostic
[hide private]
[frames] | no frames]

Module diagnostic
source code

Table-based diagnostic message generation.

Diagnostics are loaded from text files.  These files are laid out
according to special rules:

  - Lines beginning with a hash mark are ignored.

  - Each diagnostic begins with a line that contains an at sign (@) and
    a tag used to identify the diagnostic.

  - Subsequent text until the start of the next diagnostic is
    the diagnostic template.

  - Diagnostic templates may contain named-substition tokens as
    used by the Python % operator on a string.

  - Diagnostic messages are interpreted as structured text.

For example:

    # This line is a comment

    @ my first diagnostic
    The command you entered, '$(command)s', is bogus.  Please try again.

    @ my second diagnostic
    The value you specified, '$(value)d', is completely bogus.  Don't
    even bother trying again.



Classes [hide private]
DiagnosticSet  

Functions [hide private]
  get_diagnostic_set()
Return the 'DiagnosticSet' containing warning/error messages.
  get_help_set()
Return the 'DiagnosticSet' for help messages.
  message(tag, **substitutions)
Generate a diagnostic message.
  error(tag, output=None, **substitutions)
Generate or emit an error diagnostic.
  warning(tag, output=None, **substitutions)
Generate or emit a warning diagnostic.
  load_messages(tool)
Read messages that apply to 'tool'.

Variables [hide private]
__diagnostic_set The 'DiagnosticSet' object from which diagnostics are generated.
__help_set The 'DiagnosticSet'object from which help text messages are generated.

Function Details [hide private]

get_diagnostic_set()

source code 

Return the 'DiagnosticSet' containing warning/error messages.

returns -- The 'DiagnosticSet' containing warning/error messages.

get_help_set()

source code 

Return the 'DiagnosticSet' for help messages.

returns -- The 'DiagnosticSet' containing help messages.

message(tag, **substitutions)

source code 
Generate a diagnostic message.

error(tag, output=None, **substitutions)

source code 
Generate or emit an error diagnostic.

warning(tag, output=None, **substitutions)

source code 
Generate or emit a warning diagnostic.

load_messages(tool)

source code 

Read messages that apply to 'tool'.

'tool' -- A string giving the name of a QM tool.

Variables Details [hide private]

__diagnostic_set

The 'DiagnosticSet' object from which diagnostics are generated.
Value:
{}                                                                     
      

__help_set

The 'DiagnosticSet'object from which help text messages are generated.
Value:
{}