blockdiag / blockdiag-contrib

4 stars 1 forks source link

background かつresizableな数式のエラーのバグ #1

Open tk0miya opened 6 years ago

tk0miya commented 6 years ago

自分の普段使っているのとは違う環境で試したところ,おかしな挙動があったので報告します.

backgroundで数式を定義した上でresizableTrueにした場合,おかしなエラーを吐きました. 理由がよく分からなかったので,状況だけ伝えます.

blockdiag{
    plugin math;
    B[label="", background="math://def", resizable=True];
}

とした場合,blockdiagは

WARNING: background = "math://..." is deprecated. use label attribute.
WARNING: background = "math://..." is deprecated. use label attribute.
ERROR: close

とエラーを吐きます. Warningが二回も来ているのと,よく分からないcloseというエラーが来ているのが問題だと思います. --debug オプションをつけて実行してみると

WARNING: background = "math://..." is deprecated. use label attribute.
WARNING: background = "math://..." is deprecated. use label attribute.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/utils/bootstrap.py", line 39, in run
    return self.build_diagram(parsed)
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/command.py", line 42, in build_diagram
    return super(BlockdiagApp, self).build_diagram(tree)
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/utils/bootstrap.py", line 75, in build_diagram
    diagram = ScreenNodeBuilder.build(tree)  # old interface
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/builder.py", line 613, in build
    return cls(tree, config, layout).run()
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/builder.py", line 616, in __init__
    self.diagram = DiagramTreeBuilder().build(tree, config)
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/builder.py", line 33, in build
    self.fire_node_event('build_finished')
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/builder.py", line 39, in fire_node_event
    fire_node_event(node, event_type)
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/plugins/__init__.py", line 52, in fire_node_event
    return all(handler.fire(name, node, *args) for handler in node_handlers)
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/plugins/__init__.py", line 52, in <genexpr>
    return all(handler.fire(name, node, *args) for handler in node_handlers)
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/plugins/__init__.py", line 61, in fire
    return getattr(self, "on_" + name)(*args)
  File "/home/yuki/WorkSpace/blockdiag-contrib/math/blockdiagcontrib/math.py", line 198, in on_build_finished
    node.width, node.height = get_image_size(node.background.name)
  File "/usr/local/lib/python2.7/dist-packages/blockdiag-1.4.5-py2.7.egg/blockdiag/utils/images.py", line 48, in get_image_size
    image.close()
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 528, in __getattr__
    raise AttributeError(name)
AttributeError: close

というエラーが来ます.


tk0miya commented 6 years ago

From Radek Marik on 2014-04-02 08:02:40+00:00

The issue should be treated more general. The current implementation seems to follow a kind of 'stack-based' assignments of method calls and returns. I have not found any way how to specify what instance activation a given method call should be linked to. GraphViz uses a notion of ports. What about to extend the syntax in similar way, i.e. to enable a use of activity labels extending instance labels? For example: { A -> C:0; B -> C:1; A <-- C:0; B <-- C:1; } For example, this would enable to diagram a number of threads under one instance (like HTTP pipelining, etc in my case :-)).

tk0miya commented 6 years ago

From Takeshi KOMIYA on 2014-10-28 04:14:50+00:00

Thank you for notice. I forgetten about interactive shell.

I just update it.

tk0miya commented 6 years ago

From anatoly techtonik on 2014-10-28 08:42:03+00:00

That's the most useful site for many things out there. =) It only needs a drag and drop editor with options to color things, change fonts etc. I thought I could patch it, but could get past this buildout thing. I am more familiar with Fabric than with Buildout. Not sure that JavaScript guys could get it.

I used it recently to describe the Fedora packaging process.

tk0miya commented 6 years ago

From Takeshi KOMIYA on 2014-10-28 09:10:57+00:00

I agree with you. buildout was once a good helper for appengine, but now, it brings troubles and confusion. I feel updating appengine apps is a troublesome job.

so I want to replace the envrionment to other platform (including appengine with docker). but I don't have time to do it now...