projects
/
rnaseq-cwl-training.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
466c28d
)
Making the code a little more robust
author
Greg Wilson <gvwilson@third-bit.com>
Wed, 13 Jul 2016 11:19:05 +0000
(07:19 -0400)
committer
Greg Wilson <gvwilson@third-bit.com>
Wed, 13 Jul 2016 11:19:05 +0000
(07:19 -0400)
bin/extract_figures.py
patch
|
blob
|
history
diff --git
a/bin/extract_figures.py
b/bin/extract_figures.py
index 7eb55f0c405ab7dfe5a80eeb24257368c4375591..15b079eb0180712b78b2d2aa39e568bb8b784ec4 100755
(executable)
--- a/
bin/extract_figures.py
+++ b/
bin/extract_figures.py
@@
-58,7
+58,8
@@
def find_image_nodes(doc, result):
if (doc['type'] == 'img') or \
((doc['type'] == 'html_element') and (doc['value'] == 'img')):
- result.append({'alt': doc['attr']['alt'], 'src': doc['attr']['src']})
+ alt = doc['attr'].get('alt', '')
+ result.append({'alt': alt, 'src': doc['attr']['src']})
else:
for child in doc.get('children', []):
find_image_nodes(child, result)