syncmodels 0.1.346__py2.py3-none-any.whl → 0.1.348__py2.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.
- syncmodels/__init__.py +1 -1
- syncmodels/helpers/orion.py +2 -4
- syncmodels/runner.py +12 -2
- syncmodels/session/__init__.py +2 -14
- {syncmodels-0.1.346.dist-info → syncmodels-0.1.348.dist-info}/METADATA +2 -2
- {syncmodels-0.1.346.dist-info → syncmodels-0.1.348.dist-info}/RECORD +11 -11
- {syncmodels-0.1.346.dist-info → syncmodels-0.1.348.dist-info}/AUTHORS.rst +0 -0
- {syncmodels-0.1.346.dist-info → syncmodels-0.1.348.dist-info}/LICENSE +0 -0
- {syncmodels-0.1.346.dist-info → syncmodels-0.1.348.dist-info}/WHEEL +0 -0
- {syncmodels-0.1.346.dist-info → syncmodels-0.1.348.dist-info}/entry_points.txt +0 -0
- {syncmodels-0.1.346.dist-info → syncmodels-0.1.348.dist-info}/top_level.txt +0 -0
syncmodels/__init__.py
CHANGED
syncmodels/helpers/orion.py
CHANGED
@@ -221,7 +221,7 @@ class OrionInjector:
|
|
221
221
|
if response.status_code < 300:
|
222
222
|
orion_item = response.json()
|
223
223
|
else:
|
224
|
-
log.
|
224
|
+
log.debug(
|
225
225
|
"It seems that [%s] doesn't exist in Orion (is a new entity for Orion)",
|
226
226
|
url,
|
227
227
|
)
|
@@ -460,17 +460,15 @@ class OrionInjector:
|
|
460
460
|
# https://fiware-orion.readthedocs.io/en/2.4.0/user/forbidden_characters/index.html
|
461
461
|
# https://telefonicaid.github.io/fiware-orion/archive/api/v2/
|
462
462
|
if isinstance(value, str):
|
463
|
-
|
464
463
|
if self.REG_FORBIDDEN_CHARS.search(value):
|
465
464
|
data[key] = self.REG_FORBIDDEN_CHARS.sub("", value)
|
466
|
-
log.
|
465
|
+
log.info(
|
467
466
|
"[%s] replacing illegal characters in %s: %s -> %s",
|
468
467
|
data["id"],
|
469
468
|
key,
|
470
469
|
value,
|
471
470
|
data[key],
|
472
471
|
)
|
473
|
-
foo = 1
|
474
472
|
else:
|
475
473
|
data[key] = value = replace(value)
|
476
474
|
|
syncmodels/runner.py
CHANGED
@@ -31,7 +31,7 @@ class iRunner:
|
|
31
31
|
STATS_DISPATCH = "dispatch"
|
32
32
|
STATS_IDLE = "idle"
|
33
33
|
|
34
|
-
FAILURE_POLICY = FailurePolicy.
|
34
|
+
FAILURE_POLICY = FailurePolicy.RETRY
|
35
35
|
|
36
36
|
def __init__(
|
37
37
|
self,
|
@@ -109,14 +109,24 @@ class iRunner:
|
|
109
109
|
log.error(msg)
|
110
110
|
field = str(why)
|
111
111
|
self._stats(field)
|
112
|
+
|
113
|
+
log.error(
|
114
|
+
"FAILURE_POLICY: %s, %s (%s)", self.FAILURE_POLICY, self.uri, self
|
115
|
+
)
|
112
116
|
if self.FAILURE_POLICY == FailurePolicy.STOP:
|
117
|
+
log.error("Stopping Runner: %s (%s)", self.uri, self)
|
113
118
|
self.running = False
|
114
119
|
elif self.FAILURE_POLICY == FailurePolicy.RAISE:
|
120
|
+
# NOTE: this will stop the fiber in asyncio
|
121
|
+
# NOTE: you'd rather use FailurePolicy.RAISE
|
122
|
+
log.error("Raise RuntimeError(%s)", msg)
|
115
123
|
raise RuntimeError(msg)
|
116
124
|
else:
|
117
125
|
# add same task to be executed later on
|
118
126
|
# using a scheduled queue, not just a simple queue
|
119
|
-
|
127
|
+
retry = 300
|
128
|
+
log.error("Retry Task in (%s) secs", retry)
|
129
|
+
self.input_queue.push(task, monotonic() + retry)
|
120
130
|
await self.idle()
|
121
131
|
finally:
|
122
132
|
self._wip and self._wip.pop()
|
syncmodels/session/__init__.py
CHANGED
@@ -278,20 +278,8 @@ class iSession(iContext, iSchema, iRegistry): # , iAuthenticator):
|
|
278
278
|
item = factory(bot=bot, *args, **uri)
|
279
279
|
return item
|
280
280
|
except Exception as why: # pragma: nocover
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
# option = cls.locate(url, __klass__=cls, score=score)
|
285
|
-
# if option:
|
286
|
-
# uri = parse_uri(url)
|
287
|
-
# factory, info = option
|
288
|
-
# for __key__, (args, kw) in info.items():
|
289
|
-
# try:
|
290
|
-
# context.update(kw)
|
291
|
-
# item = factory(bot=bot, *args, **uri, **context)
|
292
|
-
# return item
|
293
|
-
# except Exception as why:
|
294
|
-
# print(why)
|
281
|
+
log.error(why)
|
282
|
+
log.error("".join(traceback.format_exception(*sys.exc_info())))
|
295
283
|
|
296
284
|
raise RuntimeError(f"Unable to create a {cls} for url: {url}")
|
297
285
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: syncmodels
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.348
|
4
4
|
Summary: Synchronizable Models
|
5
5
|
Home-page: https://github.com/asterio.gonzalez/syncmodels
|
6
6
|
Author: Asterio Gonzalez
|
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Requires-Python: >=3.6
|
19
19
|
License-File: LICENSE
|
20
20
|
License-File: AUTHORS.rst
|
21
|
-
Requires-Dist: agptools>=0.1.
|
21
|
+
Requires-Dist: agptools>=0.1.348
|
22
22
|
Requires-Dist: aiocache
|
23
23
|
Requires-Dist: aiohttp
|
24
24
|
Requires-Dist: Click
|
@@ -1,4 +1,4 @@
|
|
1
|
-
syncmodels/__init__.py,sha256=
|
1
|
+
syncmodels/__init__.py,sha256=zRskcOy0OBfyNpVc1dXZ89VD42tDgHQ5s_KX02h-_OU,146
|
2
2
|
syncmodels/context.py,sha256=k1Gs_ip9BfyRFpyRnzqYvRDKo0sYBqJsh6z9sWln9oE,451
|
3
3
|
syncmodels/crawler.py,sha256=lx0IU586JD0qcdozWiv0y7970CkUEg3SzFB6gOYDS6I,94540
|
4
4
|
syncmodels/crud.py,sha256=oZIcwEKR2i-lesEF_059Y4yThohd9m7gs6R6xYgLH-I,15351
|
@@ -9,7 +9,7 @@ syncmodels/http.py,sha256=FFVT3QJJgur2dv1Q_7l9ZsWN8z6_gUjOT9hJff1ZAqk,3335
|
|
9
9
|
syncmodels/parallel.py,sha256=Ll8HmyFF9v9fIofqqSgfhyTlklvb77mTtNdG5Y9lqdQ,7145
|
10
10
|
syncmodels/registry.py,sha256=YaQtgbSwa0je1MpCcVHALI3_b85vrddyOlhsnrUcKZs,8224
|
11
11
|
syncmodels/requests.py,sha256=wWoC5hPDm1iBM_zrlyKRauzhXgdKR3pT5RqyC-5UZhQ,538
|
12
|
-
syncmodels/runner.py,sha256=
|
12
|
+
syncmodels/runner.py,sha256=Tb5KTu_XFxCphrtfcnmIqTItG91el7P-9B5WaDTMp18,5928
|
13
13
|
syncmodels/schema.py,sha256=HMr0LcB40se5sqHF4WYQIdzXUphLa2fhf0KFFUMzpDM,2726
|
14
14
|
syncmodels/storage.py,sha256=x01TmpETMrHvQvliL3TXfUp18RKr6Huz6DmrRZWD1DU,76418
|
15
15
|
syncmodels/syncmodels.py,sha256=jcUxVbv1hrx5hI81VCO1onIM6WyORTqJVPwIqlPocOc,10596
|
@@ -32,7 +32,7 @@ syncmodels/helpers/geojson.py,sha256=9VZjdEw19fLS_Q9topapUOPGxRg2D4GOqm2tlx11W7M
|
|
32
32
|
syncmodels/helpers/importers.py,sha256=KImR9pQu4ir6EI6Ipta0q3RWloFT_VTJi67kM0lZsKQ,3919
|
33
33
|
syncmodels/helpers/loaders.py,sha256=aus0aRcbU1vVa_zWo42aX6uV3B0fQ0aQpkTWlR9xGLA,4325
|
34
34
|
syncmodels/helpers/models.py,sha256=c_ATzmiw5mVY1IGnwmyhjIuu5d2idHU-XeRigZSMkOQ,719
|
35
|
-
syncmodels/helpers/orion.py,sha256=
|
35
|
+
syncmodels/helpers/orion.py,sha256=RY3hEVusUJDuSBN8YBy--RWnZ4TtP0jOUtNuHC1ySjg,30685
|
36
36
|
syncmodels/helpers/surreal.py,sha256=-K7d0JjoSwquSLwIW18Ae4GEL3eI0FTmq2fJKUJd9TA,10912
|
37
37
|
syncmodels/helpers/units.py,sha256=g50m5DQrAyP_qpDRa4LCEA5Rz2UZUmlIixfWG_ddw9I,3571
|
38
38
|
syncmodels/logic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -297,16 +297,16 @@ syncmodels/model/schema_org/webpage.py,sha256=-bqKOpEs_2lW7qrey2nHtvOZ9xbmmwcviN
|
|
297
297
|
syncmodels/model/schema_org/webpageelement.py,sha256=brXfhU3l3FBXpy8qnR1Ve-EckjHW8VGoyR2IsnT7t2Y,1104
|
298
298
|
syncmodels/model/schema_org/website.py,sha256=48Rox27BbFIg1u3wDlOtX-lLCPoFgvvrCw5Hrdf6uRU,912
|
299
299
|
syncmodels/model/schema_org/xpathtype.py,sha256=D8gKiCrGSSuUVYw7BIWmOIUbKATfv2IpbkV1B2TmjC0,484
|
300
|
-
syncmodels/session/__init__.py,sha256=
|
300
|
+
syncmodels/session/__init__.py,sha256=89o6oeJsUaaiZENZDYJ2lP2PQBWX6OZPIzQacWjNh2k,15606
|
301
301
|
syncmodels/session/http.py,sha256=tf7z0ccAEYoCOZT4Ukv3NBXz9hUO3vs2s9bm491pCj8,1480
|
302
302
|
syncmodels/session/postgresql.py,sha256=ZMIu1Rv93pKfvFlovFBmWArzlrT2xaQWNYGZT_LW61k,175
|
303
303
|
syncmodels/session/sql.py,sha256=auZ_3RZTSWViED4UrExYaes42Y2bTZKixEsfOpa_zaU,7036
|
304
304
|
syncmodels/session/sqlite.py,sha256=nCDjopLiBpX1F10qkKoARM7JrVdIpJ1WdGOduFVxaiA,2080
|
305
305
|
syncmodels/source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
306
|
-
syncmodels-0.1.
|
307
|
-
syncmodels-0.1.
|
308
|
-
syncmodels-0.1.
|
309
|
-
syncmodels-0.1.
|
310
|
-
syncmodels-0.1.
|
311
|
-
syncmodels-0.1.
|
312
|
-
syncmodels-0.1.
|
306
|
+
syncmodels-0.1.348.dist-info/AUTHORS.rst,sha256=3ZPoqg8Aav8DSYKd0fwcwn4_5HwSiMLart0E5Un00-U,168
|
307
|
+
syncmodels-0.1.348.dist-info/LICENSE,sha256=uzMOYtIiUsnsD0xHJR7aJWJ4v_bvan0kTnvufy5eNoA,1075
|
308
|
+
syncmodels-0.1.348.dist-info/METADATA,sha256=Eag9GhrcYqHzx4X8iRknn0m6mLU1nEurWlD7DI_iv-I,2700
|
309
|
+
syncmodels-0.1.348.dist-info/WHEEL,sha256=SrDKpSbFN1G94qcmBqS9nyHcDMp9cUS9OC06hC0G3G0,109
|
310
|
+
syncmodels-0.1.348.dist-info/entry_points.txt,sha256=dMnigjZsHMxTwXiiZyBZdBbMYE0-hY3L5cG15EcDAzw,51
|
311
|
+
syncmodels-0.1.348.dist-info/top_level.txt,sha256=2DfQ9NuAhKMjY3BvQGVBA7GfqTm7EoHNbaehSUiqiHQ,11
|
312
|
+
syncmodels-0.1.348.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|