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

Class DiagnosticSet

source code

Instance Methods [hide private]
 
__init__(self)
Initialize a new set of diagnostics.
source code
 
ReadFromFile(self, path)
Load diagnostics from a file.
source code
 
Generate(self, tag, severity='error', output=None, **substitutions)
Generate a diagnostic message.
source code
Class Variables [hide private]
  __comment_regex = re.compile(r'(?m)^[ \t]*#.*$')
  __separator_regex = re.compile(r'(?m)^@')
Method Details [hide private]

ReadFromFile(self, path)

source code 

Load diagnostics from a file.

'path' -- Path to the file containing diagnostics.

Generate(self, tag, severity='error', output=None, **substitutions)

source code 

Generate a diagnostic message.

'tag' -- The tag of the diagnostic to generate.

'severity' -- A string representing the severity of the diagnostic, for instance "warning" or "error".

'output' -- If not 'None', the a file object to which the a full diagnostic is written.

'substitutions' -- Named values for substitution into the diagnostic message.

returns -- The bare diagnostic message.