splight-lib 3.0.0.dev1__tar.gz → 3.0.0.dev3__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.
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/PKG-INFO +1 -1
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/setup.py +1 -1
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/database/remote_client.py +1 -1
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/datalake/local_client.py +45 -6
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/datalake/remote_client.py +5 -2
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/hub/abstract.py +1 -13
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/hub/client.py +29 -33
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/__init__.py +1 -5
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/base.py +4 -6
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/component.py +7 -0
- splight-lib-3.0.0.dev3/splight_lib/models/hub.py +202 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/settings.py +2 -2
- splight-lib-3.0.0.dev3/splight_lib/testing/__init__.py +102 -0
- splight-lib-3.0.0.dev3/splight_lib/utils/hub.py +27 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib.egg-info/PKG-INFO +1 -1
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib.egg-info/SOURCES.txt +3 -1
- splight-lib-3.0.0.dev1/splight_lib/models/hub.py +0 -35
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/LICENSE.txt +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/README.md +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/setup.cfg +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/abstract/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/abstract/client.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/auth/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/auth/exceptions.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/auth/mac_auth.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/auth/token.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/abstract.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/classmap.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/exceptions.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/local_client.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/remote_client.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/database/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/database/abstract.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/database/builder.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/database/classmap.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/database/local_client.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/datalake/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/datalake/abstract.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/datalake/builder.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/exceptions.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/file_handler.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/filter.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/hub/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/communication/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/communication/event_handler.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/component/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/component/abstract.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/component/exceptions.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/component/spec.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/constants.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/encryption.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/execution.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/logging/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/logging/_internal.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/logging/component.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/logging/logging.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/alert.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/asset.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/attribute.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/communication.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/event.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/exceptions.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/file.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/native.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/query.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/secret.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/models/setpoint.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/restclient/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/restclient/client.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/restclient/exceptions.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/restclient/types.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/utils/__init__.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/utils/custom_model.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/webhook.py +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib.egg-info/dependency_links.txt +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib.egg-info/not-zip-safe +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib.egg-info/requires.txt +0 -0
- {splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib.egg-info/top_level.txt +0 -0
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/database/remote_client.py
RENAMED
|
@@ -215,7 +215,7 @@ class RemoteDatabaseClient(AbstractDatabaseClient, AbstractRemoteClient):
|
|
|
215
215
|
response = self._list(url, **kwargs)
|
|
216
216
|
yield response
|
|
217
217
|
next_page = (
|
|
218
|
-
response["next"].
|
|
218
|
+
furl(response["next"]).query.params["page"]
|
|
219
219
|
if response["next"]
|
|
220
220
|
else None
|
|
221
221
|
)
|
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/datalake/local_client.py
RENAMED
|
@@ -50,8 +50,7 @@ class LocalDatalakeClient(AbstractDatalakeClient):
|
|
|
50
50
|
|
|
51
51
|
def _raw_get(
|
|
52
52
|
self,
|
|
53
|
-
|
|
54
|
-
collection: str,
|
|
53
|
+
resource_type: DLResource,
|
|
55
54
|
limit_: int = 1000,
|
|
56
55
|
skip_: int = 0,
|
|
57
56
|
sort: Union[List, str] = ["timestamp__desc"],
|
|
@@ -73,9 +72,10 @@ class LocalDatalakeClient(AbstractDatalakeClient):
|
|
|
73
72
|
handler = FixedLineNumberFileHandler(
|
|
74
73
|
file_path=file_path, total_lines=self._TOTAL_DOCS
|
|
75
74
|
)
|
|
76
|
-
documents = [
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
documents = [json.loads(doc) for doc in handler.read()]
|
|
76
|
+
|
|
77
|
+
filters = kwargs
|
|
78
|
+
filters.update({"output_format": resource_type.__name__})
|
|
79
79
|
documents = self._filter(documents, filters=filters)
|
|
80
80
|
|
|
81
81
|
reverse = False
|
|
@@ -83,7 +83,46 @@ class LocalDatalakeClient(AbstractDatalakeClient):
|
|
|
83
83
|
reverse = True
|
|
84
84
|
documents.sort(key=lambda x: x["timestamp"], reverse=reverse)
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
# TODO: review how to apply grouping
|
|
87
|
+
return [
|
|
88
|
+
resource_type.parse_obj(doc)
|
|
89
|
+
for doc in documents[skip_ : limit_ + 1]
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
def get(
|
|
93
|
+
self,
|
|
94
|
+
resource_type: Type,
|
|
95
|
+
limit_: int = 50,
|
|
96
|
+
skip_: int = 0,
|
|
97
|
+
sort: Union[List, str] = ["timestamp__desc"],
|
|
98
|
+
group_id: Union[List, str] = [],
|
|
99
|
+
group_fields: Union[List, str] = [],
|
|
100
|
+
tzinfo: timezone = timezone(timedelta()),
|
|
101
|
+
**kwargs,
|
|
102
|
+
) -> QuerySet:
|
|
103
|
+
logger.debug(
|
|
104
|
+
"Retrieving object of type %s from datalake.",
|
|
105
|
+
resource_type,
|
|
106
|
+
tags=LogTags.DATALAKE,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
new_kwargs = {
|
|
110
|
+
"get_func": "_raw_get",
|
|
111
|
+
"count_func": "None",
|
|
112
|
+
"collection": resource_type.Meta.collection_name,
|
|
113
|
+
"resource_type": resource_type,
|
|
114
|
+
"limit_": limit_,
|
|
115
|
+
"skip_": skip_,
|
|
116
|
+
"sort": sort,
|
|
117
|
+
"group_id": group_id,
|
|
118
|
+
"group_fields": group_fields,
|
|
119
|
+
"tzinfo": tzinfo,
|
|
120
|
+
}
|
|
121
|
+
kwargs.update(new_kwargs)
|
|
122
|
+
return QuerySet(self, **kwargs)
|
|
123
|
+
|
|
124
|
+
def get_output(self, query: Query) -> List[Dict]:
|
|
125
|
+
raise NotImplementedError()
|
|
87
126
|
|
|
88
127
|
def get_dataframe(
|
|
89
128
|
self,
|
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/datalake/remote_client.py
RENAMED
|
@@ -5,10 +5,13 @@ from typing import Dict, List, Optional, Union
|
|
|
5
5
|
|
|
6
6
|
import pandas as pd
|
|
7
7
|
from furl import furl
|
|
8
|
+
from pydantic import BaseModel
|
|
8
9
|
from retry import retry
|
|
9
|
-
from
|
|
10
|
+
from splight_abstract import AbstractRemoteClient
|
|
11
|
+
from splight_abstract.datalake import (
|
|
12
|
+
AbstractDatalakeClient,
|
|
13
|
+
)
|
|
10
14
|
from splight_lib.auth import SplightAuthToken
|
|
11
|
-
from splight_lib.client.datalake.abstract import AbstractDatalakeClient
|
|
12
15
|
from splight_lib.client.exceptions import SPLIGHT_REQUEST_EXCEPTIONS
|
|
13
16
|
from splight_lib.logging._internal import LogTags, get_splight_logger
|
|
14
17
|
from splight_lib.restclient import SplightRestClient
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod, abstractproperty
|
|
2
|
-
from
|
|
3
|
-
from typing import Callable, Dict, List, Tuple, Type
|
|
2
|
+
from typing import Dict, List, Tuple, Type
|
|
4
3
|
|
|
5
4
|
from pydantic import BaseModel
|
|
6
5
|
from splight_lib.abstract.client import AbstractClient, QuerySet
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
def validate_client_resource_type(func: Callable) -> Callable:
|
|
10
|
-
@wraps(func)
|
|
11
|
-
def wrapper(self, resource_type: Type, *args, **kwargs):
|
|
12
|
-
if resource_type not in self.valid_classes:
|
|
13
|
-
raise NotImplementedError(
|
|
14
|
-
f"Not a valid resource_type: {resource_type.__name__}"
|
|
15
|
-
)
|
|
16
|
-
return func(self, resource_type, *args, **kwargs)
|
|
17
|
-
|
|
18
|
-
return wrapper
|
|
19
|
-
|
|
20
8
|
|
|
21
9
|
class AbstractHubSubClient(AbstractClient):
|
|
22
10
|
@abstractmethod
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Dict, List, Optional, Tuple
|
|
1
|
+
from typing import Dict, List, Optional, Tuple
|
|
2
2
|
|
|
3
3
|
import requests
|
|
4
4
|
from furl import furl
|
|
@@ -7,33 +7,27 @@ from splight_lib.auth import SplightAuthToken
|
|
|
7
7
|
from splight_lib.client.hub.abstract import (
|
|
8
8
|
AbstractHubClient,
|
|
9
9
|
AbstractHubSubClient,
|
|
10
|
-
validate_client_resource_type,
|
|
11
10
|
)
|
|
12
|
-
from splight_lib.models.hub import HubComponent, HubComponentVersion
|
|
13
|
-
from splight_lib.settings import settings
|
|
14
11
|
|
|
15
12
|
|
|
16
13
|
class _SplightHubGenericClient(AbstractHubSubClient):
|
|
17
14
|
_PREFIX: str = "v2/hub"
|
|
18
|
-
valid_classes = [
|
|
19
|
-
HubComponent,
|
|
20
|
-
HubComponentVersion,
|
|
21
|
-
]
|
|
22
15
|
_CLASS_MAP = {
|
|
23
|
-
HubComponent: "components",
|
|
24
|
-
HubComponentVersion: "component-versions",
|
|
16
|
+
'HubComponent': "components",
|
|
17
|
+
'HubComponentVersion': "component-versions",
|
|
25
18
|
}
|
|
26
19
|
|
|
27
20
|
def __init__(
|
|
28
21
|
self,
|
|
29
22
|
base_path: str,
|
|
23
|
+
api_host: str,
|
|
30
24
|
headers: Optional[Dict[str, str]] = {},
|
|
31
25
|
*args,
|
|
32
26
|
**kwargs,
|
|
33
27
|
):
|
|
34
28
|
super().__init__(*args, **kwargs)
|
|
35
29
|
self._base_url = furl(
|
|
36
|
-
|
|
30
|
+
api_host,
|
|
37
31
|
path=f"{self._PREFIX}/{base_path}/",
|
|
38
32
|
)
|
|
39
33
|
self._session = requests.Session()
|
|
@@ -56,10 +50,9 @@ class _SplightHubGenericClient(AbstractHubSubClient):
|
|
|
56
50
|
def save(self, instance: BaseModel) -> BaseModel:
|
|
57
51
|
raise NotImplementedError
|
|
58
52
|
|
|
59
|
-
@validate_client_resource_type
|
|
60
53
|
def _get(
|
|
61
54
|
self,
|
|
62
|
-
resource_type:
|
|
55
|
+
resource_type: str,
|
|
63
56
|
first: bool = False,
|
|
64
57
|
limit_: int = -1,
|
|
65
58
|
skip_: int = 0,
|
|
@@ -71,14 +64,14 @@ class _SplightHubGenericClient(AbstractHubSubClient):
|
|
|
71
64
|
assert (
|
|
72
65
|
response.status_code == 200
|
|
73
66
|
), f"Failed to get components {response.content}"
|
|
74
|
-
queryset =
|
|
67
|
+
queryset = response.json()["results"]
|
|
75
68
|
if first:
|
|
76
69
|
return queryset[0] if queryset else None
|
|
77
70
|
return queryset
|
|
78
71
|
|
|
79
72
|
def count(
|
|
80
73
|
self,
|
|
81
|
-
resource_type:
|
|
74
|
+
resource_type: str,
|
|
82
75
|
first=False,
|
|
83
76
|
limit_: int = -1,
|
|
84
77
|
skip_: int = 0,
|
|
@@ -92,15 +85,14 @@ class _SplightHubGenericClient(AbstractHubSubClient):
|
|
|
92
85
|
), f"Failed to get components {response.content}"
|
|
93
86
|
return response.json()["count"]
|
|
94
87
|
|
|
95
|
-
def delete(self, resource_type:
|
|
88
|
+
def delete(self, resource_type: str, id: str) -> None:
|
|
96
89
|
url = self._get_url(resource_type, id)
|
|
97
90
|
response = self._session.delete(url)
|
|
98
91
|
assert (
|
|
99
92
|
response.status_code == 204
|
|
100
93
|
), f"Failed to delete component {response.content}"
|
|
101
94
|
|
|
102
|
-
|
|
103
|
-
def update(self, resource_type: Type, id: str, data: Dict) -> BaseModel:
|
|
95
|
+
def update(self, resource_type: str, id: str, data: Dict) -> BaseModel:
|
|
104
96
|
url = self._get_url(resource_type, id)
|
|
105
97
|
response = self._session.put(url, json=data)
|
|
106
98
|
assert (
|
|
@@ -108,9 +100,8 @@ class _SplightHubGenericClient(AbstractHubSubClient):
|
|
|
108
100
|
), f"Failed to update component. {response.content}"
|
|
109
101
|
return resource_type(**response.json())
|
|
110
102
|
|
|
111
|
-
@validate_client_resource_type
|
|
112
103
|
def partial_update(
|
|
113
|
-
self, resource_type:
|
|
104
|
+
self, resource_type: str, id: str, data: Dict
|
|
114
105
|
) -> BaseModel:
|
|
115
106
|
url = self._get_url(resource_type, id)
|
|
116
107
|
response = self._session.patch(url, json=data)
|
|
@@ -119,8 +110,7 @@ class _SplightHubGenericClient(AbstractHubSubClient):
|
|
|
119
110
|
), f"Failed to update component. {response.content}"
|
|
120
111
|
return resource_type.parse_obj(response.json())
|
|
121
112
|
|
|
122
|
-
|
|
123
|
-
def rebuild(self, resource_type: Type, id: str) -> None:
|
|
113
|
+
def rebuild(self, resource_type: str, id: str) -> None:
|
|
124
114
|
url = self._get_url(resource_type, id)
|
|
125
115
|
url = url / "rebuild/"
|
|
126
116
|
response = self._session.post(url, headers=self.headers)
|
|
@@ -130,28 +120,34 @@ class _SplightHubGenericClient(AbstractHubSubClient):
|
|
|
130
120
|
|
|
131
121
|
|
|
132
122
|
class SplightHubClient(AbstractHubClient):
|
|
133
|
-
def __init__(
|
|
123
|
+
def __init__(
|
|
124
|
+
self,
|
|
125
|
+
access_key: str,
|
|
126
|
+
secret_key: str,
|
|
127
|
+
api_host: str,
|
|
128
|
+
*args, **kwargs
|
|
129
|
+
) -> None:
|
|
134
130
|
super().__init__()
|
|
135
131
|
token = SplightAuthToken(
|
|
136
|
-
access_key=
|
|
137
|
-
secret_key=
|
|
132
|
+
access_key=access_key,
|
|
133
|
+
secret_key=secret_key,
|
|
138
134
|
)
|
|
139
135
|
self._all = _SplightHubGenericClient(
|
|
140
|
-
base_path="all", headers=token.header
|
|
136
|
+
base_path="all", headers=token.header, api_host=api_host
|
|
141
137
|
)
|
|
142
138
|
self._mine = _SplightHubGenericClient(
|
|
143
|
-
base_path="mine", headers=token.header
|
|
139
|
+
base_path="mine", headers=token.header, api_host=api_host
|
|
144
140
|
)
|
|
145
141
|
self._public = _SplightHubGenericClient(
|
|
146
|
-
base_path="public", headers=token.header
|
|
142
|
+
base_path="public", headers=token.header, api_host=api_host
|
|
147
143
|
)
|
|
148
144
|
self._private = _SplightHubGenericClient(
|
|
149
|
-
base_path="private", headers=token.header
|
|
145
|
+
base_path="private", headers=token.header, api_host=api_host
|
|
150
146
|
)
|
|
151
147
|
self._setup = _SplightHubGenericClient(
|
|
152
|
-
base_path="setup", headers=token.header
|
|
148
|
+
base_path="setup", headers=token.header, api_host=api_host
|
|
153
149
|
)
|
|
154
|
-
self._host = furl(
|
|
150
|
+
self._host = furl(api_host)
|
|
155
151
|
self._headers = token.header
|
|
156
152
|
|
|
157
153
|
def upload(self, data: Dict, files: Dict) -> Tuple:
|
|
@@ -161,14 +157,14 @@ class SplightHubClient(AbstractHubClient):
|
|
|
161
157
|
)
|
|
162
158
|
status_code = response.status_code
|
|
163
159
|
assert status_code == 201, "Unable to upload component to HUB"
|
|
164
|
-
return response.json()
|
|
160
|
+
return response.json()
|
|
165
161
|
|
|
166
162
|
def download(self, data: Dict) -> Tuple:
|
|
167
163
|
url = self._host / "v2/hub/download/"
|
|
168
164
|
response = requests.post(url, data=data, headers=self._headers)
|
|
169
165
|
status_code = response.status_code
|
|
170
166
|
assert status_code == 200, "Unable to download component"
|
|
171
|
-
return response.content
|
|
167
|
+
return response.content
|
|
172
168
|
|
|
173
169
|
@property
|
|
174
170
|
def all(self) -> AbstractHubSubClient:
|
|
@@ -7,9 +7,8 @@ from splight_lib.models.component import (
|
|
|
7
7
|
ComponentObjectInstance,
|
|
8
8
|
)
|
|
9
9
|
from splight_lib.models.file import File
|
|
10
|
-
from splight_lib.models.hub import HubComponent, HubComponentVersion
|
|
11
|
-
from splight_lib.models.native import Boolean, Number, String
|
|
12
10
|
from splight_lib.models.query import Query
|
|
11
|
+
from splight_lib.models.native import Number, String, Boolean
|
|
13
12
|
from splight_lib.models.secret import Secret
|
|
14
13
|
from splight_lib.models.setpoint import SetPoint
|
|
15
14
|
|
|
@@ -19,9 +18,6 @@ __all__ = [
|
|
|
19
18
|
Asset,
|
|
20
19
|
Attribute,
|
|
21
20
|
Boolean,
|
|
22
|
-
Component,
|
|
23
|
-
ComponentObject,
|
|
24
|
-
ComponentObjectInstance,
|
|
25
21
|
File,
|
|
26
22
|
HubComponent,
|
|
27
23
|
HubComponentVersion,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
|
|
5
|
-
import pandas as pd
|
|
6
|
-
from pydantic import BaseModel, Field, PrivateAttr
|
|
1
|
+
from typing import Dict, List, Optional
|
|
2
|
+
from pydantic import BaseModel, PrivateAttr, Field
|
|
3
|
+
from splight_abstract.database import AbstractDatabaseClient
|
|
4
|
+
from splight_abstract.datalake import AbstractDatalakeClient
|
|
7
5
|
from splight_lib.client.database import DatabaseClientBuilder
|
|
8
6
|
from splight_lib.client.database.abstract import AbstractDatabaseClient
|
|
9
7
|
from splight_lib.client.datalake import DatalakeClientBuilder
|
|
@@ -21,6 +21,13 @@ from strenum import LowercaseStrEnum
|
|
|
21
21
|
warnings.filterwarnings("ignore", category=RuntimeWarning)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
class PrivacyPolicy(LowercaseStrEnum):
|
|
25
|
+
PUBLIC = auto()
|
|
26
|
+
PRIVATE = auto()
|
|
27
|
+
|
|
28
|
+
warnings.filterwarnings("ignore", category=RuntimeWarning)
|
|
29
|
+
|
|
30
|
+
|
|
24
31
|
class PrivacyPolicy(LowercaseStrEnum):
|
|
25
32
|
PUBLIC = auto()
|
|
26
33
|
PRIVATE = auto()
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
import py7zr
|
|
6
|
+
from pydantic import BaseModel, PrivateAttr, validator
|
|
7
|
+
|
|
8
|
+
from splight_lib.client.hub.abstract import AbstractHubClient
|
|
9
|
+
from splight_lib.client.hub.client import SplightHubClient
|
|
10
|
+
from splight_lib.models.component import (
|
|
11
|
+
Binding,
|
|
12
|
+
Command,
|
|
13
|
+
ComponentType,
|
|
14
|
+
Endpoint,
|
|
15
|
+
InputParameter,
|
|
16
|
+
Output,
|
|
17
|
+
)
|
|
18
|
+
from splight_lib.settings import settings
|
|
19
|
+
from splight_lib.utils.hub import (
|
|
20
|
+
COMPRESSION_TYPE,
|
|
21
|
+
README_FILE_1,
|
|
22
|
+
README_FILE_2,
|
|
23
|
+
get_ignore_pathspec,
|
|
24
|
+
get_spec,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
VERIFICATION_CHOICES = ["verified", "unverified", "official"]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def get_hub_client() -> AbstractHubClient:
|
|
31
|
+
return SplightHubClient(
|
|
32
|
+
access_key=settings.SPLIGHT_ACCESS_ID,
|
|
33
|
+
secret_key=settings.SPLIGHT_SECRET_KEY,
|
|
34
|
+
api_host=settings.SPLIGHT_PLATFORM_API_HOST,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class HubComponent(BaseModel):
|
|
39
|
+
id: Optional[str]
|
|
40
|
+
name: str
|
|
41
|
+
version: str
|
|
42
|
+
splight_cli_version: str
|
|
43
|
+
build_status: Optional[str]
|
|
44
|
+
description: Optional[str]
|
|
45
|
+
privacy_policy: Optional[str] = None
|
|
46
|
+
component_type: Optional[str] = None
|
|
47
|
+
tenant: Optional[str] = None
|
|
48
|
+
readme: Optional[str]
|
|
49
|
+
picture: Optional[str]
|
|
50
|
+
file: Optional[str]
|
|
51
|
+
verification: Optional[str]
|
|
52
|
+
created_at: Optional[str]
|
|
53
|
+
last_modified: Optional[str]
|
|
54
|
+
tags: List[str] = []
|
|
55
|
+
min_component_capacity: Optional[str]
|
|
56
|
+
usage_count: int = 0
|
|
57
|
+
|
|
58
|
+
input: List[InputParameter] = []
|
|
59
|
+
output: List[Output] = []
|
|
60
|
+
commands: List[Command] = []
|
|
61
|
+
endpoints: List[Endpoint] = []
|
|
62
|
+
bindings: List[Binding] = []
|
|
63
|
+
|
|
64
|
+
_hub_client: AbstractHubClient = PrivateAttr()
|
|
65
|
+
|
|
66
|
+
def __init__(self, *args, **kwargs):
|
|
67
|
+
super().__init__(*args, **kwargs)
|
|
68
|
+
self._hub_client = get_hub_client()
|
|
69
|
+
|
|
70
|
+
@validator("verification", pre=True, always=True)
|
|
71
|
+
def set_verification_now(cls, v):
|
|
72
|
+
if v:
|
|
73
|
+
assert v in VERIFICATION_CHOICES, "Verification value not allowed."
|
|
74
|
+
return v
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def list_mine(cls, **params) -> List["HubComponent"]:
|
|
78
|
+
hub_client = get_hub_client()
|
|
79
|
+
data = hub_client.mine.get(resource_type=cls.__name__, **params)
|
|
80
|
+
return [cls.parse_obj(obj) for obj in data]
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def list_all(cls, **params) -> List["HubComponent"]:
|
|
84
|
+
hub_client = get_hub_client()
|
|
85
|
+
data = hub_client.all.get(resource_type=cls.__name__, **params)
|
|
86
|
+
return [cls.parse_obj(obj) for obj in data]
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def list_public(cls, **params) -> List["HubComponent"]:
|
|
90
|
+
hub_client = get_hub_client()
|
|
91
|
+
data = hub_client.public.get(resource_type=cls.__name__, **params)
|
|
92
|
+
return [cls.parse_obj(obj) for obj in data]
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def list_private(cls, **params) -> List["HubComponent"]:
|
|
96
|
+
hub_client = get_hub_client()
|
|
97
|
+
data = hub_client.private.get(resource_type=cls.__name__, **params)
|
|
98
|
+
return [cls.parse_obj(obj) for obj in data]
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def list_setup(cls, **params) -> List["HubComponent"]:
|
|
102
|
+
hub_client = get_hub_client()
|
|
103
|
+
data = hub_client.setup.get(resource_type=cls.__name__, **params)
|
|
104
|
+
return [cls.parse_obj(obj) for obj in data]
|
|
105
|
+
|
|
106
|
+
@classmethod
|
|
107
|
+
def retrieve_mine(cls, id: str) -> "HubComponent":
|
|
108
|
+
hub_client = get_hub_client()
|
|
109
|
+
data = hub_client.mine.get(
|
|
110
|
+
resource_type=cls.__name__, id=id, first=True
|
|
111
|
+
)
|
|
112
|
+
return cls.parse_obj(data)
|
|
113
|
+
|
|
114
|
+
@classmethod
|
|
115
|
+
def retrieve_all(cls, id: str) -> "HubComponent":
|
|
116
|
+
hub_client = get_hub_client()
|
|
117
|
+
data = hub_client.all.get(
|
|
118
|
+
resource_type=cls.__name__, id=id, first=True
|
|
119
|
+
)
|
|
120
|
+
return cls.parse_obj(data)
|
|
121
|
+
|
|
122
|
+
@classmethod
|
|
123
|
+
def retrieve_public(cls, id: str) -> "HubComponent":
|
|
124
|
+
hub_client = get_hub_client()
|
|
125
|
+
data = hub_client.public.get(
|
|
126
|
+
resource_type=cls.__name__, id=id, first=True
|
|
127
|
+
)
|
|
128
|
+
return cls.parse_obj(data)
|
|
129
|
+
|
|
130
|
+
@classmethod
|
|
131
|
+
def retrieve_private(cls, id: str) -> "HubComponent":
|
|
132
|
+
hub_client = get_hub_client()
|
|
133
|
+
data = hub_client.private.get(
|
|
134
|
+
resource_type=cls.__name__, id=id, first=True
|
|
135
|
+
)
|
|
136
|
+
return cls.parse_obj(data)
|
|
137
|
+
|
|
138
|
+
@classmethod
|
|
139
|
+
def retrieve_setup(cls, id: str) -> "HubComponent":
|
|
140
|
+
hub_client = get_hub_client()
|
|
141
|
+
data = hub_client.setup.get(
|
|
142
|
+
resource_type=cls.__name__, id=id, first=True
|
|
143
|
+
)
|
|
144
|
+
return cls.parse_obj(data)
|
|
145
|
+
|
|
146
|
+
def delete(self):
|
|
147
|
+
return self._hub_client.mine.delete(self.id)
|
|
148
|
+
|
|
149
|
+
def download(self):
|
|
150
|
+
return self._hub_client.download(data=self.dict())
|
|
151
|
+
|
|
152
|
+
@classmethod
|
|
153
|
+
def upload(cls, path: str):
|
|
154
|
+
hub_client = get_hub_client()
|
|
155
|
+
spec = get_spec(path)
|
|
156
|
+
name = spec["name"]
|
|
157
|
+
version = spec["version"]
|
|
158
|
+
file_name = f"{name}-{version}.{COMPRESSION_TYPE}"
|
|
159
|
+
ignore_pathspec = get_ignore_pathspec(path)
|
|
160
|
+
versioned_name = f"{name}-{version}"
|
|
161
|
+
readme_path = os.path.join(path, README_FILE_1)
|
|
162
|
+
if not os.path.exists(readme_path):
|
|
163
|
+
readme_path = os.path.join(path, README_FILE_2)
|
|
164
|
+
with py7zr.SevenZipFile(file_name, "w") as archive:
|
|
165
|
+
for root, _, files in os.walk(path):
|
|
166
|
+
if ignore_pathspec and ignore_pathspec.match_file(root):
|
|
167
|
+
continue
|
|
168
|
+
for file in files:
|
|
169
|
+
if ignore_pathspec and ignore_pathspec.match_file(
|
|
170
|
+
os.path.join(root, file)
|
|
171
|
+
):
|
|
172
|
+
continue
|
|
173
|
+
filepath = os.path.join(root, file)
|
|
174
|
+
archive.write(filepath, os.path.join(versioned_name, file))
|
|
175
|
+
data = {
|
|
176
|
+
"name": name,
|
|
177
|
+
"version": version,
|
|
178
|
+
"splight_cli_version": spec["splight_cli_version"],
|
|
179
|
+
"privacy_policy": spec.get("privacy_policy", "private"),
|
|
180
|
+
"tags": spec.get("tags", []),
|
|
181
|
+
"custom_types": json.dumps(spec.get("custom_types", [])),
|
|
182
|
+
"input": json.dumps(spec.get("input", [])),
|
|
183
|
+
"output": json.dumps(spec.get("output", [])),
|
|
184
|
+
"component_type": spec.get(
|
|
185
|
+
"component_type", ComponentType.CONNECTOR.value
|
|
186
|
+
),
|
|
187
|
+
"commands": json.dumps(spec.get("commands", [])),
|
|
188
|
+
"bindings": json.dumps(spec.get("bindings", [])),
|
|
189
|
+
"endpoints": json.dumps(spec.get("endpoints", [])),
|
|
190
|
+
}
|
|
191
|
+
files = {
|
|
192
|
+
"file": open(file_name, "rb"),
|
|
193
|
+
"readme": open(readme_path, "rb"),
|
|
194
|
+
}
|
|
195
|
+
component = hub_client.upload(data=data, files=files)
|
|
196
|
+
if os.path.exists(file_name):
|
|
197
|
+
os.remove(file_name)
|
|
198
|
+
return cls.parse_obj(component)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
class HubComponentVersion(HubComponent):
|
|
202
|
+
pass
|
|
@@ -29,8 +29,8 @@ def yml_config_setting(settings: BaseSettings) -> Dict[str, Any]:
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
class SplightSettings(BaseSettings, Singleton):
|
|
32
|
-
SPLIGHT_ACCESS_ID: str
|
|
33
|
-
SPLIGHT_SECRET_KEY: str
|
|
32
|
+
SPLIGHT_ACCESS_ID: str = ""
|
|
33
|
+
SPLIGHT_SECRET_KEY: str = ""
|
|
34
34
|
SPLIGHT_PLATFORM_API_HOST: str = "https://api.splight-ai.com"
|
|
35
35
|
|
|
36
36
|
# Parameters for local environment
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from typing import Any, Dict, List
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
from pytest_mock import MockerFixture
|
|
7
|
+
|
|
8
|
+
from splight_lib.component.spec import Spec
|
|
9
|
+
from splight_lib.models import (
|
|
10
|
+
Asset,
|
|
11
|
+
Attribute,
|
|
12
|
+
Component,
|
|
13
|
+
ComponentObjectInstance,
|
|
14
|
+
File,
|
|
15
|
+
)
|
|
16
|
+
from splight_lib.models.component import CustomType, Parameter
|
|
17
|
+
from splight_lib.settings import settings
|
|
18
|
+
|
|
19
|
+
settings.configure(LOCAL_ENVIRONMENT=True)
|
|
20
|
+
|
|
21
|
+
FAKE_NATIVE_VALUES = {
|
|
22
|
+
"int": 1,
|
|
23
|
+
"bool": True,
|
|
24
|
+
"str": "fake",
|
|
25
|
+
"float": 5.5,
|
|
26
|
+
"datetime": datetime(2022, 12, 18),
|
|
27
|
+
"url": "www.google.com",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
FAKE_DATABASE_VALUES = {
|
|
31
|
+
"Component": Component(name="ComponentTest", version="1.0.0"),
|
|
32
|
+
"Asset": Asset(name="AssetTest"),
|
|
33
|
+
"Attribute": Attribute(name="AttrTest"),
|
|
34
|
+
"File": File(file=""),
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def get_test_value(type_: str, custom_types: Dict[str, CustomType]) -> Any:
|
|
39
|
+
if type_ in FAKE_NATIVE_VALUES:
|
|
40
|
+
value = FAKE_NATIVE_VALUES.get(type_)
|
|
41
|
+
elif type_ in FAKE_DATABASE_VALUES:
|
|
42
|
+
value = FAKE_DATABASE_VALUES.get(type_)
|
|
43
|
+
else:
|
|
44
|
+
custom_type_def = custom_types[type_]
|
|
45
|
+
model_class = ComponentObjectInstance.from_custom_type(custom_type_def)
|
|
46
|
+
aux_value = component_object_attributes(
|
|
47
|
+
custom_type_def.fields, custom_types
|
|
48
|
+
)
|
|
49
|
+
value = model_class.parse_obj(aux_value)
|
|
50
|
+
return value
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def component_object_attributes(
|
|
54
|
+
parameters: List[Parameter], custom_types: Dict[str, CustomType]
|
|
55
|
+
) -> Dict[str, Any]:
|
|
56
|
+
values_dict = {
|
|
57
|
+
param.name: get_test_value(param.type, custom_types)
|
|
58
|
+
for param in parameters
|
|
59
|
+
}
|
|
60
|
+
return values_dict
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def get_test_input(spec: Spec):
|
|
64
|
+
input_model_class = spec.get_input_model()
|
|
65
|
+
custom_types = {ct.name: ct for ct in spec.custom_types}
|
|
66
|
+
input_fake_values = {}
|
|
67
|
+
for param in spec.input:
|
|
68
|
+
param_name = param.name
|
|
69
|
+
type_ = param.type
|
|
70
|
+
value = get_test_value(type_, custom_types)
|
|
71
|
+
|
|
72
|
+
if param.multiple:
|
|
73
|
+
value = [value]
|
|
74
|
+
|
|
75
|
+
input_fake_values.update({param_name: value})
|
|
76
|
+
return input_model_class.parse_obj(input_fake_values)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@pytest.fixture(autouse=True)
|
|
80
|
+
def mock_component(mocker: MockerFixture):
|
|
81
|
+
# Patch method for checking duplicated component
|
|
82
|
+
mocker.patch(
|
|
83
|
+
(
|
|
84
|
+
"splight_lib.component.abstract.SplightBaseComponent."
|
|
85
|
+
"_check_duplicated_component"
|
|
86
|
+
),
|
|
87
|
+
return_value=None,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
# Patch HealthCheckProcessor
|
|
91
|
+
mocker.patch(
|
|
92
|
+
"splight_lib.execution.ExecutionClient.start", return_value=None
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
base_path = os.getcwd()
|
|
96
|
+
spec = Spec.from_file(os.path.join(base_path, "spec.json"))
|
|
97
|
+
# Generate fake input for testing
|
|
98
|
+
mocker.patch(
|
|
99
|
+
"splight_lib.component.spec.Spec.component_input",
|
|
100
|
+
return_value=get_test_input(spec),
|
|
101
|
+
)
|
|
102
|
+
return mocker
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import Any, Dict, Optional
|
|
3
|
+
import pathspec
|
|
4
|
+
import json
|
|
5
|
+
|
|
6
|
+
SPLIGHT_IGNORE = ".splightignore"
|
|
7
|
+
COMPRESSION_TYPE = "7z"
|
|
8
|
+
SPEC_FILE = "spec.json"
|
|
9
|
+
README_FILE_1 = "README.md"
|
|
10
|
+
README_FILE_2 = "README"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get_spec(path: str) -> Dict[str, Any]:
|
|
14
|
+
with open(os.path.join(path, SPEC_FILE)) as fid:
|
|
15
|
+
return json.load(fid)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def get_ignore_pathspec(path: str) -> Optional[pathspec.PathSpec]:
|
|
19
|
+
try:
|
|
20
|
+
with open(
|
|
21
|
+
os.path.join(path, SPLIGHT_IGNORE), "r"
|
|
22
|
+
) as splightignore:
|
|
23
|
+
return pathspec.PathSpec.from_lines(
|
|
24
|
+
"gitwildmatch", splightignore
|
|
25
|
+
)
|
|
26
|
+
except FileNotFoundError:
|
|
27
|
+
return None
|
|
@@ -72,5 +72,7 @@ splight_lib/restclient/__init__.py
|
|
|
72
72
|
splight_lib/restclient/client.py
|
|
73
73
|
splight_lib/restclient/exceptions.py
|
|
74
74
|
splight_lib/restclient/types.py
|
|
75
|
+
splight_lib/testing/__init__.py
|
|
75
76
|
splight_lib/utils/__init__.py
|
|
76
|
-
splight_lib/utils/custom_model.py
|
|
77
|
+
splight_lib/utils/custom_model.py
|
|
78
|
+
splight_lib/utils/hub.py
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
from typing import List, Optional
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel, validator
|
|
4
|
-
|
|
5
|
-
VERIFICATION_CHOICES = ["verified", "unverified", "official"]
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class HubComponent(BaseModel):
|
|
9
|
-
id: Optional[str]
|
|
10
|
-
name: str
|
|
11
|
-
splight_cli_version: str
|
|
12
|
-
build_status: Optional[str]
|
|
13
|
-
description: Optional[str]
|
|
14
|
-
privacy_policy: Optional[str] = None
|
|
15
|
-
component_type: Optional[str] = None
|
|
16
|
-
tenant: Optional[str] = None
|
|
17
|
-
readme: Optional[str]
|
|
18
|
-
picture: Optional[str]
|
|
19
|
-
file: Optional[str]
|
|
20
|
-
verification: Optional[str]
|
|
21
|
-
created_at: Optional[str]
|
|
22
|
-
last_modified: Optional[str]
|
|
23
|
-
tags: List[str] = []
|
|
24
|
-
min_component_capacity: Optional[str]
|
|
25
|
-
usage_count: int = 0
|
|
26
|
-
|
|
27
|
-
@validator("verification", pre=True, always=True)
|
|
28
|
-
def set_verification_now(cls, v):
|
|
29
|
-
if v:
|
|
30
|
-
assert v in VERIFICATION_CHOICES, "Verification value not allowed."
|
|
31
|
-
return v
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class HubComponentVersion(HubComponent):
|
|
35
|
-
pass
|
|
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
|
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/__init__.py
RENAMED
|
File without changes
|
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/abstract.py
RENAMED
|
File without changes
|
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/classmap.py
RENAMED
|
File without changes
|
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/exceptions.py
RENAMED
|
File without changes
|
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/local_client.py
RENAMED
|
File without changes
|
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/communication/remote_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/client/database/local_client.py
RENAMED
|
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
|
{splight-lib-3.0.0.dev1 → splight-lib-3.0.0.dev3}/splight_lib/communication/event_handler.py
RENAMED
|
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
|
|
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
|