Python + rope:设置忽略资源模式?
Python + rope: setting ignored resource patterns?
Each project has a set of ignored resource patterns
但它没有提到如何配置该列表。
如何为我的项目配置忽略资源列表?
每个项目都有一个隐藏的子目录.ropeproject/
。看看那里的 config.py
文件。该文件有很好的记录。
在 ~/.ropeproject/config.py
中有一个 ignored_resources
设置似乎可以解决问题:
# Specify which files and folders to ignore in the project.
# Changes to ignored resources are not added to the history and
# VCSs. Also they are not returned in `Project.get_files()`.
# Note that ``?`` and ``*`` match all characters but slashes.
# '*.pyc': matches 'test.pyc' and 'pkg/test.pyc'
# 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc'
# '.svn': matches 'pkg/.svn' and all of its children
# 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
# 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject',
'.hg', '.svn', '_svn', '.git', '.tox']
Each project has a set of ignored resource patterns
但它没有提到如何配置该列表。
如何为我的项目配置忽略资源列表?
每个项目都有一个隐藏的子目录.ropeproject/
。看看那里的 config.py
文件。该文件有很好的记录。
在 ~/.ropeproject/config.py
中有一个 ignored_resources
设置似乎可以解决问题:
# Specify which files and folders to ignore in the project.
# Changes to ignored resources are not added to the history and
# VCSs. Also they are not returned in `Project.get_files()`.
# Note that ``?`` and ``*`` match all characters but slashes.
# '*.pyc': matches 'test.pyc' and 'pkg/test.pyc'
# 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc'
# '.svn': matches 'pkg/.svn' and all of its children
# 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
# 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject',
'.hg', '.svn', '_svn', '.git', '.tox']