Skip to content

Commit 07a8bee

Browse files
committed
pyright
1 parent e9bc1f7 commit 07a8bee

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

libservice/start.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,20 @@
1919
THINGSDB_SCOPE = os.getenv('THINGSDB_SCOPE', '//data')
2020

2121

22+
def ti_nodes_from_str(node_str: str) -> list[str | tuple[str, int]]:
23+
nodes: list[str | tuple[str, int]] = []
24+
for node in node_str.replace(';', ',').split(','):
25+
arr = node.split(':')
26+
if len(arr) == 1:
27+
nodes.append(arr[0])
28+
elif len(arr) == 2:
29+
nodes.append((arr[0], int(arr[1])))
30+
return nodes
31+
32+
2233
async def _setup_ticonn():
2334
assert isinstance(THINGSDB_TOKEN, str)
24-
nodes = [
25-
tuple(node.split(':'))
26-
for node in THINGSDB_HOSTLIST.replace(';', ',').split(',')]
35+
nodes = ti_nodes_from_str(THINGSDB_HOSTLIST)
2736
token: str = THINGSDB_TOKEN
2837
ticonn.set_default_scope(THINGSDB_SCOPE)
2938
await ticonn.connect_pool(nodes, token)

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
colorlog==6.8.2
2-
cryptography==42.0.5
3-
msgpack==1.0.8
4-
python-thingsdb==1.1.1
1+
colorlog==6.10.1
2+
cryptography==46.0.3
3+
msgpack==1.1.2
4+
python-thingsdb==1.2.2

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.1.17'
1+
__version__ = '0.1.18'

0 commit comments

Comments
 (0)