pyPreservica 3.2.4__tar.gz → 3.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyPreservica might be problematic. Click here for more details.
- {pypreservica-3.2.4 → pypreservica-3.2.5}/PKG-INFO +1 -1
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/__init__.py +1 -1
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/common.py +6 -2
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/entityAPI.py +3 -3
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/uploadAPI.py +3 -3
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica.egg-info/PKG-INFO +1 -1
- {pypreservica-3.2.4 → pypreservica-3.2.5}/setup.py +1 -1
- {pypreservica-3.2.4 → pypreservica-3.2.5}/LICENSE.txt +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/README.md +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/adminAPI.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/authorityAPI.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/contentAPI.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/mdformsAPI.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/monitorAPI.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/opex.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/parAPI.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/retentionAPI.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/settingsAPI.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/webHooksAPI.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica/workflowAPI.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica.egg-info/SOURCES.txt +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica.egg-info/dependency_links.txt +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica.egg-info/requires.txt +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/pyPreservica.egg-info/top_level.txt +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/setup.cfg +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_authority_records.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_bitstream.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_children.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_content_api.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_crawl_fs.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_delete.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_download.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_entity.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_export_opex.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_groups.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_identifier.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_ingest.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_integrity_check.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_metadata.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_par.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_replace.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_retention.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_schema.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_security.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_settings.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_thumbnail.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_upload.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_users.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_workflow.py +0 -0
- {pypreservica-3.2.4 → pypreservica-3.2.5}/tests/test_xml_metadata.py +0 -0
|
@@ -822,7 +822,6 @@ class AuthenticatedAPI:
|
|
|
822
822
|
self.minor_version = int(version_numbers[1])
|
|
823
823
|
self.patch_version = int(version_numbers[2])
|
|
824
824
|
|
|
825
|
-
|
|
826
825
|
return version
|
|
827
826
|
elif request.status_code == requests.codes.unauthorized:
|
|
828
827
|
self.token = self.__token__()
|
|
@@ -831,6 +830,9 @@ class AuthenticatedAPI:
|
|
|
831
830
|
logger.error(f"version number failed with http response {request.status_code}")
|
|
832
831
|
logger.error(str(request.content))
|
|
833
832
|
RuntimeError(request.status_code, "version number failed")
|
|
833
|
+
return None
|
|
834
|
+
|
|
835
|
+
|
|
834
836
|
|
|
835
837
|
def __str__(self):
|
|
836
838
|
return f"pyPreservica version: {pyPreservica.__version__} (Preservica 8.0 Compatible) " \
|
|
@@ -890,9 +892,11 @@ class AuthenticatedAPI:
|
|
|
890
892
|
data = {'username': self.username,
|
|
891
893
|
'continuationToken': response.json()['continuationToken'],
|
|
892
894
|
'tenant': self.tenant, 'twoFactorToken': totp.now()}
|
|
895
|
+
|
|
896
|
+
header = {'Content-Type': 'application/x-www-form-urlencoded'}
|
|
893
897
|
response_2fa = self.session.post(
|
|
894
898
|
f'{self.protocol}://{self.server}/api/accesstoken/complete-2fa',
|
|
895
|
-
data=data)
|
|
899
|
+
data=data, headers=header)
|
|
896
900
|
if response_2fa.status_code == requests.codes.ok:
|
|
897
901
|
return response_2fa.json()['token']
|
|
898
902
|
else:
|
|
@@ -61,7 +61,7 @@ class EntityAPI(AuthenticatedAPI):
|
|
|
61
61
|
Generator function to return bitstream chunks
|
|
62
62
|
|
|
63
63
|
:param bitstream: The bitstream
|
|
64
|
-
:param chunk_size: The chunk size to return
|
|
64
|
+
:param chunk_size: The chunk size to return (defaults to 4K)
|
|
65
65
|
:return: A chunk of the requested bitstream content
|
|
66
66
|
"""
|
|
67
67
|
if not isinstance(bitstream, Bitstream):
|
|
@@ -75,7 +75,7 @@ class EntityAPI(AuthenticatedAPI):
|
|
|
75
75
|
for chunk in request.iter_content(chunk_size=chunk_size):
|
|
76
76
|
yield chunk
|
|
77
77
|
else:
|
|
78
|
-
exception = HTTPException(bitstream.filename, request.status_code, request.url, "
|
|
78
|
+
exception = HTTPException(bitstream.filename, request.status_code, request.url, "bitstream_chunks",
|
|
79
79
|
request.content.decode('utf-8'))
|
|
80
80
|
logger.error(exception)
|
|
81
81
|
raise exception
|
|
@@ -113,7 +113,7 @@ class EntityAPI(AuthenticatedAPI):
|
|
|
113
113
|
logger.error("Downloaded file size did not match the Preservica held value")
|
|
114
114
|
return None
|
|
115
115
|
else:
|
|
116
|
-
exception = HTTPException(bitstream.filename, response.status_code, response.url, "
|
|
116
|
+
exception = HTTPException(bitstream.filename, response.status_code, response.url, "bitstream_bytes",
|
|
117
117
|
response.content.decode('utf-8'))
|
|
118
118
|
logger.error(exception)
|
|
119
119
|
raise exception
|
|
@@ -1668,10 +1668,10 @@ class UploadAPI(AuthenticatedAPI):
|
|
|
1668
1668
|
for page in paginator.paginate(Bucket=bucket_name):
|
|
1669
1669
|
if 'Contents' in page:
|
|
1670
1670
|
for key in page['Contents']:
|
|
1671
|
-
last_modified = key[
|
|
1671
|
+
last_modified = key['LastModified']
|
|
1672
1672
|
if abs((last_modified - now).days) > older_than_days:
|
|
1673
|
-
logger.debug(f"Deleting expired object {key[
|
|
1674
|
-
s3_client.delete_object(Bucket=bucket_name, Key=key[
|
|
1673
|
+
logger.debug(f"Deleting expired object {key['Key']}")
|
|
1674
|
+
s3_client.delete_object(Bucket=bucket_name, Key=key['Key'])
|
|
1675
1675
|
|
|
1676
1676
|
|
|
1677
1677
|
|
|
@@ -21,7 +21,7 @@ if sys.argv[-1] == 'publish':
|
|
|
21
21
|
# This call to setup() does all the work
|
|
22
22
|
setup(
|
|
23
23
|
name=PKG,
|
|
24
|
-
version="3.2.
|
|
24
|
+
version="3.2.5",
|
|
25
25
|
description="Python library for the Preservica API",
|
|
26
26
|
long_description=README,
|
|
27
27
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|