summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-10-24 15:16:58 +0200
committerGuillaume Seguin <guillaume@segu.in>2009-10-24 15:16:58 +0200
commit16c34deeb3340aeb470958e2b2278c6c703fc5d5 (patch)
treefb2cb8149f7d38714beb9e0d18dfe8907fb36f34
parent96657c777bbce773a8094c5dd718bfe201d05330 (diff)
downloadumlpy-16c34deeb3340aeb470958e2b2278c6c703fc5d5.tar.gz
umlpy-16c34deeb3340aeb470958e2b2278c6c703fc5d5.tar.bz2
Update documentationHEADmaster
-rw-r--r--README6
-rwxr-xr-xumlpy.py19
2 files changed, 17 insertions, 8 deletions
diff --git a/README b/README
index 80428ce..52fe076 100644
--- a/README
+++ b/README
@@ -3,8 +3,8 @@ Python source files. It uses graphviz Python bindings and the dot layout for
graph generation and epydoc internals for source introspection.
The most basic usage of this software is to simply pass it the name of the
-modules you want to graph (you obviously need to be in the right directory) :
- $ python umlpy.py mysource.py mymodule
+modules you want to graph (which have to be in your PythonPath) :
+ $ python umlpy.py mymodule mypackage
The result will be written to the uml.pdf file by default. The output filename
can be modified using the -o (or --output) option. The output format is set
using one of the --png, --pdf and --jpg options.
@@ -31,7 +31,7 @@ symmetric options are used (that is, using --all-methods together with
The example.py distributed with this software shows how to correctly use the
docstrings. The example.png file shows the corresponding output, which was
produced by running
- $ python umlpy.py --png -o example.png -p "example."
+ $ python umlpy.py --png -o example.png -p "example." example
The umlpy.png file shows the software output for its own source file.
diff --git a/umlpy.py b/umlpy.py
index 3ac4436..20688c1 100755
--- a/umlpy.py
+++ b/umlpy.py
@@ -38,26 +38,27 @@ import re
from optparse import OptionParser
-parser = OptionParser ()
+usage = "usage: %prog [options] module ..."
+parser = OptionParser (usage = usage)
parser.add_option("-v", dest = "debug", action = "store_true",
default = False,
help = "enables debug output")
parser.add_option("-e", "--exclude", dest = "excludes", action = "append",
default = [],
help = "classes matching this regexp will be excluded \
- from display")
+from display")
parser.add_option("-i", "--include", dest = "includes", action = "append",
default = [],
help = "classes matching this regexp will be included \
- in display even if they were excluded by exclude \
- regexps")
+in display even if they were excluded by exclude \
+regexps")
parser.add_option("-p", "--prefix", dest = "prefix", action = "store",
default = "",
help = "prefix which will be stripped of class names")
parser.add_option("-f", "--force", dest = "forces", action = "append",
default = [],
help = "classes matching this regexp will be forced into \
- display")
+display")
parser.add_option("--all-methods", dest = "all_methods",
action = "store_true", default = False,
help = "shows all methods")
@@ -497,4 +498,12 @@ class UmlPy (object):
if __name__ == "__main__":
(options, args) = parser.parse_args ()
+ if not args:
+ parser.error ("please specify at least one module")
+ if options.all_methods and options.no_method:
+ parser.error ("options --all-methods and --no-method are \
+mutually exclusive")
+ if options.all_properties and options.no_property:
+ parser.error ("options --all-properties and --no-property are \
+mutually exclusive")
UmlPy (args, options)