logs-py 1.7__py3-none-any.whl → 1.8__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 logs-py might be problematic. Click here for more details.
- LOGS/Auxiliary/Tools.py +29 -1
- LOGS/Entities/DatasetCreator.py +8 -1
- LOGS/Entity/EntityRequestParameter.py +3 -3
- {logs_py-1.7.dist-info → logs_py-1.8.dist-info}/METADATA +1 -1
- {logs_py-1.7.dist-info → logs_py-1.8.dist-info}/RECORD +7 -7
- {logs_py-1.7.dist-info → logs_py-1.8.dist-info}/WHEEL +0 -0
- {logs_py-1.7.dist-info → logs_py-1.8.dist-info}/top_level.txt +0 -0
LOGS/Auxiliary/Tools.py
CHANGED
|
@@ -2,6 +2,7 @@ import os
|
|
|
2
2
|
import string
|
|
3
3
|
from datetime import datetime
|
|
4
4
|
from enum import Enum
|
|
5
|
+
import sys
|
|
5
6
|
from typing import (
|
|
6
7
|
Any,
|
|
7
8
|
Callable,
|
|
@@ -21,13 +22,40 @@ from regex import Regex
|
|
|
21
22
|
|
|
22
23
|
from LOGS.Auxiliary.DateTimeConverter import DateTimeConverter
|
|
23
24
|
|
|
25
|
+
|
|
26
|
+
class Unbuffered(object):
|
|
27
|
+
def __init__(self, stream):
|
|
28
|
+
self.stream = stream
|
|
29
|
+
|
|
30
|
+
def write(self, data):
|
|
31
|
+
self.stream.write(data)
|
|
32
|
+
self.stream.flush()
|
|
33
|
+
|
|
34
|
+
def writelines(self, data):
|
|
35
|
+
self.stream.writelines(data)
|
|
36
|
+
self.stream.flush()
|
|
37
|
+
|
|
38
|
+
def __getattr__(self, attr):
|
|
39
|
+
return getattr(self.stream, attr)
|
|
40
|
+
|
|
41
|
+
|
|
24
42
|
_T = TypeVar("_T")
|
|
25
43
|
|
|
26
44
|
|
|
45
|
+
class UnbufferedStdout(Unbuffered):
|
|
46
|
+
def __init__(self):
|
|
47
|
+
super().__init__(sys.stdout)
|
|
48
|
+
|
|
49
|
+
|
|
27
50
|
class Tools:
|
|
28
51
|
messageStrMaxLength = 25
|
|
29
52
|
__byteUnits = ["", "K", "M", "G", "T", "P", "E", "Z"]
|
|
30
53
|
|
|
54
|
+
@classmethod
|
|
55
|
+
def unbufferStdout(cls):
|
|
56
|
+
unbuffered = UnbufferedStdout()
|
|
57
|
+
sys.stdout = cast(Any, unbuffered)
|
|
58
|
+
|
|
31
59
|
@classmethod
|
|
32
60
|
def getHumanReadableSize(cls, size, suffix="B"):
|
|
33
61
|
for unit in cls.__byteUnits:
|
|
@@ -88,7 +116,7 @@ class Tools:
|
|
|
88
116
|
if isinstance(count, (list, set)):
|
|
89
117
|
count = len(count)
|
|
90
118
|
|
|
91
|
-
if count
|
|
119
|
+
if count == 1:
|
|
92
120
|
return word
|
|
93
121
|
|
|
94
122
|
return cls.wordToPlural(word)
|
LOGS/Entities/DatasetCreator.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
|
-
from typing import Any, List, Optional
|
|
2
|
+
from typing import TYPE_CHECKING, Any, List, Optional
|
|
3
3
|
|
|
4
4
|
from LOGS.Auxiliary.Decorators import Endpoint
|
|
5
5
|
from LOGS.Auxiliary.Exceptions import EntityCreatingException, LOGSException
|
|
@@ -10,6 +10,9 @@ from LOGS.Entity.EntityConnector import EntityConnector
|
|
|
10
10
|
from LOGS.Entity.SerializeableContent import SerializeableClass
|
|
11
11
|
from LOGS.LOGSConnection import LOGSConnection, MultipartEntry
|
|
12
12
|
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from LOGS.Entities.PersonMinimal import PersonMinimal
|
|
15
|
+
|
|
13
16
|
|
|
14
17
|
class DatasetSourceType(Enum):
|
|
15
18
|
ManualUpload = 0
|
|
@@ -29,6 +32,7 @@ class DatasetUploadRequest(SerializeableClass):
|
|
|
29
32
|
self.sourceType: DatasetSourceType = DatasetSourceType.APIUpload
|
|
30
33
|
self.datasetType: Optional[str] = None
|
|
31
34
|
self.name: Optional[str] = None
|
|
35
|
+
self.ownerId: Optional[int] = None
|
|
32
36
|
self.methodId: Optional[int] = None
|
|
33
37
|
self.instrumentId: Optional[int] = None
|
|
34
38
|
self.experimentId: Optional[int] = None
|
|
@@ -43,6 +47,8 @@ class DatasetUploadRequest(SerializeableClass):
|
|
|
43
47
|
self.name = ref.name
|
|
44
48
|
if ref.format.id:
|
|
45
49
|
self.parserId = ref.format.id
|
|
50
|
+
if ref.owner:
|
|
51
|
+
self.ownerId = ref.owner.id
|
|
46
52
|
if ref._files:
|
|
47
53
|
self.files = ref._files
|
|
48
54
|
if ref.method:
|
|
@@ -98,6 +104,7 @@ class DatasetCreator(EntityConnector):
|
|
|
98
104
|
for file in self._files
|
|
99
105
|
]
|
|
100
106
|
)
|
|
107
|
+
|
|
101
108
|
data, errors = connection.postMultipartEndpoint(
|
|
102
109
|
endpoint=endpoint + ["create"], data=multipart
|
|
103
110
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from enum import Enum
|
|
3
|
-
from typing import Any, List, Optional,
|
|
3
|
+
from typing import Any, List, Optional, Union
|
|
4
4
|
|
|
5
5
|
from LOGS.Entity.SerializeableContent import SerializeableClass
|
|
6
6
|
from LOGS.Interfaces.IPaginationRequest import IPaginationRequest
|
|
@@ -14,9 +14,9 @@ class DefaultOrder(Enum):
|
|
|
14
14
|
@dataclass
|
|
15
15
|
class EntityRequestParameter(SerializeableClass, IPaginationRequest):
|
|
16
16
|
_noSerialize = ["asString"]
|
|
17
|
-
excludeIds: Optional[List[
|
|
17
|
+
excludeIds: Optional[Union[List[int], List[str]]] = None
|
|
18
18
|
searchTerm: Optional[str] = None
|
|
19
|
-
ids: Optional[
|
|
19
|
+
ids: Optional[Union[List[int], List[str]]] = None
|
|
20
20
|
includeCount: Optional[bool] = None
|
|
21
21
|
includeRelations: Optional[bool] = True
|
|
22
22
|
orderby: Any = None
|
|
@@ -8,7 +8,7 @@ LOGS/Auxiliary/Decorators.py,sha256=dzuIa6eTi-iOwhD9A8eICum9XIFeh6QdcKrNWKQ4LEo,
|
|
|
8
8
|
LOGS/Auxiliary/Exceptions.py,sha256=9FdIFimzqB9YtW45qEFGQvo5w0zjE1PSqM8c-BbG_L8,7410
|
|
9
9
|
LOGS/Auxiliary/MinimalModelGenerator.py,sha256=nxvtei9nFMepUf41TXlYIY50iOUjk6Y3epy3kqW_mzE,11175
|
|
10
10
|
LOGS/Auxiliary/ReplaceMessage.py,sha256=RLzsmocAHxh06GfrPzxfkA1e58Yp_0rfqrusv9_4_88,353
|
|
11
|
-
LOGS/Auxiliary/Tools.py,sha256=
|
|
11
|
+
LOGS/Auxiliary/Tools.py,sha256=Ax3HJKozLbxe4XjDhmKj5njgbWIfZh3uV-3Zdq2yz6I,9476
|
|
12
12
|
LOGS/Auxiliary/__init__.py,sha256=1EGkaXLM87nZzl85T-cqGc9FZMqZG57Ch0-HnicPqtQ,371
|
|
13
13
|
LOGS/Entities/AutoloadClientInfo.py,sha256=gcddncivwH1ohWeHU3hkkOWuBQanaAnsZnphj1kvPRk,2701
|
|
14
14
|
LOGS/Entities/AutoloadConfiguration.py,sha256=VGwPpYIpgHtMOZtpGaFIkW3VMWSRFNMwakpzsvKpVO8,4137
|
|
@@ -27,7 +27,7 @@ LOGS/Entities/AutoloadStatusError.py,sha256=44AWs6nn5RsVSdII3fNT8HtkuBfRNSU_xMJX
|
|
|
27
27
|
LOGS/Entities/AxisNaming.py,sha256=mje3aCK38OOMQhbMdPd0eNwUBc2e3DDPzjh5fDR7Pa0,749
|
|
28
28
|
LOGS/Entities/CustomSchema.py,sha256=8ACKbuC_nEZWstFBQvsChqEQmyGvrRxy9_tnFdU2A5Q,1185
|
|
29
29
|
LOGS/Entities/Dataset.py,sha256=XCWsIrHJwzxxq2XJyQ6WPAJd3jDFT4krmjNxA2y6TGw,19353
|
|
30
|
-
LOGS/Entities/DatasetCreator.py,sha256=
|
|
30
|
+
LOGS/Entities/DatasetCreator.py,sha256=_kTCX4AyZ4mNaMLfYb7YaVwuXzaQ6aCep8-JT9fLjm0,4531
|
|
31
31
|
LOGS/Entities/DatasetInfo.py,sha256=O8U54WwAPhBzP_N_kM-b6_oQnTt-4rUx0UynPceA5gk,3733
|
|
32
32
|
LOGS/Entities/DatasetMatchTypes.py,sha256=lwd2DWsb9689v5Ec7bz2GHb3d45z354o03EvM0LSg2Q,3538
|
|
33
33
|
LOGS/Entities/DatasetMatching.py,sha256=1tLYQKFMssOQIPuCh06dr70oYCpjj4bXer6VAO3papM,6596
|
|
@@ -134,7 +134,7 @@ LOGS/Entity/EntityMinimalWithStrId.py,sha256=JmuY0Aah4YLngrgluzwMkhIyeExj2j6kiBZ
|
|
|
134
134
|
LOGS/Entity/EntityMinimalWithType.py,sha256=ZFOenkc9s3OAlFAl10wFQLx9Lj6imQRmgWVO-bS_Slk,1300
|
|
135
135
|
LOGS/Entity/EntityRelation.py,sha256=UDCOcmyOo7zcysC3EgIBX6fzPrDBhSRzkYVuRHXlZ4Q,1482
|
|
136
136
|
LOGS/Entity/EntityRelations.py,sha256=zs-mJZZA01aUY0NI3HjXCYH2sjyaOsn9H_KP5M2Jx8M,1181
|
|
137
|
-
LOGS/Entity/EntityRequestParameter.py,sha256=
|
|
137
|
+
LOGS/Entity/EntityRequestParameter.py,sha256=KRrvP6WqZHnoIKUms5-pDXl-KHDcXbSMy7E_ROIx3L0,678
|
|
138
138
|
LOGS/Entity/EntityWithIntId.py,sha256=8_CWx5cDWxRYDaf75Z63lyrzmzE0md3PTnfFwxtYqCk,630
|
|
139
139
|
LOGS/Entity/EntityWithStrId.py,sha256=5hz8-F_t_X4kf85DMwW3DJ2NqH_RiRV1Io1WiMN11yk,631
|
|
140
140
|
LOGS/Entity/SerializeableContent.py,sha256=qVBuhHilaMsq3WrJt8qBNGSpFgW-FeUh0LgUrjD6VwM,18828
|
|
@@ -149,7 +149,7 @@ LOGS/Interfaces/IPaginationRequest.py,sha256=L0A5rul1B9r-g-xRqoPjLeDM0lpYXecLCJF
|
|
|
149
149
|
LOGS/Interfaces/ISoftDeletable.py,sha256=urnmSfcYJrEm1iIo0k3nyBvMMnpomJWAYAON_uvSX64,672
|
|
150
150
|
LOGS/Interfaces/IUniqueEntity.py,sha256=Ce1PyniuPdqzA-eMFyWW3bz6Wky4JR4yiL_Nl-c8NJ0,1933
|
|
151
151
|
LOGS/Interfaces/__init__.py,sha256=tGykqoQeT2_HV-oLYVKJJ9Z0a_Li8_y3AOJjG1btKYw,172
|
|
152
|
-
logs_py-1.
|
|
153
|
-
logs_py-1.
|
|
154
|
-
logs_py-1.
|
|
155
|
-
logs_py-1.
|
|
152
|
+
logs_py-1.8.dist-info/METADATA,sha256=CBoft2FdBPkL7H0DCqpyy1-bja_mwox4IFjhVySAIOY,2002
|
|
153
|
+
logs_py-1.8.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
154
|
+
logs_py-1.8.dist-info/top_level.txt,sha256=Ckn2LiAmGaR7k3tdEnKAc04z_uboMD4gLreYghRNdCs,5
|
|
155
|
+
logs_py-1.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|