v1.3.12
This commit is contained in:
1 parent
36a9371657
commit
152d3aaf55
13 files changed
+34
-11
No files matched your search
+12
-6
@@ -4,10 +4,16 @@ WK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd $WK_DIR
|
||||
cd ..
|
||||
|
||||
for filename in ./tests/test*.py; do
|
||||
if python $filename ; then
|
||||
echo woohoo
|
||||
else
|
||||
# for filename in ./tests/test*.py; do
|
||||
# if python $filename ; then
|
||||
# echo woohoo
|
||||
# else
|
||||
# exit 1
|
||||
# fi
|
||||
# done
|
||||
|
||||
if python ./test.py ; then
|
||||
echo "PASSED TESTS"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -97,7 +97,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
"""
|
||||
__version__ = (1, 3, 10)
|
||||
__version__ = (1, 3, 11)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(
|
||||
|
||||
@@ -22,6 +22,7 @@ def convert_file(
|
||||
check_extractable: bool = True,
|
||||
pagenos: Optional[List[int]] = None,
|
||||
dont_export_images: bool = False,
|
||||
ignore_bad_chars: bool = False,
|
||||
debug_level: int = logging.WARNING,
|
||||
out_type: str = 'html',
|
||||
):
|
||||
@@ -45,6 +46,7 @@ def convert_file(
|
||||
password=password,
|
||||
caching=caching,
|
||||
check_extractable=check_extractable,
|
||||
ignore_bad_chars=ignore_bad_chars,
|
||||
pagenos=pagenos,
|
||||
debug_level=debug_level,
|
||||
)
|
||||
@@ -59,6 +61,7 @@ def convert_file(
|
||||
caching=caching,
|
||||
check_extractable=check_extractable,
|
||||
pagenos=pagenos,
|
||||
ignore_bad_chars=ignore_bad_chars,
|
||||
dont_export_images=dont_export_images,
|
||||
debug_level=debug_level,
|
||||
)
|
||||
@@ -73,6 +76,7 @@ def convert_file(
|
||||
caching=caching,
|
||||
check_extractable=check_extractable,
|
||||
pagenos=pagenos,
|
||||
ignore_bad_chars=ignore_bad_chars,
|
||||
dont_export_images=dont_export_images,
|
||||
debug_level=debug_level,
|
||||
)
|
||||
@@ -87,6 +91,7 @@ def convert_file(
|
||||
caching=caching,
|
||||
check_extractable=check_extractable,
|
||||
pagenos=pagenos,
|
||||
ignore_bad_chars=ignore_bad_chars,
|
||||
dont_export_images=dont_export_images,
|
||||
debug_level=debug_level,
|
||||
)
|
||||
@@ -101,6 +106,7 @@ def convert_file(
|
||||
caching=caching,
|
||||
check_extractable=check_extractable,
|
||||
pagenos=pagenos,
|
||||
ignore_bad_chars=ignore_bad_chars,
|
||||
dont_export_images=dont_export_images,
|
||||
debug_level=debug_level,
|
||||
)
|
||||
|
||||
@@ -16,6 +16,7 @@ def convert_to_html(
|
||||
maxpages: int = 0,
|
||||
password: Optional[str] = None,
|
||||
caching: bool = True,
|
||||
ignore_bad_chars: bool = False,
|
||||
check_extractable: bool = True,
|
||||
pagenos: List[int] = None,
|
||||
debug_level: int = logging.WARNING,
|
||||
@@ -25,6 +26,7 @@ def convert_to_html(
|
||||
password=password,
|
||||
caching=caching,
|
||||
check_extractable=check_extractable,
|
||||
ignore_bad_chars=ignore_bad_chars,
|
||||
pagenos=pagenos,
|
||||
debug_level=debug_level
|
||||
)
|
||||
|
||||
@@ -28,6 +28,7 @@ def convert_to_json(
|
||||
password: str = Optional[None],
|
||||
caching: bool = True,
|
||||
check_extractable: bool = True,
|
||||
ignore_bad_chars: bool = False,
|
||||
pagenos: Optional[List[int]] = None,
|
||||
debug_level: int = logging.WARNING,
|
||||
):
|
||||
@@ -36,6 +37,7 @@ def convert_to_json(
|
||||
password=password,
|
||||
caching=caching,
|
||||
check_extractable=check_extractable,
|
||||
ignore_bad_chars=ignore_bad_chars,
|
||||
pagenos=pagenos,
|
||||
debug_level=debug_level
|
||||
)
|
||||
|
||||
@@ -14,6 +14,7 @@ def convert_to_text(
|
||||
password: str = None,
|
||||
caching: bool = True,
|
||||
check_extractable: bool = True,
|
||||
ignore_bad_chars: bool = False,
|
||||
pagenos: List[int] = None,
|
||||
debug_level: int = logging.WARNING,
|
||||
):
|
||||
@@ -22,6 +23,7 @@ def convert_to_text(
|
||||
password=password,
|
||||
caching=caching,
|
||||
check_extractable=check_extractable,
|
||||
ignore_bad_chars=ignore_bad_chars,
|
||||
pagenos=pagenos,
|
||||
debug_level=debug_level
|
||||
)
|
||||
|
||||
@@ -45,6 +45,7 @@ def convert_to_xml(
|
||||
maxpages: int = 0,
|
||||
password: str = None,
|
||||
caching: bool = True,
|
||||
ignore_bad_chars: bool = False,
|
||||
check_extractable: bool = True,
|
||||
pagenos: List[int] = None,
|
||||
debug_level: int = logging.WARNING,
|
||||
@@ -54,6 +55,7 @@ def convert_to_xml(
|
||||
password=password,
|
||||
caching=caching,
|
||||
check_extractable=check_extractable,
|
||||
ignore_bad_chars=ignore_bad_chars,
|
||||
pagenos=pagenos,
|
||||
debug_level=debug_level
|
||||
)
|
||||
|
||||
@@ -28,6 +28,7 @@ def convert_to_yaml(
|
||||
password: str = None,
|
||||
caching: bool = True,
|
||||
check_extractable: bool = True,
|
||||
ignore_bad_chars: bool = False,
|
||||
pagenos: List[int] = None,
|
||||
debug_level: int = logging.WARNING,
|
||||
):
|
||||
@@ -36,6 +37,7 @@ def convert_to_yaml(
|
||||
password=password,
|
||||
caching=caching,
|
||||
check_extractable=check_extractable,
|
||||
ignore_bad_chars=ignore_bad_chars,
|
||||
pagenos=pagenos,
|
||||
debug_level=debug_level
|
||||
)
|
||||
|
||||
@@ -10,7 +10,7 @@ import sys
|
||||
with open('README.md') as readme_file:
|
||||
SETUP = {
|
||||
"name": "pdfmajor",
|
||||
"version": "1.3.10",
|
||||
"version": "1.3.12",
|
||||
"packages": find_packages(include=['pdfmajor*']),
|
||||
"install_requires": [
|
||||
'pycryptodome==3.8.2',
|
||||
|
||||
@@ -14,7 +14,7 @@ NUM_LOOPS = 10
|
||||
|
||||
def count_elms(file_path: str):
|
||||
count = 0
|
||||
for page in PDFInterpreter(file_path):
|
||||
for page in PDFInterpreter(file_path, ignore_bad_chars=True):
|
||||
for item in page:
|
||||
if isinstance(item, LTContainer):
|
||||
count += len([*item])
|
||||
|
||||
@@ -42,6 +42,7 @@ class ConversionTest(TestCase):
|
||||
input_file=input_file_path,
|
||||
output_file=output_file_path,
|
||||
out_type=ext,
|
||||
ignore_bad_chars=True,
|
||||
debug_level=logging.WARN,
|
||||
)
|
||||
if ext == 'xml':
|
||||
|
||||
@@ -16,7 +16,7 @@ class TestInterpreter(TestCase):
|
||||
for file_name in FILES:
|
||||
self.subTest(file_name=file_name)
|
||||
file_path = os.path.join(INPUT_FOLDER, file_name)
|
||||
for page in PDFInterpreter(file_path, debug_level=logging.ERROR):
|
||||
for page in PDFInterpreter(file_path, debug_level=logging.ERROR, ignore_bad_chars=True):
|
||||
self.assertTrue( isinstance(page, PageInterpreter) )
|
||||
for item in page:
|
||||
self.assertTrue( isinstance(item, LTItem) )
|
||||
|
||||
Reference in new issue
Block a user