Exemple #1
0
    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 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
Exemple #3
0
    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')
Exemple #4
0
    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')
Exemple #5
0
    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
    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