From 706433c5049c63c6e16fee5f71d81a7e507abe06 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Sat, 10 Jun 2023 22:19:22 +0200 Subject: [PATCH 1/3] Revert "Merge pull request #97 from qurator-spk/420-namespace-package" This reverts commit fd56b86acf55677dc7a8bfb9e2737c3cc167327a, reversing changes made to ea792d1e4ac4a722770b82dc91e71f84d5beb212. --- qurator/__init__.py | 1 + setup.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qurator/__init__.py b/qurator/__init__.py index e69de29..5284146 100644 --- a/qurator/__init__.py +++ b/qurator/__init__.py @@ -0,0 +1 @@ +__import__("pkg_resources").declare_namespace(__name__) diff --git a/setup.py b/setup.py index 807eae7..9abf158 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import find_namespace_packages, find_packages, setup +from setuptools import setup, find_packages from json import load install_requires = open('requirements.txt').read().split('\n') @@ -13,6 +13,7 @@ setup( author='Vahid Rezanezhad', url='https://github.com/qurator-spk/eynollah', license='Apache License 2.0', + namespace_packages=['qurator'], packages=find_packages(exclude=['tests']), install_requires=install_requires, package_data={ From dbabe0f180942ecbb4e5c52fb947b06b786bc7e4 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Fri, 19 Jan 2024 16:17:02 +0000 Subject: [PATCH 2/3] adapt to ocrd>=2.54 url vs local_filename --- qurator/eynollah/processor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qurator/eynollah/processor.py b/qurator/eynollah/processor.py index ccec456..3375113 100644 --- a/qurator/eynollah/processor.py +++ b/qurator/eynollah/processor.py @@ -42,7 +42,11 @@ class EynollahProcessor(Processor): page = pcgts.get_Page() # XXX loses DPI information # page_image, _, _ = self.workspace.image_from_page(page, page_id, feature_filter='binarized') - image_filename = self.workspace.download_file(next(self.workspace.mets.find_files(url=page.imageFilename))).local_filename + if not('://' in page.imageFilename): + image_filename = next(self.workspace.mets.find_files(local_filename=page.imageFilename)).local_filename + else: + # could be a URL with file:// or truly remote + image_filename = self.workspace.download_file(next(self.workspace.mets.find_files(url=page.imageFilename))).local_filename eynollah_kwargs = { 'dir_models': self.resolve_resource(self.parameter['models']), 'allow_enhancement': False, From 032a99ef11b19d8cb97566a2ce086878544991a0 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky <38561704+bertsky@users.noreply.github.com> Date: Wed, 24 Jan 2024 19:33:49 +0100 Subject: [PATCH 3/3] adapt to OcrdFile.local_filename now :Path --- qurator/eynollah/processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qurator/eynollah/processor.py b/qurator/eynollah/processor.py index 3375113..c89c1bd 100644 --- a/qurator/eynollah/processor.py +++ b/qurator/eynollah/processor.py @@ -58,7 +58,7 @@ class EynollahProcessor(Processor): 'override_dpi': self.parameter['dpi'], 'logger': LOG, 'pcgts': pcgts, - 'image_filename': image_filename + 'image_filename': str(image_filename) } Eynollah(**eynollah_kwargs).run() file_id = make_file_id(input_file, self.output_file_grp)