Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Merlijn Wajer
Python Derivermodule
Commits
865776f1
Commit
865776f1
authored
Nov 17, 2020
by
Merlijn Wajer
Browse files
scandata: deal with single-page scandata
parent
19b0df30
Changes
1
Hide whitespace changes
Inline
Side-by-side
derivermodule/scandata.py
View file @
865776f1
...
...
@@ -75,9 +75,15 @@ def scandata_get_skip_pages(scandata):
"""
skip
=
[]
for
idx
in
range
(
len
(
scandata
[
'book'
][
'pageData'
][
'page'
])):
pages
=
scandata
[
'book'
][
'pageData'
][
'page'
]
# If there is just one page, pages is not a list.
if
not
isinstance
(
pages
,
list
):
pages
=
[
pages
]
for
idx
in
range
(
len
(
pages
)):
try
:
add_to_access_format
=
scandata
[
'book'
][
'pageData'
][
'page'
]
[
idx
][
'addToAccessFormats'
]
add_to_access_format
=
pages
[
idx
][
'addToAccessFormats'
]
if
add_to_access_format
==
'false'
:
skip
.
append
(
idx
)
except
KeyError
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment