def process(self, ctx): frunner = fixer.runner(ctx) self._read(ctx, frunner) self._classify(ctx, frunner) self._extract(ctx, frunner) m = self._write(ctx, frunner) return m
def test_changes(self): class myfixer(fixer.basefixer): def pre_get_raw_manpage(self): self.mctx['foo'] = 'bar' d = {} fixer.fixerscls = [myfixer] r = fixer.runner(d) self.assertTrue('foo' not in d) r.pre_get_raw_manpage() self.assertEquals(d['foo'], 'bar')
def test_changes(self): class myfixer(fixer.basefixer): def pre_get_raw_manpage(self): self.mctx['foo'] = 'bar' d = {} fixer.fixerscls = [myfixer] r = fixer.runner(d) self.assertTrue('foo' not in d) r.pre_get_raw_manpage() self.assertEqual(d['foo'], 'bar')
def edit(self, m, paragraphs=None): ctx = self.ctx(m) frunner = fixer.runner(ctx) if paragraphs: m.paragraphs = paragraphs frunner.disable('paragraphjoiner') frunner.post_option_extraction() else: self._extract(ctx, frunner) m = self._update(ctx, frunner) return m