syncmodels 0.1.333__py2.py3-none-any.whl → 0.1.334__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 CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  __author__ = """Asterio Gonzalez"""
4
4
  __email__ = "asterio.gonzalez@gmail.com"
5
- __version__ = "0.1.333"
5
+ __version__ = "0.1.334"
syncmodels/crawler.py CHANGED
@@ -896,7 +896,7 @@ class iBot(iAgent):
896
896
 
897
897
  async def get_data(self, **task):
898
898
  """
899
- Example a crawling function for recommender crawler.
899
+ Example a crawling function for crawler.
900
900
 
901
901
  Get data related to the given kind and path.
902
902
  May add more tasks to be done by crawler.
@@ -53,9 +53,19 @@ class SurrealServer:
53
53
  REG_VERSION = r"(?P<version>(?P<a>\d+)(\.(?P<b>\d+))?(\.(?P<c>\d+))?)"
54
54
  SURREAL_PID = ".surreal.pid"
55
55
 
56
- def __init__(self, path, bind="0.0.0.0:9000", daemon=False, version=""):
56
+ def __init__(
57
+ self,
58
+ path,
59
+ bind="0.0.0.0:9000",
60
+ user="root",
61
+ password="root",
62
+ daemon=False,
63
+ version="",
64
+ ):
57
65
  self.path = path
58
66
  self.bind = bind
67
+ self.user = user
68
+ self.password = password
59
69
  self.daemon = daemon
60
70
  self.proc = None
61
71
  self.pid = None
@@ -99,6 +109,7 @@ class SurrealServer:
99
109
  print(f"exit: {version}")
100
110
  break
101
111
  else:
112
+ self._version = version
102
113
  return path
103
114
 
104
115
  except TimeoutExpired:
@@ -110,19 +121,39 @@ class SurrealServer:
110
121
  executable = self.find_executable()
111
122
  else:
112
123
  executable = "surreal"
113
- return [
114
- executable,
115
- "start",
116
- "--allow-all",
117
- "--bind",
118
- f"{self.bind}",
119
- "--user",
120
- "root",
121
- "--pass",
122
- "root",
123
- # f"file://{self.url}",
124
- f"rocksdb://{self.url}",
125
- ]
124
+
125
+ path = os.path.abspath(self.path)
126
+
127
+ if self._version.get("a") in ("2",):
128
+ return [
129
+ executable,
130
+ "start",
131
+ "--allow-all",
132
+ "--bind",
133
+ f"{self.bind}",
134
+ "-u",
135
+ f"{self.user}",
136
+ "-p",
137
+ f"{self.password}",
138
+ "--log",
139
+ "debug",
140
+ "--changefeed-gc-interval",
141
+ "600s",
142
+ f"rocksdb://{path}",
143
+ ]
144
+ else:
145
+ return [
146
+ executable,
147
+ "start",
148
+ "--allow-all",
149
+ "--bind",
150
+ f"{self.bind}",
151
+ "-u",
152
+ f"{self.user}",
153
+ "-p",
154
+ f"{self.password}",
155
+ f"file://{path}",
156
+ ]
126
157
 
127
158
  def start(self):
128
159
  """starts surreal process and register a callback is anything goes wrong"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: syncmodels
3
- Version: 0.1.333
3
+ Version: 0.1.334
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.333
21
+ Requires-Dist: agptools>=0.1.334
22
22
  Requires-Dist: aiocache
23
23
  Requires-Dist: aiohttp
24
24
  Requires-Dist: Click
@@ -1,6 +1,6 @@
1
- syncmodels/__init__.py,sha256=heMvuebb5E-VxcjkidHaEr6oN5d2fTQ9wqrWcqxCzBE,142
1
+ syncmodels/__init__.py,sha256=79qKhIGH-rtdnic0Qst_kuzypvEYgtYjXJQicUUrO7I,142
2
2
  syncmodels/context.py,sha256=k1Gs_ip9BfyRFpyRnzqYvRDKo0sYBqJsh6z9sWln9oE,451
3
- syncmodels/crawler.py,sha256=sjyuLLBT5RGb-3LVTtjW9nd2PTJyIV5Tldoz8Jq3dVs,94511
3
+ syncmodels/crawler.py,sha256=DAD2tL93iG-LjNQRCg2h_snusjGhQyhdZyMPOCEyvNU,94499
4
4
  syncmodels/crud.py,sha256=oZIcwEKR2i-lesEF_059Y4yThohd9m7gs6R6xYgLH-I,15351
5
5
  syncmodels/definitions.py,sha256=w-3TrSomp9T8OzLmJhKeZQDzrUIJLKldyh1lzlE7Yj0,5476
