def execute(self, textview, sender): from editxt.commandbase import Options from editxt.wraplines import WrapLinesController, wrap_selected_lines opts = Options() ctl = WrapLinesController.shared_controller() opts.wrap_column = const.DEFAULT_RIGHT_MARGIN opts.indent = ctl.opts.indent wrap_selected_lines(textview, opts)
def test_WrapLinesController_wrap_(): m = Mocker() cmd = m.replace(wrap_selected_lines) tv = m.mock(TextView) ctl = WrapLinesController.create_with_textview(tv) cmd(tv, ctl.opts) m.method(ctl.save_options)() m.method(ctl.cancel_)(None) with m: ctl.wrap_(None)
def execute(self, textview, sender): from editxt.wraplines import WrapLinesController WrapLinesController.create_with_textview(textview).begin_sheet(sender)