apify 2.2.0b1__py3-none-any.whl → 2.2.0b3__py3-none-any.whl
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 apify might be problematic. Click here for more details.
apify/_actor.py
CHANGED
|
@@ -158,6 +158,16 @@ class _ActorType:
|
|
|
158
158
|
if not self._is_initialized:
|
|
159
159
|
raise RuntimeError('The Actor was not initialized!')
|
|
160
160
|
|
|
161
|
+
def _raise_if_cloud_requested_but_not_configured(self, *, force_cloud: bool) -> None:
|
|
162
|
+
if not force_cloud:
|
|
163
|
+
return
|
|
164
|
+
|
|
165
|
+
if not self.is_at_home() and self.config.token is None:
|
|
166
|
+
raise RuntimeError(
|
|
167
|
+
'In order to use the Apify cloud storage from your computer, '
|
|
168
|
+
'you need to provide an Apify token using the APIFY_TOKEN environment variable.'
|
|
169
|
+
)
|
|
170
|
+
|
|
161
171
|
async def init(self) -> None:
|
|
162
172
|
"""Initialize the Actor instance.
|
|
163
173
|
|
|
@@ -335,6 +345,7 @@ class _ActorType:
|
|
|
335
345
|
An instance of the `Dataset` class for the given ID or name.
|
|
336
346
|
"""
|
|
337
347
|
self._raise_if_not_initialized()
|
|
348
|
+
self._raise_if_cloud_requested_but_not_configured(force_cloud=force_cloud)
|
|
338
349
|
|
|
339
350
|
return await Dataset.open(
|
|
340
351
|
id=id,
|
|
@@ -367,6 +378,7 @@ class _ActorType:
|
|
|
367
378
|
An instance of the `KeyValueStore` class for the given ID or name.
|
|
368
379
|
"""
|
|
369
380
|
self._raise_if_not_initialized()
|
|
381
|
+
self._raise_if_cloud_requested_but_not_configured(force_cloud=force_cloud)
|
|
370
382
|
|
|
371
383
|
return await KeyValueStore.open(
|
|
372
384
|
id=id,
|
|
@@ -401,6 +413,7 @@ class _ActorType:
|
|
|
401
413
|
An instance of the `RequestQueue` class for the given ID or name.
|
|
402
414
|
"""
|
|
403
415
|
self._raise_if_not_initialized()
|
|
416
|
+
self._raise_if_cloud_requested_but_not_configured(force_cloud=force_cloud)
|
|
404
417
|
|
|
405
418
|
return await RequestQueue.open(
|
|
406
419
|
id=id,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
apify/__init__.py,sha256=99ynaDWBLEcCjdLq7R0Exy_iACsXiXoQ8VUZKmbzTeM,550
|
|
2
|
-
apify/_actor.py,sha256=
|
|
2
|
+
apify/_actor.py,sha256=mrjOBjCoyLtW8LceQ94z2l-pQHGLD3DAvoKazoorMDk,42561
|
|
3
3
|
apify/_configuration.py,sha256=_pPkesm1NEE6IxT1Mgxu3fGM89b1rtnLyeC3Hfpbh-Q,10516
|
|
4
4
|
apify/_consts.py,sha256=_Xq4hOfOA1iZ3n1P967YWdyncKivpbX6RTlp_qanUoE,330
|
|
5
5
|
apify/_crypto.py,sha256=e0_aM3l9_5Osk-jszYOOjrAKK60OggSHbiw5c30QnsU,5638
|
|
@@ -32,7 +32,7 @@ apify/scrapy/utils.py,sha256=758DcHCSAgCTProY0QX74uJ1XrzVsQwvCmFanj2f_3Q,2928
|
|
|
32
32
|
apify/storages/__init__.py,sha256=FW-z6ubuPnHGM-Wp15T8mR5q6lnpDGrCW-IkgZd5L30,177
|
|
33
33
|
apify/storages/_request_list.py,sha256=4nrvSdMUF-kiwGVIPEfIOygLKgjUpO37Jl8Om-jRbIU,5858
|
|
34
34
|
apify/storages/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
|
-
apify-2.2.
|
|
36
|
-
apify-2.2.
|
|
37
|
-
apify-2.2.
|
|
38
|
-
apify-2.2.
|
|
35
|
+
apify-2.2.0b3.dist-info/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
|
|
36
|
+
apify-2.2.0b3.dist-info/METADATA,sha256=ohuCUZzhIRVLi0DI2LQPs1VUCTBIK8KAemuRXXdHqUw,8680
|
|
37
|
+
apify-2.2.0b3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
38
|
+
apify-2.2.0b3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|