# -*- coding: ISO-8859-1 -*- # Copyright (c) 2000-2004 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. """ Output VCG diagrams. """ __revision__ = "$Id: pyvcg.py,v 1.24 2005/04/15 11:00:41 syt Exp $" from pyreverse.utils import RunHelper from pyreverse.extensions import vcgutils from pyreverse.extensions import diadefslib from logilab.common.astng.inspector import Linker # main function ################################################################ class Run(RunHelper): """command line manager""" def __init__(self): self.diadefs_h = diadefslib.DiadefsHandler() self.writer = vcgutils.VCGWriter() RunHelper.__init__(self, "parse python sources files and extract a \ class diagram readable by vcg", (self.diadefs_h, self.writer)) def do_run(self, project): """link the project and run the vcg writer""" linker = Linker(project, tag=1) diadefs = self.diadefs_h.get_diadefs(project, linker) self.writer.write(project, diadefs) if __name__ == "__main__": Run()