用于python的editorconfig文件定位器和解释器
EditorConfig的Python项目详细描述
editorconfig python core提供的功能与 EditorConfig C Core。 editorconfig python core可以用作命令行程序或 可导入库。
editorconfig项目
editorconfig使得在切换时很容易保持正确的编码风格 在不同的文本编辑器之间和不同的项目之间。这个 editorconfig项目维护各种文本的文件格式和插件 允许这些编辑器读取和使用此文件格式的编辑器。为了 有关文件格式和支持的文本编辑器的信息,请参见 EditorConfig website。
安装
使用设置工具:
sudo python setup.py install
获取帮助
有关editorconfig核心代码的帮助,请写信给我们的mailing list。错误和功能请求 应该提交给我们的issue tracker。
如果您正在编写一个插件一种可以导入python库的语言,那么 可能需要直接导入和使用editorconfig python核心。
用作库
使用editorconfig python core作为库的基本示例:
fromeditorconfigimportget_properties,EditorConfigErrorfilename="/home/zoidberg/humans/anatomy.md"try:options=get_properties(filename)exceptEditorConfigError:print"Error occurred while getting EditorConfig properties"else:forkey,valueinoptions.items():print"%s=%s"%(key,value)
有关详细信息,请查看online documentation。
运行测试用例
Cmake必须先安装。运行测试用例 使用以下命令:
cmake . ctest .
使用-DPYTHON_EXECUTABLE使用 Python(如Python3):
cmake -DPYTHON_EXECUTABLE=/usr/bin/python3 . ctest .
许可证
有关许可的详细信息,请参见复制文件。