GraphvizParser

Changeset

14:e32df1f28c44
2012-04-19 Paul Boddie raw files shortlog changelog graph Since an existing graph may cause the dictionary of graph attributes to have a width and height of None (the value given to a non-matching regular expression group when looking for appropriate attachment filenames), the test for dimensions needs to reject such present but "false" attributes.
parsers/graphviz.py (file)
     1.1 --- a/parsers/graphviz.py	Thu Mar 22 23:11:54 2012 +0100
     1.2 +++ b/parsers/graphviz.py	Thu Apr 19 00:48:46 2012 +0200
     1.3 @@ -303,7 +303,7 @@
     1.4  
     1.5          "Return a (width, height) tuple using the 'attrs' dictionary."
     1.6  
     1.7 -        if attrs and attrs.has_key("width") and attrs.has_key("height"):
     1.8 +        if attrs and attrs.get("width") and attrs.get("height"):
     1.9              return attrs["width"], attrs["height"]
    1.10          else:
    1.11              return None