mss-python 0.2.0__py3-none-any.whl → 0.2.2__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.
mss_python/_version.py CHANGED
@@ -1,16 +1,34 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
12
+
3
13
  TYPE_CHECKING = False
4
14
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
15
+ from typing import Tuple
16
+ from typing import Union
17
+
6
18
  VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
7
20
  else:
8
21
  VERSION_TUPLE = object
22
+ COMMIT_ID = object
9
23
 
10
24
  version: str
11
25
  __version__: str
12
26
  __version_tuple__: VERSION_TUPLE
13
27
  version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
30
+
31
+ __version__ = version = '0.2.2'
32
+ __version_tuple__ = version_tuple = (0, 2, 2)
14
33
 
15
- __version__ = version = '0.2.0'
16
- __version_tuple__ = version_tuple = (0, 2, 0)
34
+ __commit_id__ = commit_id = None
mss_python/client.py CHANGED
@@ -32,6 +32,17 @@ def change_structure(root: Root, child: BaseType):
32
32
  return root
33
33
 
34
34
 
35
+ # Replace all picture urls with the new, cdn ones
36
+ def replace_picture_urls(path, key, value):
37
+ if key == "url" and path[-2][0] == "picture":
38
+ return key, value.replace(
39
+ "https://easychannel.it/mss/mss_renderimg.php?",
40
+ "https://cdn.easychannel.it/mss/mss_renderimg.php?",
41
+ )
42
+ else:
43
+ return key, value
44
+
45
+
35
46
  class Client:
36
47
  def __init__(
37
48
  self, cred: Credentials, lang: list, elements: list | None = None
@@ -70,7 +81,9 @@ class Client:
70
81
  headers={"Content-Type": "application/xml"},
71
82
  )
72
83
 
73
- responseRoot = xmltodict.parse(response.content)
84
+ responseRoot = xmltodict.parse(
85
+ response.content, postprocessor=replace_picture_urls
86
+ )
74
87
  error = responseRoot["root"]["header"]["error"]
75
88
  if int(error["code"]) > 0:
76
89
  raise Exception(
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: mss-python
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: MSS API wrapper for Python projects
5
5
  Author: Rubin Canaj
6
6
  Author-email: HGV <development@hgv.it>
@@ -27,10 +27,11 @@ License: MIT License
27
27
  SOFTWARE.
28
28
 
29
29
  Project-URL: Repository, https://github.com/bookingsuedtirol/mss-python
30
- Requires-Python: <4,>=3.7
30
+ Requires-Python: <4,>=3.12
31
31
  Description-Content-Type: text/markdown
32
32
  License-File: LICENSE
33
- Requires-Dist: xmltodict ==0.13.0
33
+ Requires-Dist: xmltodict==1.0.2
34
+ Dynamic: license-file
34
35
 
35
36
  # mss-python ![PyPI](https://img.shields.io/pypi/v/mss-python)
36
37
 
@@ -0,0 +1,11 @@
1
+ mss_python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ mss_python/_version.py,sha256=o3ZTescp-19Z9cvBGq9dQnbppljgzdUYUf98Nov0spY,704
3
+ mss_python/client.py,sha256=Vles3gKsXWGqwyvfRequYv9vPcQ6iJAJIPrriYSXWtM,3646
4
+ mss_python/request/method_names.py,sha256=DP22Tra-F86FP-6771q7bDwuX6ojPCidFPzztl4UThI,1030
5
+ mss_python/request/methods.py,sha256=pu_U6z8ANktuv0r3P6MmLKW66fwRhiDCp261vNxqrYE,664
6
+ mss_python/request/types_mss.py,sha256=Xq9YYA5-f_j2Gt7bCcHSC6qEzHs0hswpoXm2IGB9SdA,22354
7
+ mss_python-0.2.2.dist-info/licenses/LICENSE,sha256=SxLvAIuAvi2G5v6pRCopG3gAH9SLL_-xACJ0QBz_Blw,1074
8
+ mss_python-0.2.2.dist-info/METADATA,sha256=siHA8IH7WATkAqJPSzhClenxnjDS1-c_MggdN-yVdCM,3065
9
+ mss_python-0.2.2.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
10
+ mss_python-0.2.2.dist-info/top_level.txt,sha256=-5Wm4NpowVgq9ImH61vhAiBQFoE21fg4r-7Pn7mOYyE,11
11
+ mss_python-0.2.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (82.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,11 +0,0 @@
1
- mss_python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- mss_python/_version.py,sha256=H-qsvrxCpdhaQzyddR-yajEqI71hPxLa4KxzpP3uS1g,411
3
- mss_python/client.py,sha256=xZzS7Z8M5PhehybTvvd80z1egglaKdmNf12OFJ9Fy4Y,3235
4
- mss_python/request/method_names.py,sha256=DP22Tra-F86FP-6771q7bDwuX6ojPCidFPzztl4UThI,1030
5
- mss_python/request/methods.py,sha256=pu_U6z8ANktuv0r3P6MmLKW66fwRhiDCp261vNxqrYE,664
6
- mss_python/request/types_mss.py,sha256=Xq9YYA5-f_j2Gt7bCcHSC6qEzHs0hswpoXm2IGB9SdA,22354
7
- mss_python-0.2.0.dist-info/LICENSE,sha256=SxLvAIuAvi2G5v6pRCopG3gAH9SLL_-xACJ0QBz_Blw,1074
8
- mss_python-0.2.0.dist-info/METADATA,sha256=zju6HDTVHw9fG36Y2cyMaRZKAQ8C1H5SFy0cc2bIffU,3044
9
- mss_python-0.2.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
10
- mss_python-0.2.0.dist-info/top_level.txt,sha256=-5Wm4NpowVgq9ImH61vhAiBQFoE21fg4r-7Pn7mOYyE,11
11
- mss_python-0.2.0.dist-info/RECORD,,