Python + rope: setting ignored resource patterns?

444 Views Asked by At

The rope documentation says that:

Each project has a set of ignored resource patterns

But nowhere does it mention how to configure that list.

How do I configure the list of ignored resources for my project?

2

There are 2 best solutions below

0
David Wolever On BEST ANSWER

In ~/.ropeproject/config.py there's an ignored_resources setting which seems to do the trick:

# 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']
0
mcepl On

Every project has a hidden subdirectory .ropeproject/. Take a look at the config.py file there. The file is very well documented.