rope.refactor.extract ===================== .. py:module:: rope.refactor.extract Classes ------- .. autoapisummary:: rope.refactor.extract.ExtractMethod rope.refactor.extract.ExtractVariable Module Contents --------------- .. py:class:: ExtractMethod(project, resource, start_offset, end_offset, variable=False) Bases: :py:obj:`_ExtractRefactoring` .. py:attribute:: kind :value: 'method' .. py:attribute:: allowed_kinds :value: ('function', 'method', 'staticmethod', 'classmethod') .. py:attribute:: kind_prefixes .. py:attribute:: project .. py:attribute:: resource .. py:attribute:: start_offset .. py:attribute:: end_offset .. py:method:: get_changes(extracted_name, similar=False, global_=False, kind=None) Get the changes this refactoring makes :parameters: - `extracted_name`: target name, when starts with @ - set kind to classmethod, $ - staticmethod - `similar`: if `True`, similar expressions/statements are also replaced. - `global_`: if `True`, the extracted method/variable will be global. - `kind`: kind of target refactoring to (staticmethod, classmethod) .. py:class:: ExtractVariable(*args, **kwds) Bases: :py:obj:`_ExtractRefactoring` .. py:attribute:: kind :value: 'variable' .. py:attribute:: kind_prefixes :type: Dict[str, str] .. py:attribute:: project .. py:attribute:: resource .. py:attribute:: start_offset .. py:attribute:: end_offset .. py:method:: get_changes(extracted_name, similar=False, global_=False, kind=None) Get the changes this refactoring makes :parameters: - `extracted_name`: target name, when starts with @ - set kind to classmethod, $ - staticmethod - `similar`: if `True`, similar expressions/statements are also replaced. - `global_`: if `True`, the extracted method/variable will be global. - `kind`: kind of target refactoring to (staticmethod, classmethod)