Commits

Takeshi Komiya  committed 2d6ef58

* Clear default_shape on DiagramNode#clear()

  • Participants
  • Parent commits c494fe8
  • Tags 0.7.2

Comments (0)

Files changed (3)

File src/blockdiag/elements.py

     default_shape = 'box'
 
     @classmethod
-    def set_default_shape(klass, shape):
-        klass.default_shape = shape
+    def set_default_shape(cls, shape):
+        cls.default_shape = shape
+
+    @classmethod
+    def clear(cls):
+        cls.namespace = {}
+        cls.default_shape = 'box'
 
     def __init__(self, id):
         super(DiagramNode, self).__init__(id)

File src/blockdiag/tests/diagrams/diagram_attributes.diag

   span_width = 32;
   span_height = 32;
   fontsize = 16;
+  default_shape = 'diamond'
 
   A;
 }

File src/blockdiag/tests/test_parser.py

 def test_diagram_attributes():
     screen = __build_diagram('diagram_attributes.diag')
 
-    print screen.node_width
     assert screen.node_width == 160
     assert screen.node_height == 160
     assert screen.span_width == 32
     assert screen.span_height == 32
     assert screen.fontsize == 16
+    assert screen.nodes[0].shape == 'diamond'
 
 
 def test_single_node_diagram():