config.py 3.9 KB

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