kmisc 2.1.110__py3-none-any.whl → 2.1.111__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.
kmisc/__init__.py CHANGED
@@ -2858,13 +2858,21 @@ def net_put_data(IP,data,PORT=8805,key='kg',timeout=3,try_num=1,try_wait=[1,10],
2858
2858
 
2859
2859
  def encode(string):
2860
2860
  enc='{0}'.format(string)
2861
- tmp=zlib.compress(enc.encode("utf-8"))
2862
- return '{0}'.format(base64.b64encode(tmp).decode('utf-8'))
2861
+ try:
2862
+ tmp=zlib.compress(enc.encode("utf-8"))
2863
+ return '{0}'.format(base64.b64encode(tmp).decode('utf-8'))
2864
+ except Exception as e:
2865
+ printf('Issue for {}:\n{}'.format(string,e),mode='e')
2866
+ return False
2863
2867
 
2864
2868
  def decode(string):
2865
2869
  if type(string) is str:
2866
- dd=zlib.decompress(base64.b64decode(string))
2867
- return '{0}'.format(dd.decode("utf-8"))
2870
+ try:
2871
+ dd=zlib.decompress(base64.b64decode(string))
2872
+ return '{0}'.format(dd.decode("utf-8"))
2873
+ except Exception as e:
2874
+ printf('Issue for {}:\n{}'.format(string,e),mode='e')
2875
+ return False
2868
2876
  return string
2869
2877
 
2870
2878
  def get_node_info(loop=0):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kmisc
3
- Version: 2.1.110
3
+ Version: 2.1.111
4
4
  Summary: Enginering useful library
5
5
  Home-page: https://github.com/kagepark/kmisc
6
6
  Author: Kage Park
@@ -0,0 +1,6 @@
1
+ kmisc/__init__.py,sha256=DrazyN4Ku-mi5iRFDUBBAaN7Dl2m7-yuJb-70n6bGiI,135659
2
+ kmisc-2.1.111.dist-info/LICENSE,sha256=mn9ekhb34HJxsrVhcxrLXJUzy55T62zg-Gh9Ro0mVJI,1066
3
+ kmisc-2.1.111.dist-info/METADATA,sha256=tZKVamycHTGePi6CqHSMN4_i0ZAiDnQSa1fWKOty_rQ,5523
4
+ kmisc-2.1.111.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
5
+ kmisc-2.1.111.dist-info/top_level.txt,sha256=wvdHf5aQTqcGYvxk-F9E_BMWLMhlwC8INBmwO-V6_X4,6
6
+ kmisc-2.1.111.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- kmisc/__init__.py,sha256=KvOI3bqqfV6BPXDuUjYqusq7hYnx7bTqHpIX880hXeU,135389
2
- kmisc-2.1.110.dist-info/LICENSE,sha256=mn9ekhb34HJxsrVhcxrLXJUzy55T62zg-Gh9Ro0mVJI,1066
3
- kmisc-2.1.110.dist-info/METADATA,sha256=U-mK3R2pVKlcIGBFzO6v6ZxIWFg0wjd3dz1Mb6dn31k,5523
4
- kmisc-2.1.110.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
5
- kmisc-2.1.110.dist-info/top_level.txt,sha256=wvdHf5aQTqcGYvxk-F9E_BMWLMhlwC8INBmwO-V6_X4,6
6
- kmisc-2.1.110.dist-info/RECORD,,