Contentstack 1.8.1__tar.gz → 1.9.0__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.
- {Contentstack-1.8.1 → contentstack-1.9.0}/Contentstack.egg-info/PKG-INFO +1 -1
- {Contentstack-1.8.1 → contentstack-1.9.0}/LICENSE +1 -1
- {Contentstack-1.8.1 → contentstack-1.9.0}/PKG-INFO +1 -1
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/__init__.py +1 -1
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/entry.py +1 -3
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/query.py +1 -3
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/stack.py +3 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/tests/test_stack.py +5 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/Contentstack.egg-info/SOURCES.txt +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/Contentstack.egg-info/dependency_links.txt +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/Contentstack.egg-info/not-zip-safe +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/Contentstack.egg-info/requires.txt +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/Contentstack.egg-info/top_level.txt +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/README.md +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/asset.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/assetquery.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/basequery.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/contenttype.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/controller.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/deep_merge_lp.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/entryqueryable.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/https_connection.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/image_transform.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/contentstack/utility.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/setup.cfg +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/setup.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/tests/test_assets.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/tests/test_entry.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/tests/test_live_preview.py +0 -0
- {Contentstack-1.8.1 → contentstack-1.9.0}/tests/test_query.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2012 -
|
|
3
|
+
Copyright (c) 2012 - 2024 Contentstack. All rights reserved.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -22,7 +22,7 @@ __all__ = (
|
|
|
22
22
|
__title__ = 'contentstack-delivery-python'
|
|
23
23
|
__author__ = 'contentstack'
|
|
24
24
|
__status__ = 'debug'
|
|
25
|
-
__version__ = 'v1.
|
|
25
|
+
__version__ = 'v1.9.0'
|
|
26
26
|
__endpoint__ = 'cdn.contentstack.io'
|
|
27
27
|
__email__ = 'mobile@contentstack.com'
|
|
28
28
|
__developer_email__ = 'shailesh.mishra@contentstack.com'
|
|
@@ -6,8 +6,6 @@ API Reference: https://www.contentstack.com/docs/developers/apis/content-deliver
|
|
|
6
6
|
import logging
|
|
7
7
|
from urllib import parse
|
|
8
8
|
|
|
9
|
-
import empty
|
|
10
|
-
|
|
11
9
|
from contentstack.deep_merge_lp import DeepMergeMixin
|
|
12
10
|
from contentstack.entryqueryable import EntryQueryable
|
|
13
11
|
|
|
@@ -157,7 +155,7 @@ class Entry(EntryQueryable):
|
|
|
157
155
|
return self
|
|
158
156
|
|
|
159
157
|
def __get_base_url(self, endpoint=''):
|
|
160
|
-
if endpoint is not None and
|
|
158
|
+
if endpoint is not None and endpoint.strip(): # .strip() removes leading/trailing whitespace
|
|
161
159
|
self.http_instance.endpoint = endpoint
|
|
162
160
|
if None in (self.http_instance, self.content_type_id, self.entry_uid):
|
|
163
161
|
raise KeyError(
|
|
@@ -8,8 +8,6 @@ import logging
|
|
|
8
8
|
import warnings
|
|
9
9
|
from urllib import parse
|
|
10
10
|
|
|
11
|
-
import empty
|
|
12
|
-
|
|
13
11
|
from contentstack.basequery import BaseQuery
|
|
14
12
|
from contentstack.deep_merge_lp import DeepMergeMixin
|
|
15
13
|
from contentstack.entryqueryable import EntryQueryable
|
|
@@ -54,7 +52,7 @@ class Query(BaseQuery, EntryQueryable):
|
|
|
54
52
|
self.base_url = self.__get_base_url()
|
|
55
53
|
|
|
56
54
|
def __get_base_url(self, endpoint=''):
|
|
57
|
-
if endpoint is not None and
|
|
55
|
+
if endpoint is not None and endpoint.strip(): # .strip() removes leading/trailing whitespace
|
|
58
56
|
self.http_instance.endpoint = endpoint
|
|
59
57
|
if None in (self.http_instance, self.content_type_uid):
|
|
60
58
|
raise KeyError(
|
|
@@ -21,6 +21,7 @@ class ContentstackRegion(enum.Enum):
|
|
|
21
21
|
EU = 'eu'
|
|
22
22
|
AZURE_NA = 'azure-na'
|
|
23
23
|
AZURE_EU = 'azure-eu'
|
|
24
|
+
GCP_NA = 'gcp-na'
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
class Stack:
|
|
@@ -116,6 +117,8 @@ class Stack:
|
|
|
116
117
|
self.host = 'azure-na-cdn.contentstack.com'
|
|
117
118
|
elif self.region.value == 'azure-eu' and self.host == DEFAULT_HOST:
|
|
118
119
|
self.host = 'azure-eu-cdn.contentstack.com'
|
|
120
|
+
elif self.region.value == 'gcp-na' and self.host == DEFAULT_HOST:
|
|
121
|
+
self.host = 'gcp-na-cdn.contentstack.com'
|
|
119
122
|
elif self.region.value != 'us':
|
|
120
123
|
self.host = f'{self.region.value}-{DEFAULT_HOST}'
|
|
121
124
|
self.endpoint = f'https://{self.host}/{self.version}'
|
|
@@ -28,6 +28,11 @@ class TestStack(unittest.TestCase):
|
|
|
28
28
|
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, region=ContentstackRegion.EU)
|
|
29
29
|
self.assertEqual('eu-cdn.contentstack.com', stack_region.host)
|
|
30
30
|
|
|
31
|
+
def test_02_stack_gcp_na_region(self):
|
|
32
|
+
stack_region = contentstack.Stack(
|
|
33
|
+
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, region=ContentstackRegion.GCP_NA)
|
|
34
|
+
self.assertEqual('gcp-na-cdn.contentstack.com', stack_region.host)
|
|
35
|
+
|
|
31
36
|
def test_03_stack_endpoint(self):
|
|
32
37
|
self.assertEqual(f"https://{config.HOST}/v3",
|
|
33
38
|
self.stack.endpoint)
|
|
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
|