rope.refactor.change_signature ============================== .. py:module:: rope.refactor.change_signature Classes ------- .. autoapisummary:: rope.refactor.change_signature.ChangeSignature rope.refactor.change_signature.ArgumentNormalizer rope.refactor.change_signature.ArgumentRemover rope.refactor.change_signature.ArgumentAdder rope.refactor.change_signature.ArgumentDefaultInliner rope.refactor.change_signature.ArgumentReorderer Module Contents --------------- .. py:class:: ChangeSignature(project, resource, offset) .. py:attribute:: project .. py:attribute:: resource .. py:attribute:: offset .. py:method:: get_args() Get function arguments. Return a list of ``(name, default)`` tuples for all but star and double star arguments. For arguments that don't have a default, `None` will be used. .. py:method:: is_method() .. py:method:: get_definition_info() .. py:method:: normalize() .. py:method:: remove(index) .. py:method:: add(index, name, default=None, value=None) .. py:method:: inline_default(index) .. py:method:: reorder(new_ordering) .. py:method:: get_changes(changers, in_hierarchy=False, resources=None, task_handle=taskhandle.DEFAULT_TASK_HANDLE) Get changes caused by this refactoring `changers` is a list of `_ArgumentChanger`. If `in_hierarchy` is `True` the changers are applied to all matching methods in the class hierarchy. `resources` can be a list of `rope.base.resource.File` that should be searched for occurrences; if `None` all python files in the project are searched. .. py:class:: ArgumentNormalizer Bases: :py:obj:`_ArgumentChanger` .. py:method:: change_definition_info(definition_info) .. py:method:: change_argument_mapping(definition_info, argument_mapping) .. py:class:: ArgumentRemover(index) Bases: :py:obj:`_ArgumentChanger` .. py:attribute:: index .. py:method:: change_definition_info(call_info) .. py:method:: change_argument_mapping(definition_info, mapping) .. py:class:: ArgumentAdder(index, name, default=None, value=None) Bases: :py:obj:`_ArgumentChanger` .. py:attribute:: index .. py:attribute:: name .. py:attribute:: default :value: None .. py:attribute:: value :value: None .. py:method:: change_definition_info(definition_info) .. py:method:: change_argument_mapping(definition_info, mapping) .. py:class:: ArgumentDefaultInliner(index) Bases: :py:obj:`_ArgumentChanger` .. py:attribute:: index .. py:attribute:: remove :value: False .. py:method:: change_definition_info(definition_info) .. py:method:: change_argument_mapping(definition_info, mapping) .. py:class:: ArgumentReorderer(new_order, autodef=None) Bases: :py:obj:`_ArgumentChanger` .. py:attribute:: new_order .. py:attribute:: autodef :value: None .. py:method:: change_definition_info(definition_info) .. py:method:: change_argument_mapping(definition_info, argument_mapping)