kmisc 2.1.109__tar.gz → 2.1.111__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kmisc
3
- Version: 2.1.109
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
@@ -38,12 +38,14 @@ from multiprocessing import Process, Queue
38
38
  from email.mime.multipart import MIMEMultipart
39
39
  try:
40
40
  from kmport import *
41
+ import kmport
41
42
  except:
42
43
  pip_user_install='--user' if os.environ.get('VIRTUAL_ENV') is None else ''
43
44
  os.system('''for i in 1 2 3 4 5; do python3 -m pip install pip --upgrade {} 2>&1 | grep "however version" |grep "is available" >& /dev/null || break; done'''.format(pip_user_install))
44
45
  os.system('python3 -m pip install kmport {}'.format(pip_user_install))
45
46
  try:
46
47
  from kmport import *
48
+ import kmport
47
49
  except:
48
50
  print('Can not install kmport')
49
51
  os._exit(1)
@@ -52,9 +54,11 @@ Import('import whois',install_name='python-whois')
52
54
  #Import('import whois') # it print some comment on screen
53
55
 
54
56
  global krc_define
57
+ global krc_ext
55
58
  global printf_log_base
56
59
  global printf_caller_tree
57
60
  global printf_caller_detail
61
+
58
62
  log_intro=3
59
63
  pipe_file=None
60
64
  log_new_line='\n'
@@ -2030,7 +2034,6 @@ def findXML(xmlfile,find_name=None,find_path=None,default=None,out='xmlobj',get_
2030
2034
  elif IsIn(out,['attrib','att','attr']):
2031
2035
  return found_path[0].attrib
2032
2036
  elif IsIn(out,['path','key','keys']):
2033
- print('>>',found_root[1],':',found_path[1])
2034
2037
  if found_root[1] is None:
2035
2038
  return found_path[1]
2036
2039
  return os.path.join(found_root[1],found_path[1])
@@ -2855,13 +2858,21 @@ def net_put_data(IP,data,PORT=8805,key='kg',timeout=3,try_num=1,try_wait=[1,10],
2855
2858
 
2856
2859
  def encode(string):
2857
2860
  enc='{0}'.format(string)
2858
- tmp=zlib.compress(enc.encode("utf-8"))
2859
- 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
2860
2867
 
2861
2868
  def decode(string):
2862
2869
  if type(string) is str:
2863
- dd=zlib.decompress(base64.b64decode(string))
2864
- 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
2865
2876
  return string
2866
2877
 
2867
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.109
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
File without changes
File without changes
File without changes
File without changes
File without changes