kmisc 2.1.90__tar.gz → 2.1.91__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.
- {kmisc-2.1.90 → kmisc-2.1.91}/PKG-INFO +1 -1
- {kmisc-2.1.90 → kmisc-2.1.91}/kmisc/__init__.py +7 -7
- {kmisc-2.1.90 → kmisc-2.1.91}/kmisc.egg-info/PKG-INFO +1 -1
- {kmisc-2.1.90 → kmisc-2.1.91}/LICENSE +0 -0
- {kmisc-2.1.90 → kmisc-2.1.91}/README.md +0 -0
- {kmisc-2.1.90 → kmisc-2.1.91}/kmisc.egg-info/SOURCES.txt +0 -0
- {kmisc-2.1.90 → kmisc-2.1.91}/kmisc.egg-info/dependency_links.txt +0 -0
- {kmisc-2.1.90 → kmisc-2.1.91}/kmisc.egg-info/top_level.txt +0 -0
- {kmisc-2.1.90 → kmisc-2.1.91}/pyproject.toml +0 -0
- {kmisc-2.1.90 → kmisc-2.1.91}/setup.cfg +0 -0
- {kmisc-2.1.90 → kmisc-2.1.91}/setup.py +0 -0
@@ -2190,10 +2190,10 @@ def save_file(data,dest=None,filename=None,force=False):
|
|
2190
2190
|
sub_dir='{}'.format(dest)
|
2191
2191
|
if not os.path.isdir(sub_dir):
|
2192
2192
|
os.system('mkdir -p {}'.format(sub_dir))
|
2193
|
-
if ii.get('path_mode'): os.chmod(
|
2193
|
+
if ii.get('path_mode'): os.chmod(sub_dir,file_mode(ii.get('path_mode')))
|
2194
2194
|
sub_file=os.path.join(sub_dir,ii['name'])
|
2195
2195
|
with open(sub_file,'wb') as f:
|
2196
|
-
f.write(ii['data'])
|
2196
|
+
f.write(Bytes(ii['data']))
|
2197
2197
|
if ii.get('mode'): os.chmod(sub_file,file_mode(ii.get('mode')))
|
2198
2198
|
else:
|
2199
2199
|
# if file then save
|
@@ -2205,7 +2205,7 @@ def save_file(data,dest=None,filename=None,force=False):
|
|
2205
2205
|
else:
|
2206
2206
|
new_file=dest
|
2207
2207
|
with open(new_file,'wb') as f:
|
2208
|
-
f.write(data.get('data',''))
|
2208
|
+
f.write(Bytes(data.get('data','')))
|
2209
2209
|
chmod_mode=file_mode(data.get('mode'))
|
2210
2210
|
if chmod_mode: os.chmod(new_file,chmod_mode)
|
2211
2211
|
return True
|
@@ -2441,11 +2441,11 @@ def net_send_data(sock,data,key='kg',enc=False,timeout=0,instant=False,log=None,
|
|
2441
2441
|
|
2442
2442
|
def net_receive_data(sock,key='kg',progress=None,retry=0,retry_timeout=30,progress_msg=None,log=None,err_scr=True):
|
2443
2443
|
# decode code here
|
2444
|
-
ok,size,data_type,enc=packet_head(sock)
|
2444
|
+
ok,size,data_type,enc=packet_head(sock,retry=retry,timeout=retry_timeout)
|
2445
2445
|
if krc(ok,chk=True):
|
2446
2446
|
# File not found Error log size is 57. So if 57 then ignore progress
|
2447
2447
|
if size == 57: progress=False
|
2448
|
-
data_ok,data=packet_receive_all(sock,size,progress=progress,progress_msg=progress_msg,log=log,retry=retry,err_scr=err_scr)
|
2448
|
+
data_ok,data=packet_receive_all(sock,size,progress=progress,progress_msg=progress_msg,log=log,retry=retry,retry_timeout=retry_timeout,err_scr=err_scr)
|
2449
2449
|
if krc(data_ok,chk=True):
|
2450
2450
|
real_data=packet_dec(data,enc,key=key)
|
2451
2451
|
if real_data: return [data_type,real_data]
|
@@ -2472,12 +2472,12 @@ def net_put_and_get_data(IP,data,PORT=8805,key='kg',timeout=3,try_num=1,try_wait
|
|
2472
2472
|
rtry_wait=try_wait
|
2473
2473
|
sent=False,'Unknown issue',sock
|
2474
2474
|
try:
|
2475
|
-
sent=net_send_data(sock,data,key=key,enc=enc,log=log,err_scr=err_scr)
|
2475
|
+
sent=net_send_data(sock,data,key=key,enc=enc,log=log,err_scr=err_scr,timeout=timeout)
|
2476
2476
|
except:
|
2477
2477
|
os.system("""[ -f /tmp/.{0}.{1}.crt ] && rm -f /tmp/.{0}.{1}.crt""".format(IP,PORT))
|
2478
2478
|
continue
|
2479
2479
|
if sent[0]:
|
2480
|
-
nrcd=net_receive_data(sock,key=key,progress=progress,progress_msg=progress_msg,log=log,err_scr=err_scr)
|
2480
|
+
nrcd=net_receive_data(sock,key=key,progress=progress,progress_msg=progress_msg,log=log,err_scr=err_scr,retry=2,retry_timeout=timeout)
|
2481
2481
|
return nrcd+[sock]
|
2482
2482
|
else:
|
2483
2483
|
if timeout >0:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|