mirror of https://github.com/papermerge/mglib
minor api interface change
parent
f1ddc389dc
commit
d95b768e76
|
@ -244,7 +244,12 @@ class Storage:
|
||||||
|
|
||||||
return doc_path.version + 1
|
return doc_path.version + 1
|
||||||
|
|
||||||
def delete_pages(self, doc_path, page_numbers, total_page_count=None):
|
def delete_pages(
|
||||||
|
self,
|
||||||
|
doc_path,
|
||||||
|
page_numbers,
|
||||||
|
skip_migration=False
|
||||||
|
):
|
||||||
"""
|
"""
|
||||||
Delets pages in the document pointed by doc_path.
|
Delets pages in the document pointed by doc_path.
|
||||||
doc_path is an instance of mglib.path.DocumentPath
|
doc_path is an instance of mglib.path.DocumentPath
|
||||||
|
@ -270,10 +275,11 @@ class Storage:
|
||||||
page_numbers
|
page_numbers
|
||||||
)
|
)
|
||||||
|
|
||||||
if total_page_count:
|
if skip_migration:
|
||||||
page_count = total_page_count
|
return doc_path.version + 1
|
||||||
else:
|
|
||||||
page_count = self.get_pagecount(doc_path)
|
page_count = self.get_pagecount(doc_path)
|
||||||
|
|
||||||
if len(page_numbers) > page_count:
|
if len(page_numbers) > page_count:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"deleted_pages({page_numbers}) > page_count({page_count})"
|
f"deleted_pages({page_numbers}) > page_count({page_count})"
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -6,7 +6,7 @@ with open("README.md", "r") as fh:
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="mglib",
|
name="mglib",
|
||||||
version="1.0.3",
|
version="1.0.4",
|
||||||
author="Eugen Ciur",
|
author="Eugen Ciur",
|
||||||
author_email="eugen@papermerge.com",
|
author_email="eugen@papermerge.com",
|
||||||
url="https://github.com/papermerge/mglib",
|
url="https://github.com/papermerge/mglib",
|
||||||
|
|
Loading…
Reference in New Issue