mss-python 0.2.0__py3-none-any.whl → 0.2.1__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
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.2.0'
16
- __version_tuple__ = version_tuple = (0, 2, 0)
15
+ __version__ = version = '0.2.1'
16
+ __version_tuple__ = version_tuple = (0, 2, 1)
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
1
  Metadata-Version: 2.1
2
2
  Name: mss-python
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: MSS API wrapper for Python projects
5
5
  Author: Rubin Canaj
6
6
  Author-email: HGV <development@hgv.it>
@@ -0,0 +1,11 @@
1
+ mss_python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ mss_python/_version.py,sha256=MxUhzLJIZQfEpDTTcKSxciTGrMLd5v2VmMlHa2HGeo0,411
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.1.dist-info/LICENSE,sha256=SxLvAIuAvi2G5v6pRCopG3gAH9SLL_-xACJ0QBz_Blw,1074
8
+ mss_python-0.2.1.dist-info/METADATA,sha256=7Fl1pumuEWeDxPz4M7u28_e954zrwpH76i7r1tT_LV4,3044
9
+ mss_python-0.2.1.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
10
+ mss_python-0.2.1.dist-info/top_level.txt,sha256=-5Wm4NpowVgq9ImH61vhAiBQFoE21fg4r-7Pn7mOYyE,11
11
+ mss_python-0.2.1.dist-info/RECORD,,
@@ -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,,