default_config.py 3.4 KB

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