API Documentation - le717/linescan.py GitHub Wiki

The API has been intentionally kept simple to make linescan.py easy to use. Example of these functions can be found in the tests directory.

linescan.scan()

Parameters

  • {String} file_name - The file to be scanned.
  • {Integer} start_line - The line number where to begin scanning.
  • {Integer|String} [end_line="end"] - The line number where to end scanning. Passing the string "end" will scan from start_line to the end of the file.
  • {String} [encoding=None] - Specify a file encoding to use. Defaults to the value of locale.getpreferredencoding(False) if set to None.

Return

  • {String|Boolean} - The lines scanned or False if an error was raised and exceptions are not enabled.

linescan.show_errors()

Parameters

  • {Boolean} [enable=False] - Passing a value of True enables exception raising. Passing a value of False will restore default error handling behavior.

Return

  • No return value.