parameters: (self, message, **kwargs)
return_statement: return "{}:{}: {}".format(fn, sourceline, message)
docstring: Prepend a file and/or line reference to the message, if possible.
  
          If filename is given as a keyword argument, it is used on its own.
  
          If filename is not given, this will attempt to retrieve the filename and line from an XML element.
          If 'elem' is given as a keyword argument and is not None, it is used to find the line.
          If 'elem' is given as None, no XML elements are looked at.
          If 'elem' is not supplied, the error context element is used.
  
          If using XML, the filename, if available, is retrieved from the Registry class.
          If using XML and python-lxml is installed, the source line is retrieved from whatever element is chosen.
docstring_summary: Prepend a file and/or line reference to the message, if possible.
docstring_tokens: Prepend a file and / or line reference to the message if possible .
function: def _prepend_sourceline_to_message(self, message, **kwargs):
          """Prepend a file and/or line reference to the message, if possible.
  
          If filename is given as a keyword argument, it is used on its own.
  
          If filename is not given, this will attempt to retrieve the filename and line from an XML element.
          If 'elem' is given as a keyword argument and is not None, it is used to find the line.
          If 'elem' is given as None, no XML elements are looked at.
          If 'elem' is not supplied, the error context element is used.
  
          If using XML, the filename, if available, is retrieved from the Registry class.
          If using XML and python-lxml is installed, the source line is retrieved from whatever element is chosen."""
          fn = kwargs.get('filename')
          sourceline = None
  
          if fn is None:
              elem = kwargs.get('elem', self.elem)
              if elem is not None:
                  sourceline = getattr(elem, 'sourceline', None)
                  if self.reg.filename:
                      fn = self.reg.filename
  
          if fn is None and sourceline is None:
              return message
  
          if fn is None:
              return "Line {}: {}".format(sourceline, message)
  
          if sourceline is None:
              return "{}: {}".format(fn, message)
  
          return "{}:{}: {}".format(fn, sourceline, message)
function_tokens: def _prepend_sourceline_to_message ( self , message , * * kwargs ) : fn = kwargs . get ( 'filename' ) sourceline = None if fn is None : elem = kwargs . get ( 'elem' , self . elem ) if elem is not None : sourceline = getattr ( elem , 'sourceline' , None ) if self . reg . filename : fn = self . reg . filename if fn is None and sourceline is None : return message if fn is None : return "Line {}: {}" . format ( sourceline , message ) if sourceline is None : return "{}: {}" . format ( fn , message ) return "{}:{}: {}" . format ( fn , sourceline , message )