] > Blog entries december 2008 [2]
The view full_list could not be found

Blog entries december 2008 [2]

hgview 0.10.0

2008/12/30 by Graziella Toutoungis

I have the pleasure of announcing that the version hgview 0.10.0 was posted on this site and is available for downloading. In this version we added some new functionalities like :

  • The possibility to order all revisions by date or author or description.....
  • Support for localtime.
  • Improve the message header when hg mv is used and fix the author base color
  • Integration of bboissin's fixes
http://www.selenic.com/hg-logo/logo-droplets-50.png

Finally : We have taken into account older versions. As pointed out by some users, mercurial version 1.1.x wasn't working very well with hgview, so we created patches which have to be applied according to the version of mercurial you are using.


Pyreverse : UML Diagrams for Python

2008/12/23 by Emile Anclin

Pyreverse analyses Python code and extracts UML class diagrams and package depenndencies. Since september 2008 it has been integrated with Pylint (0.15).

Introduction

Pyreverse builds a diagram representation of the source code with:
  • class attributes, if possible with their type
  • class methods
  • inheritance links between classes
  • association links between classes
  • representation of Exceptions and Interfaces

Generation of UML diagrams with Pyreverse

The command pyreverse generates the diagrams in all formats that graphviz/dot knows, or in VCG :

The following command shows what dot knows:

$ dot -Txxx
Format: "xxx" not recognized. Use one of: canon cmap cmapx cmapx_np dia dot
eps fig gd gd2 gif hpgl imap imap_np ismap jpe jpeg jpg mif mp pcl pdf pic
plain plain-ext png ps ps2 svg svgz tk vml vmlz vrml vtx wbmp xdot xlib

pyreverse creates by default two diagrams:

$ pyreverse -o png -p Pyreverse pylint/pyreverse/
[...]
creating diagram packages_Pyreverse.png
creating diagram classes_Pyreverse.png
  • -o : sets the output format
  • -p name : yields the output files packages_name.png and classes_name.png

Options

One can modify the output with following options:

-a N, -A    depth of research for ancestors
-s N, -S    depth of research for associated classes
-A, -S      all ancestors, resp. all associated
-m[yn]      add or remove the module name
-f MOD      filter the attributes : PUB_ONLY/SPECIAL/OTHER/ALL
-k          show only the classes (no attributes and methods)
-b          show 'builtin' objects

Examples:

General Vue on a Module

pyreverse -ASmy -k -o png pyreverse/main.py -p Main
[image : classes_Main.png, class diagram with all dependencies]

full size image

With these options you can have a quick vue of the dependencies without being lost in endless lists of methods and attributes.

Detailed Vue on a Module

pyreverse -c PyreverseCommand -a1 -s1 -f ALL -o png  pyreverse/main.py
[image : PyreverseCommand.png, pyreverse.diagram.ClassDiagram class diagram with one dependency level]

module in full size image

Show all methods and attributes of the class (-f ALL). By default, the class diagram option -c uses the options -A, -S, -my, but here we desactivate them to get a reasonably small image.

Configuration File

You can put some options into the file ".pyreverserc" in your home directory.

Exemple:

--filter-mode=PUB_ONLY --ignore doc --ignore test
This will exclude documentation and test files in the doc and test directories. Also, we will see only "public" methods.