rope.base.prefs =============== .. py:module:: rope.base.prefs .. autoapi-nested-parse:: Rope preferences. Attributes ---------- .. autoapisummary:: rope.base.prefs.DEFAULT_IMPORT_STYLE Classes ------- .. autoapisummary:: rope.base.prefs.AutoimportPrefs rope.base.prefs.ImportPrefs rope.base.prefs.Prefs rope.base.prefs.ImportStyle Functions --------- .. autoapisummary:: rope.base.prefs.get_config rope.base.prefs.get_preferred_import_style Module Contents --------------- .. py:class:: AutoimportPrefs .. py:attribute:: aliases :type: List[Tuple[str, str]] .. py:class:: ImportPrefs .. py:attribute:: preferred_import_style :type: str .. py:class:: Prefs Class to store rope preferences. .. py:attribute:: ignored_resources :type: List[str] .. py:attribute:: python_files :type: List[str] .. py:attribute:: source_folders :type: List[str] .. py:attribute:: python_path :type: List[str] .. py:attribute:: save_objectdb :type: bool .. py:attribute:: compress_objectdb :type: bool .. py:attribute:: automatic_soa :type: bool .. py:attribute:: soa_followed_calls :type: int .. py:attribute:: perform_doa :type: bool .. py:attribute:: validate_objectdb :type: bool .. py:attribute:: max_history_items :type: int .. py:attribute:: save_history :type: bool .. py:attribute:: compress_history :type: bool .. py:attribute:: indent_size :type: int .. py:attribute:: extension_modules :type: List[str] .. py:attribute:: import_dynload_stdmods :type: bool .. py:attribute:: ignore_syntax_errors :type: bool .. py:attribute:: ignore_bad_imports :type: bool .. py:attribute:: prefer_module_from_imports :type: bool .. py:attribute:: split_imports :type: bool .. py:attribute:: pull_imports_to_top :type: bool .. py:attribute:: sort_imports_alphabetically :type: bool .. py:attribute:: type_hinting_factory :type: str .. py:attribute:: project_opened :type: Optional[Callable] .. py:attribute:: py_version :type: Optional[Tuple[int, int]] .. py:attribute:: dependencies :type: Optional[List[packaging.requirements.Requirement]] .. py:attribute:: callbacks :type: Dict[str, Callable[[Any], None]] .. py:attribute:: autoimport :type: AutoimportPrefs .. py:attribute:: imports :type: ImportPrefs .. py:method:: set(key: str, value: Any) Set the value of `key` preference to `value`. .. py:method:: add(key: str, value: Any) Add an entry to a list preference Add `value` to the list of entries for the `key` preference. .. py:method:: get(key: str, default: Any = None) Get the value of the key preference .. py:method:: add_callback(key: str, callback: Callable) Add `key` preference with `callback` function Whenever `key` is set the callback is called with the given `value` as parameter. .. py:function:: get_config(root: rope.base.resources.Folder, ropefolder: rope.base.resources.Folder) -> pytoolconfig.PyToolConfig .. py:class:: ImportStyle(*args, **kwds) Bases: :py:obj:`enum.Enum` Create a collection of name/value pairs. Example enumeration: >>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3 Access them by: - attribute access:: >>> Color.RED - value lookup: >>> Color(1) - name lookup: >>> Color['RED'] Enumerations can be iterated over, and know how many members they have: >>> len(Color) 3 >>> list(Color) [, , ] Methods can be added to enumerations, and members can have their own attributes -- see the documentation for details. .. py:attribute:: normal_import :value: 'normal-import' .. py:attribute:: from_module :value: 'from-module' .. py:attribute:: from_global :value: 'from-global' .. py:data:: DEFAULT_IMPORT_STYLE .. py:function:: get_preferred_import_style(prefs: Prefs) -> ImportStyle