# 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. """ convert the class hierarchy describing the project to XMI 1.0 UML 1.3 """ __revision__ = "$Id: py2xmi_uml.py,v 1.16 2005/04/15 11:00:41 syt Exp $" import sys from xml.dom.ext import PrettyPrint from pyreverse.utils import RunHelper from logilab.common.astng.inspector import Linker from pyreverse.visitors.xmi_uml import XMIUMLVisitor class Run(RunHelper): """command line manager""" def __init__(self): self.visitor = XMIUMLVisitor() RunHelper.__init__(self, "parse python sources files and extract an \ XMI UML file from them", (self.visitor,)) def do_run(self, project): """link project and generate XMI file""" linker = Linker(project, tag=1) linker.visit(project) xmidoc = self.visitor.visit(project, linker.id_count) PrettyPrint(xmidoc, sys.stdout) if __name__ == "__main__": Run()