OLD | NEW |
(Empty) | |
| 1 # Copy from rope/base/default_config.py |
| 2 |
| 3 # The default ``config.py`` |
| 4 |
| 5 |
| 6 def set_prefs(prefs): |
| 7 """This function is called before opening the project""" |
| 8 |
| 9 # Specify which files and folders to ignore in the project. |
| 10 # Changes to ignored resources are not added to the history and |
| 11 # VCSs. Also they are not returned in `Project.get_files()`. |
| 12 # Note that ``?`` and ``*`` match all characters but slashes. |
| 13 # '*.pyc': matches 'test.pyc' and 'pkg/test.pyc' |
| 14 # 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc' |
| 15 # '.svn': matches 'pkg/.svn' and all of its children |
| 16 # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o' |
| 17 # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o' |
| 18 prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject', |
| 19 '.hg', '.svn', '_svn', '.git', '.tox'] |
| 20 |
| 21 # Specifies which files should be considered python files. It is |
| 22 # useful when you have scripts inside your project. Only files |
| 23 # ending with ``.py`` are considered to be python files by |
| 24 # default. |
| 25 #prefs['python_files'] = ['*.py'] |
| 26 |
| 27 # Custom source folders: By default rope searches the project |
| 28 # for finding source folders (folders that should be searched |
| 29 # for finding modules). You can add paths to that list. Note |
| 30 # that rope guesses project source folders correctly most of the |
| 31 # time; use this if you have any problems. |
| 32 # The folders should be relative to project root and use '/' for |
| 33 # separating folders regardless of the platform rope is running on. |
| 34 # 'src/my_source_folder' for instance. |
| 35 #prefs.add('source_folders', 'src') |
| 36 |
| 37 # You can extend python path for looking up modules |
| 38 #prefs.add('python_path', '~/python/') |
| 39 |
| 40 # Should rope save object information or not. |
| 41 prefs['save_objectdb'] = True |
| 42 prefs['compress_objectdb'] = False |
| 43 |
| 44 # If `True`, rope analyzes each module when it is being saved. |
| 45 prefs['automatic_soa'] = True |
| 46 # The depth of calls to follow in static object analysis |
| 47 prefs['soa_followed_calls'] = 0 |
| 48 |
| 49 # If `False` when running modules or unit tests "dynamic object |
| 50 # analysis" is turned off. This makes them much faster. |
| 51 prefs['perform_doa'] = True |
| 52 |
| 53 # Rope can check the validity of its object DB when running. |
| 54 prefs['validate_objectdb'] = True |
| 55 |
| 56 # How many undos to hold? |
| 57 prefs['max_history_items'] = 32 |
| 58 |
| 59 # Shows whether to save history across sessions. |
| 60 prefs['save_history'] = True |
| 61 prefs['compress_history'] = False |
| 62 |
| 63 # Set the number spaces used for indenting. According to |
| 64 # :PEP:`8`, it is best to use 4 spaces. Since most of rope's |
| 65 # unit-tests use 4 spaces it is more reliable, too. |
| 66 prefs['indent_size'] = 4 |
| 67 |
| 68 # Builtin and c-extension modules that are allowed to be imported |
| 69 # and inspected by rope. |
| 70 prefs['extension_modules'] = [] |
| 71 |
| 72 # Add all standard c-extensions to extension_modules list. |
| 73 prefs['import_dynload_stdmods'] = True |
| 74 |
| 75 # If `True` modules with syntax errors are considered to be empty. |
| 76 # The default value is `False`; When `False` syntax errors raise |
| 77 # `rope.base.exceptions.ModuleSyntaxError` exception. |
| 78 prefs['ignore_syntax_errors'] = False |
| 79 |
| 80 # If `True`, rope ignores unresolvable imports. Otherwise, they |
| 81 # appear in the importing namespace. |
| 82 prefs['ignore_bad_imports'] = False |
| 83 |
| 84 # If `True`, rope will transform a comma list of imports into |
| 85 # multiple separate import statements when organizing |
| 86 # imports. |
| 87 prefs['split_imports'] = False |
| 88 |
| 89 # If `True`, rope will sort imports alphabetically by module name |
| 90 # instead of alphabetically by import statement, with from imports |
| 91 # after normal imports. |
| 92 prefs['sort_imports_alphabetically'] = False |
| 93 |
| 94 |
| 95 def project_opened(project): |
| 96 """This function is called after opening the project""" |
| 97 # Do whatever you like here! |
OLD | NEW |