mirror of https://github.com/papermerge/mglib
parent
0158fb8295
commit
e19169b886
|
@ -1,6 +1,13 @@
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.2.8] - 24 August 2020
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- mglib.exceptions module introduced
|
||||||
|
|
||||||
|
|
||||||
## [1.2.7] - 17 August 2020
|
## [1.2.7] - 17 August 2020
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
"""
|
||||||
|
Global mglib exception and warning classes.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class FileTypeNotSupported(Exception):
|
||||||
|
"""File type not supported"""
|
||||||
|
pass
|
|
@ -4,6 +4,7 @@ import subprocess
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from .conf import settings
|
from .conf import settings
|
||||||
|
from .exceptions import FileTypeNotSupported
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Uses command line pdfinfo utility (from poppler pakage) for various
|
Uses command line pdfinfo utility (from poppler pakage) for various
|
||||||
|
@ -74,7 +75,7 @@ def get_pagecount(filepath):
|
||||||
return get_tiff_pagecount(filepath)
|
return get_tiff_pagecount(filepath)
|
||||||
|
|
||||||
if ext and ext.lower() not in ('.pdf', '.tiff'):
|
if ext and ext.lower() not in ('.pdf', '.tiff'):
|
||||||
raise ValueError(
|
raise FileTypeNotSupported(
|
||||||
"Only jpeg, png, pdf and tiff are handlerd by this"
|
"Only jpeg, png, pdf and tiff are handlerd by this"
|
||||||
" method"
|
" method"
|
||||||
)
|
)
|
||||||
|
|
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.2.7",
|
version="1.2.8",
|
||||||
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