summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-10-23 19:13:04 +0200
committerGuillaume Seguin <guillaume@segu.in>2009-10-23 19:13:04 +0200
commit90e39cfaffc510fefdfdf264534c84f8e0483c75 (patch)
treeb1637e778bfb22ca727e2f3dea522ba242b18e5c
parent78725574208d2b3617a95f26715cf36957b245e8 (diff)
downloadumlpy-90e39cfaffc510fefdfdf264534c84f8e0483c75.tar.gz
umlpy-90e39cfaffc510fefdfdf264534c84f8e0483c75.tar.bz2
Add format selection
-rw-r--r--umlpy.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/umlpy.py b/umlpy.py
index 6ebf04d..ad4f017 100644
--- a/umlpy.py
+++ b/umlpy.py
@@ -71,8 +71,13 @@ parser.add_option("--no-property", dest = "no_property",
action = "store_true", default = False,
help = "shows no property")
parser.add_option("-o", "--output", dest = "output", action = "store",
- default = "uml.png",
help = "output file")
+parser.add_option("--png", dest = "format", action = "store_const",
+ const = "png", help = "output as png")
+parser.add_option("--pdf", dest = "format", action = "store_const",
+ const = "pdf", default = "pdf", help = "output as pdf")
+parser.add_option("--jpg", dest = "format", action = "store_const",
+ const = "jpg", help = "output as jpg")
(options, args) = parser.parse_args ()
@@ -88,6 +93,9 @@ all_properties = options.all_properties
no_method = options.no_method
no_property = options.no_property
output = options.output
+format = options.format
+if not output:
+ output = "uml." + format
print "Settings"
print "--------"
@@ -305,4 +313,4 @@ for class_name in classes:
break
gv.layout (graph, 'dot')
-gv.render (graph, 'png', output)
+gv.render (graph, format, output)