6
6
  syncmodels/exceptions.py,sha256=ZLAwu19cs2UN2Sv3jaLnixT_jRI7T42TfyutCkUsuIk,685
@@ -33,7 +33,7 @@ syncmodels/helpers/importers.py,sha256=KImR9pQu4ir6EI6Ipta0q3RWloFT_VTJi67kM0lZs
33
33
  syncmodels/helpers/loaders.py,sha256=aus0aRcbU1vVa_zWo42aX6uV3B0fQ0aQpkTWlR9xGLA,4325
34
34
  syncmodels/helpers/models.py,sha256=c_ATzmiw5mVY1IGnwmyhjIuu5d2idHU-XeRigZSMkOQ,719
35
35
  syncmodels/helpers/orion.py,sha256=6lRp1w3yaq_rxOI7nJIjuHdsgBjQu92y0bW0IX_gq44,30719
36
- syncmodels/helpers/surreal.py,sha256=4bBBj__kQta_5ShWzUKlsuq6xSmICP5UwpeA6QTD-rA,10088
36
+ syncmodels/helpers/surreal.py,sha256=lHXvm5oNvpDBXFnIksTNV4c3PWp35myw3TiQpP2dqN0,10855
37
37
  syncmodels/helpers/units.py,sha256=g50m5DQrAyP_qpDRa4LCEA5Rz2UZUmlIixfWG_ddw9I,3571
38
38
  syncmodels/logic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  syncmodels/logic/activity_logger.py,sha256=8wjvgRwaNbibYWGgl-trovSS70yNkoCTlb-AIx3aZEE,14053
@@ -303,10 +303,10 @@ syncmodels/session/postgresql.py,sha256=ZMIu1Rv93pKfvFlovFBmWArzlrT2xaQWNYGZT_LW
303
303
  syncmodels/session/sql.py,sha256=17C8EHn_1twHezhMlD5esMvx4m0iIrnD7JK-TuBswgU,6573
304
304
  syncmodels/session/sqlite.py,sha256=nCDjopLiBpX1F10qkKoARM7JrVdIpJ1WdGOduFVxaiA,2080
305
305
  syncmodels/source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
306
- syncmodels-0.1.333.dist-info/AUTHORS.rst,sha256=3ZPoqg8Aav8DSYKd0fwcwn4_5HwSiMLart0E5Un00-U,168
307
- syncmodels-0.1.333.dist-info/LICENSE,sha256=uzMOYtIiUsnsD0xHJR7aJWJ4v_bvan0kTnvufy5eNoA,1075
308
- syncmodels-0.1.333.dist-info/METADATA,sha256=KChKUTfP3d_Je0m3czd5SC3iTebjP1loPJn9VHXmoKE,2700
309
- syncmodels-0.1.333.dist-info/WHEEL,sha256=SrDKpSbFN1G94qcmBqS9nyHcDMp9cUS9OC06hC0G3G0,109
310
- syncmodels-0.1.333.dist-info/entry_points.txt,sha256=dMnigjZsHMxTwXiiZyBZdBbMYE0-hY3L5cG15EcDAzw,51
311
- syncmodels-0.1.333.dist-info/top_level.txt,sha256=2DfQ9NuAhKMjY3BvQGVBA7GfqTm7EoHNbaehSUiqiHQ,11
312
- syncmodels-0.1.333.dist-info/RECORD,,
306
+ syncmodels-0.1.334.dist-info/AUTHORS.rst,sha256=3ZPoqg8Aav8DSYKd0fwcwn4_5HwSiMLart0E5Un00-U,168
307
+ syncmodels-0.1.334.dist-info/LICENSE,sha256=uzMOYtIiUsnsD0xHJR7aJWJ4v_bvan0kTnvufy5eNoA,1075
308
+ syncmodels-0.1.334.dist-info/METADATA,sha256=tMGMIT9CJEpVOlBmUqV7MCE_Z-myAFJo918gpJdV4KQ,2700
309
+ syncmodels-0.1.334.dist-info/WHEEL,sha256=SrDKpSbFN1G94qcmBqS9nyHcDMp9cUS9OC06hC0G3G0,109
310
+ syncmodels-0.1.334.dist-info/entry_points.txt,sha256=dMnigjZsHMxTwXiiZyBZdBbMYE0-hY3L5cG15EcDAzw,51
311
+ syncmodels-0.1.334.dist-info/top_level.txt,sha256=2DfQ9NuAhKMjY3BvQGVBA7GfqTm7EoHNbaehSUiqiHQ,11
312
+ syncmodels-0.1.334.dist-info/RECORD,,