pyqode.python.managers

class pyqode.python.managers.PyFileManager(editor, replace_tabs_by_spaces=True)

Bases: pyqode.core.managers.file.FileManager

Extends file manager to override detect_encoding. With python, we can detect encoding by reading the two first lines of a file and extracting its encoding tag.

detect_encoding(path)

For the implementation of encoding definitions in Python, look at: - http://www.python.org/dev/peps/pep-0263/

Note

code taken and adapted from `jedi.common.source_to_unicode.detect_encoding`

open(path, encoding=None, use_cached_encoding=True)
fold_docstrings = True
fold_imports = True