solax-py-library 1.0.0.6__py3-none-any.whl → 1.0.0.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.
- solax_py_library/upload/core/upload_service/ftp.py +2 -2
- solax_py_library/upload/test/test_ftp.py +1 -1
- solax_py_library/upload/types/client.py +4 -4
- solax_py_library/upload/types/ftp.py +7 -6
- {solax_py_library-1.0.0.6.dist-info → solax_py_library-1.0.0.8.dist-info}/METADATA +1 -1
- {solax_py_library-1.0.0.6.dist-info → solax_py_library-1.0.0.8.dist-info}/RECORD +7 -7
- {solax_py_library-1.0.0.6.dist-info → solax_py_library-1.0.0.8.dist-info}/WHEEL +0 -0
@@ -55,13 +55,13 @@ class FTPUploadService(BaseUploadService):
|
|
55
55
|
print("Connection closed.")
|
56
56
|
|
57
57
|
def _parse(self, upload_data: FTPData) -> FTPParsedData:
|
58
|
-
if upload_data.file_type == FTPFileType.CSV:
|
58
|
+
if upload_data.file_type == FTPFileType.CSV.value:
|
59
59
|
parsed_data = CSVDataAdapter.parse_data(upload_data.data)
|
60
60
|
else:
|
61
61
|
raise NotImplementedError
|
62
62
|
return FTPParsedData(
|
63
63
|
file_name=upload_data.build_full_path(self.remote_path)
|
64
|
-
+ upload_data.file_type
|
64
|
+
+ FTPFileType.get_file_suffix(upload_data.file_type),
|
65
65
|
file_path=parsed_data,
|
66
66
|
)
|
67
67
|
|
@@ -1,17 +1,17 @@
|
|
1
|
-
from enum import
|
1
|
+
from enum import IntEnum
|
2
2
|
from pydantic import BaseModel
|
3
3
|
from typing import Optional, Union
|
4
4
|
|
5
5
|
from solax_py_library.upload.types.ftp import FTPData
|
6
6
|
|
7
7
|
|
8
|
-
class UploadType(
|
9
|
-
FTP =
|
8
|
+
class UploadType(IntEnum):
|
9
|
+
FTP = 1
|
10
10
|
|
11
11
|
|
12
12
|
class UploadData(BaseModel):
|
13
13
|
data: Optional[Union[dict, FTPData]]
|
14
|
-
upload_type:
|
14
|
+
upload_type: UploadType
|
15
15
|
|
16
16
|
def build_data(self):
|
17
17
|
dict_obj_data = self.data if isinstance(self.data, dict) else self.data.dict()
|
@@ -1,17 +1,18 @@
|
|
1
1
|
import os
|
2
|
-
from enum import
|
2
|
+
from enum import IntEnum
|
3
3
|
from typing import Any, Optional
|
4
4
|
|
5
5
|
from pydantic import BaseModel
|
6
6
|
|
7
7
|
|
8
|
-
class FTPFileType(
|
9
|
-
CSV =
|
8
|
+
class FTPFileType(IntEnum):
|
9
|
+
CSV = 1
|
10
10
|
|
11
|
-
|
11
|
+
@classmethod
|
12
|
+
def get_file_suffix(cls, value):
|
12
13
|
return {
|
13
|
-
FTPFileType.CSV: ".csv",
|
14
|
-
}.get(
|
14
|
+
FTPFileType.CSV.value: ".csv",
|
15
|
+
}.get(value)
|
15
16
|
|
16
17
|
|
17
18
|
class FTPData(BaseModel):
|
@@ -8,15 +8,15 @@ solax_py_library/upload/core/data_adapter/base.py,sha256=Va-SEe0eL3gobhNOnzHGkYB
|
|
8
8
|
solax_py_library/upload/core/data_adapter/csv.py,sha256=8nlnV_43mMAR3re50MQJymzT5HYpZOo7eSeMsEfnEVE,861
|
9
9
|
solax_py_library/upload/core/upload_service/__init__.py,sha256=uA-UeH31rDNxByeZwvPhNFHPV_-J8JyCev8geuc---k,269
|
10
10
|
solax_py_library/upload/core/upload_service/base.py,sha256=dxCBVtPxDhN7oRTjnwnjtc2XAF4hyIz9HsYCJePlggg,912
|
11
|
-
solax_py_library/upload/core/upload_service/ftp.py,sha256=
|
11
|
+
solax_py_library/upload/core/upload_service/ftp.py,sha256=QdGA-1OW2z-fkIWtjz_9O5gOKMNr1WjQ6NDrtea5E5s,2691
|
12
12
|
solax_py_library/upload/errors/__init__.py,sha256=pVAcSOXvlsPJW3PjHLBOdbl7KvntiYmz7TP0XuRwZ_A,243
|
13
13
|
solax_py_library/upload/errors/base.py,sha256=T01ZrZHF25PWgCrOv76Vhg26hds3I1Yy8Kl2LZRKOxo,258
|
14
14
|
solax_py_library/upload/errors/upload_error.py,sha256=9pCZzR_y3-VkBWSs5w7mMHYFRJjzVosIcxi-5SO8N1U,409
|
15
15
|
solax_py_library/upload/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
solax_py_library/upload/test/test_ftp.py,sha256=
|
16
|
+
solax_py_library/upload/test/test_ftp.py,sha256=kKzZ8AuDR-TXpn45Bv_-SqeyCEY2kh7MZKB1bbtI2Tk,1294
|
17
17
|
solax_py_library/upload/types/__init__.py,sha256=og9KBpYbcs36_S1izURj3vyHeuNOLJQrD9GpxK_JJaw,244
|
18
|
-
solax_py_library/upload/types/client.py,sha256=
|
19
|
-
solax_py_library/upload/types/ftp.py,sha256=
|
20
|
-
solax_py_library-1.0.0.
|
21
|
-
solax_py_library-1.0.0.
|
22
|
-
solax_py_library-1.0.0.
|
18
|
+
solax_py_library/upload/types/client.py,sha256=fG674_QEpOw3ibO171lcxJ0cz27yGR_sd3zgiyr4yuI,492
|
19
|
+
solax_py_library/upload/types/ftp.py,sha256=nOloYA_OHoGma1yg5ENWHzfIWK2hoBEwyoyJ72yRZjY,671
|
20
|
+
solax_py_library-1.0.0.8.dist-info/METADATA,sha256=Xxdv_wuNlPDUpELYrBoQLQ0VltX_UyCN1D7B6az6e0w,1791
|
21
|
+
solax_py_library-1.0.0.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
22
|
+
solax_py_library-1.0.0.8.dist-info/RECORD,,
|
File without changes
|