|
|
|
@ -18,7 +18,8 @@ with open(bookmarks_filename) as bookmarks_file:
|
|
|
|
|
# Offset page numbers |
|
|
|
|
def replaceBookmarkPageNumber(match): |
|
|
|
|
initial_page = int(match.group(1)) |
|
|
|
|
return 'BookmarkPageNumber: ' + str(initial_page + 2) |
|
|
|
|
final_page = initial_page + 2 if initial_page > 1 else initial_page |
|
|
|
|
return 'BookmarkPageNumber: ' + str(final_page) |
|
|
|
|
metadata = re.sub('BookmarkPageNumber:\s+([0-9]+)', replaceBookmarkPageNumber, metadata) |
|
|
|
|
|
|
|
|
|
with open(bookmarks_filename, 'w') as bookmarks_file: |
|
|
|
|