Ejemplo n.º 1
0
 def writeSummaryPages(self, system: model.System) -> None:
     import time
     for pclass in summary.summarypages:
         system.msg('html',
                    'starting ' + pclass.__name__ + ' ...',
                    nonl=True)
         T = time.time()
         page = pclass(system=system, template_lookup=self.template_lookup)
         with self.base.joinpath(pclass.filename).open('wb') as fobj:
             flattenToFile(fobj, page)
         system.msg('html', "took %fs" % (time.time() - T), wantsnl=False)
Ejemplo n.º 2
0
def namesInterface(system: model.System, name: str) -> bool:
    if interface_prog.match(name):
        return True
    obj = system.objForFullName(name)
    if not isinstance(obj, ZopeInterfaceClass):
        return False
    return obj.isinterface
Ejemplo n.º 3
0
def findRootClasses(
        system: model.System
        ) -> Sequence[Tuple[str, Union[model.Class, Sequence[model.Class]]]]:
    roots: Dict[str, Union[model.Class, List[model.Class]]] = {}
    for cls in system.objectsOfType(model.Class):
        if ' ' in cls.name or not cls.isVisible:
            continue
        if cls.bases:
            for n, b in zip(cls.bases, cls.baseobjects):
                if b is None or not b.isVisible:
                    cast(List[model.Class], roots.setdefault(n, [])).append(cls)
                elif b.system is not system:
                    roots[b.fullName()] = b
        else:
            roots[cls.fullName()] = cls
    return sorted(roots.items(), key=lambda x:x[0].lower())