astraw / svg_stack

concatenate SVG files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'NoneType' object has no attribute 'endswith'

thierryjanssens opened this issue · comments

Hi,

I run into the following error when I want to concatenate a bunch of svg files as follows

svg_stack.py --direction=v --margin=100 Figure\ S1.svg Figure\ S2.svg Figure\ S3.svg Figure\ S4.svg Figure\ S5.svg Figure\ S6.svg Figure\ S7.svg Figure\ S8.svg Figure\ S9.svg Figure\ S10.svg Figure\ S11.svg Figure\ S12.svg Figure\ S13.svg Figure\ S14 Figure\ S15.svg Figure\ S16 > Figures_SI.svg
Traceback (most recent call last):
File "/home/.conda/envs/svg/bin/svg_stack.py", line 713, in
main()
File "/home/.conda/envs/svg/bin/svg_stack.py", line 706, in main
layout.addSVG(fname,alignment=AlignCenter)
File "/home/janssetk/.conda/envs/svg/bin/svg_stack.py", line 632, in addSVG
svg_file = SVGFile(svg_file)
File "/home/.conda/envs/svg/bin/svg_stack.py", line 181, in init
height, height_units = get_unit_attr(self._root.get('height'))
File "/home/.conda/envs/svg/bin/svg_stack.py", line 44, in get_unit_attr
if value.endswith(unit_name):
AttributeError: 'NoneType' object has no attribute 'endswith'

(Apologies for my delay.)

I think this may have been fixed by #14. Can you check this by running on the current main branch?