|
1 # # The default ``config.py`` |
|
2 # flake8: noqa |
|
3 |
|
4 |
|
5 def set_prefs(prefs): |
|
6 """This function is called before opening the project""" |
|
7 |
|
8 # Specify which files and folders to ignore in the project. |
|
9 # Changes to ignored resources are not added to the history and |
|
10 # VCSs. Also they are not returned in `Project.get_files()`. |
|
11 # Note that ``?`` and ``*`` match all characters but slashes. |
|
12 # '*.pyc': matches 'test.pyc' and 'pkg/test.pyc' |
|
13 # 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc' |
|
14 # '.svn': matches 'pkg/.svn' and all of its children |
|
15 # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o' |
|
16 # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o' |
|
17 prefs["ignored_resources"] = [ |
|
18 "*.pyc", |
|
19 "*~", |
|
20 ".ropeproject", |
|
21 ".hg", |
|
22 ".svn", |
|
23 "_svn", |
|
24 ".git", |
|
25 ".tox", |
|
26 ".venv", |
|
27 "venv", |
|
28 '.eric7project', |
|
29 ] |
|
30 |
|
31 # Specifies which files should be considered python files. It is |
|
32 # useful when you have scripts inside your project. Only files |
|
33 # ending with ``.py`` are considered to be python files by |
|
34 # default. |
|
35 # prefs['python_files'] = ['*.py'] |
|
36 |
|
37 # Custom source folders: By default rope searches the project |
|
38 # for finding source folders (folders that should be searched |
|
39 # for finding modules). You can add paths to that list. Note |
|
40 # that rope guesses project source folders correctly most of the |
|
41 # time; use this if you have any problems. |
|
42 # The folders should be relative to project root and use '/' for |
|
43 # separating folders regardless of the platform rope is running on. |
|
44 # 'src/my_source_folder' for instance. |
|
45 # prefs.add('source_folders', 'src') |
|
46 |
|
47 # You can extend python path for looking up modules |
|
48 # prefs.add('python_path', '~/python/') |
|
49 |
|
50 # Should rope save object information or not. |
|
51 prefs["save_objectdb"] = True |
|
52 prefs["compress_objectdb"] = False |
|
53 |
|
54 # If `True`, rope analyzes each module when it is being saved. |
|
55 prefs["automatic_soa"] = True |
|
56 # The depth of calls to follow in static object analysis |
|
57 prefs["soa_followed_calls"] = 0 |
|
58 |
|
59 # If `False` when running modules or unit tests "dynamic object |
|
60 # analysis" is turned off. This makes them much faster. |
|
61 prefs["perform_doa"] = True |
|
62 |
|
63 # Rope can check the validity of its object DB when running. |
|
64 prefs["validate_objectdb"] = True |
|
65 |
|
66 # How many undos to hold? |
|
67 prefs["max_history_items"] = 32 |
|
68 |
|
69 # Shows whether to save history across sessions. |
|
70 prefs["save_history"] = True |
|
71 prefs["compress_history"] = False |
|
72 |
|
73 # Set the number spaces used for indenting. According to |
|
74 # :PEP:`8`, it is best to use 4 spaces. Since most of rope's |
|
75 # unit-tests use 4 spaces it is more reliable, too. |
|
76 prefs["indent_size"] = 4 |
|
77 |
|
78 # Builtin and c-extension modules that are allowed to be imported |
|
79 # and inspected by rope. |
|
80 prefs["extension_modules"] = [] |
|
81 # Extension modules definition suitable for PyQt6 development. |
|
82 # prefs['extension_modules'] = [ |
|
83 # "PyQt6.QtCore", "PyQt6.QtCharts", "PyQt6.QtGui", "PyQt6.QtHelp", |
|
84 # "PyQt6.QtMultimedia", "PyQt6.QtMultimediaWidgets", "PyQt6.QtNetwork", |
|
85 # "PyQt6.QtPrintSupport", "PyQt6.QtSerialPort", "PyQt6.QtSql", |
|
86 # "PyQt6.QtSvg", "PyQt6.QtSvgWidgets", "PyQt6.QtWebChannel", |
|
87 # "PyQt6.QtWebEngineCore", "PyQt6.QtWebEngineWidgets", |
|
88 # "PyQt6.QtWebSockets", "PyQt6.QtWidgets", "PyQt6.QtXml", "PyQt6.Qsci", |
|
89 # "PyQt6.QtBluetooth", "PyQt6.QtDBus", "PyQt6.Qt.Nfc", "PyQt6.QtOpenGL", |
|
90 # "PyQt6.QtOpenGLWidgets", "PyQt6.QtRemoteObjects", |
|
91 # ] |
|
92 |
|
93 # Add all standard c-extensions to extension_modules list. |
|
94 prefs["import_dynload_stdmods"] = True |
|
95 |
|
96 # If `True` modules with syntax errors are considered to be empty. |
|
97 # The default value is `False`; When `False` syntax errors raise |
|
98 # `rope.base.exceptions.ModuleSyntaxError` exception. |
|
99 prefs["ignore_syntax_errors"] = False |
|
100 |
|
101 # If `True`, rope ignores unresolvable imports. Otherwise, they |
|
102 # appear in the importing namespace. |
|
103 prefs["ignore_bad_imports"] = False |
|
104 |
|
105 # If `True`, rope will insert new module imports as |
|
106 # `from <package> import <module>` by default. |
|
107 prefs["prefer_module_from_imports"] = False |
|
108 |
|
109 # If `True`, rope will transform a comma list of imports into |
|
110 # multiple separate import statements when organizing |
|
111 # imports. |
|
112 prefs["split_imports"] = False |
|
113 |
|
114 # If `True`, rope will remove all top-level import statements and |
|
115 # reinsert them at the top of the module when making changes. |
|
116 prefs["pull_imports_to_top"] = True |
|
117 |
|
118 # If `True`, rope will sort imports alphabetically by module name instead |
|
119 # of alphabetically by import statement, with from imports after normal |
|
120 # imports. |
|
121 prefs["sort_imports_alphabetically"] = False |
|
122 |
|
123 # Location of implementation of |
|
124 # rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general |
|
125 # case, you don't have to change this value, unless you're an rope expert. |
|
126 # Change this value to inject you own implementations of interfaces |
|
127 # listed in module rope.base.oi.type_hinting.providers.interfaces |
|
128 # For example, you can add you own providers for Django Models, or disable |
|
129 # the search type-hinting in a class hierarchy, etc. |
|
130 prefs[ |
|
131 "type_hinting_factory" |
|
132 ] = "rope.base.oi.type_hinting.factory.default_type_hinting_factory" |
|
133 |
|
134 |
|
135 def project_opened(project): |
|
136 """This function is called after opening the project""" |
|
137 # Do whatever you like here! |