~mwhudson/pydoctor/combine-interface-implementation-docs-1223227

« back to all changes in this revision

Viewing changes to pydoctor/astbuilder.py

  • Committer: Michael Hudson-Doyle
  • Date: 2012-11-29 01:49:00 UTC
  • Revision ID: michael.hudson@linaro.org-20121129014900-5h5sj4a2n2u5dwfg
reduce duplication

Show diffs side-by-side

added added

removed removed

Lines of Context:
333
333
        obj = cls(self.system, name, docstring, self.current)
334
334
        self.system.addObject(obj)
335
335
        self.push(obj)
336
 
        # Method-level import to avoid a circular dependency.
337
 
        from pydoctor import epydoc2stan
338
 
        for attrobj in epydoc2stan.extract_fields(obj):
339
 
            self.system.addObject(attrobj)
340
336
        return obj
341
337
 
342
338
    def _pop(self, cls):
356
352
                obj.parentMod = self.currentMod
357
353
        else:
358
354
            assert obj.parentMod is None
 
355
        # Method-level import to avoid a circular dependency.
 
356
        from pydoctor import epydoc2stan
 
357
        for attrobj in epydoc2stan.extract_fields(obj):
 
358
            self.system.addObject(attrobj)
359
359
 
360
360
    def pop(self, obj):
361
361
        assert self.current is obj, "%r is not %r"%(self.current, obj)
389
389
    def processModuleAST(self, ast, mod):
390
390
        findAll(ast, mod)
391
391
        visitor.walk(ast, self.ModuleVistor(self, mod))
392
 
        from pydoctor import epydoc2stan
393
 
        for attrobj in epydoc2stan.extract_fields(mod):
394
 
            self.system.addObject(attrobj)
395
392
 
396
393
    def expandModname(self, modname, givewarning=True):
397
394
        if '.' in modname: