diff options
author | Guillaume Seguin <ixce@ed3n-m.(none)> | 2009-10-22 20:33:03 +0200 |
---|---|---|
committer | Guillaume Seguin <ixce@ed3n-m.(none)> | 2009-10-22 20:33:03 +0200 |
commit | 86834b210eb117377115b73ff62e2ee8c6ca64b9 (patch) | |
tree | 9e9d26471c10788a074e6e59c2773c55cfa8d713 | |
parent | 65fe4240fa9ed80964d2f63ad2941744bf7b5ba8 (diff) | |
download | umlpy-86834b210eb117377115b73ff62e2ee8c6ca64b9.tar.gz umlpy-86834b210eb117377115b73ff62e2ee8c6ca64b9.tar.bz2 |
Add --no-method / --no-property options
-rw-r--r-- | grapher.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -36,6 +36,12 @@ parser.add_option("--all-methods", dest = "all_methods", parser.add_option("--all-properties", dest = "all_properties", action = "store_true", default = False, help = "shows all properties") +parser.add_option("--no-method", dest = "no_method", + action = "store_true", default = False, + help = "shows no method") +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") @@ -51,6 +57,8 @@ forces = reduce (lambda x, y: x + y, prefix = options.prefix all_methods = options.all_methods all_properties = options.all_properties +no_method = options.no_method +no_property = options.no_property output = options.output print "Settings" @@ -59,6 +67,8 @@ print "Output file :", output print "Prefix :", prefix print "Show all methods :", all_methods print "Show all properties :", all_properties +print "Show no method :", no_method +print "Show no propertie :", no_property print "Excludes :", excludes print "Includes :", includes print "Forces :", forces @@ -128,6 +138,8 @@ for doc in docs: uses_dict[var_name].append (bit) for var_var in var_vars: if type (var_var.value) == epydoc.apidoc.GenericValueDoc: + if no_property: + continue epydoc.docstringparser.parse_docstring (var_var, None) if options.debug: print var_name, var_var.name, get_var_type (var_var) @@ -135,6 +147,8 @@ for doc in docs: vars_dict[var_name].append ((var_var_name, get_var_type (var_var))) elif type (var_var.value) in (epydoc.apidoc.RoutineDoc, epydoc.apidoc.StaticMethodDoc): + if no_method: + continue if (all_methods or "@doc" in str (var_var.value.docstring)) \ and not "@nodoc" in str (var_var.value.docstring): methods_dict[var_name].append (str (var_var.name)) |