diff --git a/changelog.md b/changelog.md index ec281b1..f13c478 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,13 @@ # Changelog +## [1.2.8] - 24 August 2020 + +### Added + +- mglib.exceptions module introduced + + ## [1.2.7] - 17 August 2020 ### Changed diff --git a/mglib/exceptions.py b/mglib/exceptions.py new file mode 100644 index 0000000..0502e59 --- /dev/null +++ b/mglib/exceptions.py @@ -0,0 +1,8 @@ +""" +Global mglib exception and warning classes. +""" + + +class FileTypeNotSupported(Exception): + """File type not supported""" + pass diff --git a/mglib/pdfinfo.py b/mglib/pdfinfo.py index 7aba959..6e2f4a8 100644 --- a/mglib/pdfinfo.py +++ b/mglib/pdfinfo.py @@ -4,6 +4,7 @@ import subprocess import logging from .conf import settings +from .exceptions import FileTypeNotSupported """ Uses command line pdfinfo utility (from poppler pakage) for various @@ -74,7 +75,7 @@ def get_pagecount(filepath): return get_tiff_pagecount(filepath) if ext and ext.lower() not in ('.pdf', '.tiff'): - raise ValueError( + raise FileTypeNotSupported( "Only jpeg, png, pdf and tiff are handlerd by this" " method" ) diff --git a/setup.py b/setup.py index 3c0410a..75f2e21 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open("README.md", "r") as fh: setup( name="mglib", - version="1.2.7", + version="1.2.8", author="Eugen Ciur", author_email="eugen@papermerge.com", url="https://github.com/papermerge/mglib",