CenterForOpenScience / pydocx

An extendable docx file format parser and converter
Other
183 stars 55 forks source link

Rect tag needs `get_style` method. #218

Closed jlward closed 8 years ago

jlward commented 8 years ago
 File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 218, in export_node
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 127, in apply
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 252, in yield_nested
    for result in func(item):
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 218, in export_node
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 591, in export_table_cell
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 127, in apply
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 267, in yield_nested_with_line_breaks_between_paragraphs
    for result in func(item):
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 218, in export_node
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 278, in export_paragraph
    results = is_not_empty_and_not_only_whitespace(results)
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 78, in is_not_empty_and_not_only_whitespace
    for item in gen:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 252, in yield_nested
    for result in func(item):
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 218, in export_node
    for result in results:
  File "/opt/pstat/versions/20160523-170546/pstat/core/import_translation/translation.py", line 251, in export_run
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 252, in yield_nested
    for result in func(item):
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 218, in export_node
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 252, in yield_nested
    for result in func(item):
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 218, in export_node
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 252, in yield_nested
    for result in func(item):
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 218, in export_node
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 666, in export_vml_image_data
    width, height = image_data.get_picture_extents()
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/openxml/vml/image_data.py", line 21, in get_picture_extents
    style = self.parent.get_style()
AttributeError: 'Rect' object has no attribute 'get_style'
kylegibson commented 8 years ago

This looks good, although I am -0 on testing this via the document builder using an XML template. IMO we should be testing this like we do here: https://github.com/CenterForOpenScience/pydocx/blob/master/tests/openxml/vml/test_shape.py.

jlward commented 8 years ago

This looks good, although I am -0 on testing this via the document builder using an XML template. IMO we should be testing this like we do here: https://github.com/CenterForOpenScience/pydocx/blob/master/tests/openxml/vml/test_shape.py.

The only reason I added the test where I did was because I added an assert 0 the the shapes get_style method and only the document builder tests failed. Since the DXB stuff is already built, I'm just going to leave it.