pywebexec 1.7.18__py3-none-any.whl → 1.7.19__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.
- pywebexec/pywebexec.py +3 -6
- pywebexec/version.py +2 -2
- {pywebexec-1.7.18.dist-info → pywebexec-1.7.19.dist-info}/METADATA +1 -1
- {pywebexec-1.7.18.dist-info → pywebexec-1.7.19.dist-info}/RECORD +8 -8
- {pywebexec-1.7.18.dist-info → pywebexec-1.7.19.dist-info}/LICENSE +0 -0
- {pywebexec-1.7.18.dist-info → pywebexec-1.7.19.dist-info}/WHEEL +0 -0
- {pywebexec-1.7.18.dist-info → pywebexec-1.7.19.dist-info}/entry_points.txt +0 -0
- {pywebexec-1.7.18.dist-info → pywebexec-1.7.19.dist-info}/top_level.txt +0 -0
pywebexec/pywebexec.py
CHANGED
@@ -405,14 +405,16 @@ def get_output_file_path(command_id):
|
|
405
405
|
def update_command_status(command_id, updates):
|
406
406
|
status_file_path = get_status_file_path(command_id)
|
407
407
|
status = read_command_status(command_id) or {}
|
408
|
+
status = status.copy()
|
408
409
|
status.update(updates)
|
409
410
|
if status.get('status') != 'running':
|
410
411
|
output_file_path = get_output_file_path(command_id)
|
411
412
|
if os.path.exists(output_file_path):
|
412
413
|
status['last_output_line'] = get_last_line(output_file_path, status.get('cols'), status.get('rows'))
|
413
|
-
status_cache[command_id] = status
|
414
414
|
with open(status_file_path, 'w') as f:
|
415
415
|
json.dump(status, f)
|
416
|
+
os.sync()
|
417
|
+
status_cache[command_id] = status
|
416
418
|
|
417
419
|
|
418
420
|
def read_command_status(command_id):
|
@@ -466,7 +468,6 @@ def run_command(fromip, user, command, params, command_id, rows, cols):
|
|
466
468
|
log_info(fromip, user, f'run_command {command_id}: {command_str(command, params)}')
|
467
469
|
start_time = datetime.now(timezone.utc).isoformat()
|
468
470
|
update_command_status(command_id, {
|
469
|
-
'status': 'running',
|
470
471
|
'command': command,
|
471
472
|
'params': params,
|
472
473
|
'start_time': start_time,
|
@@ -493,7 +494,6 @@ def run_command(fromip, user, command, params, command_id, rows, cols):
|
|
493
494
|
'status': 'aborted',
|
494
495
|
'end_time': end_time,
|
495
496
|
'exit_code': exit_code,
|
496
|
-
'user': user
|
497
497
|
})
|
498
498
|
log_info(fromip, user, f'run_command {command_id}: {command_str(command, params)}: command aborted')
|
499
499
|
else:
|
@@ -503,7 +503,6 @@ def run_command(fromip, user, command, params, command_id, rows, cols):
|
|
503
503
|
'status': 'success',
|
504
504
|
'end_time': end_time,
|
505
505
|
'exit_code': exit_code,
|
506
|
-
'user': user
|
507
506
|
})
|
508
507
|
log_info(fromip, user, f'run_command {command_id}: {command_str(command, params)}: completed successfully')
|
509
508
|
else:
|
@@ -511,7 +510,6 @@ def run_command(fromip, user, command, params, command_id, rows, cols):
|
|
511
510
|
'status': 'failed',
|
512
511
|
'end_time': end_time,
|
513
512
|
'exit_code': exit_code,
|
514
|
-
'user': user
|
515
513
|
})
|
516
514
|
log_info(fromip, user, f'run_command {command_id}: {command_str(command, params)}: exit code {exit_code}')
|
517
515
|
|
@@ -521,7 +519,6 @@ def run_command(fromip, user, command, params, command_id, rows, cols):
|
|
521
519
|
'status': 'failed',
|
522
520
|
'end_time': end_time,
|
523
521
|
'exit_code': 1,
|
524
|
-
'user': user
|
525
522
|
})
|
526
523
|
with open(get_output_file_path(command_id), 'a') as output_file:
|
527
524
|
output_file.write(str(e))
|
pywebexec/version.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
pywebexec/__init__.py,sha256=197fHJy0UDBwTTpGCGortZRr-w2kTaD7MxqdbVmTEi0,61
|
2
2
|
pywebexec/host_ip.py,sha256=Ud_HTflWVQ8789aoQ2RZdT1wGI-ccvrwSWGz_c7T3TI,1241
|
3
|
-
pywebexec/pywebexec.py,sha256=
|
4
|
-
pywebexec/version.py,sha256=
|
3
|
+
pywebexec/pywebexec.py,sha256=gMkPagOLSc_8OUGxQJBKbwPivyQVK5og8-NgyR6xRl4,32607
|
4
|
+
pywebexec/version.py,sha256=TkFaFsruX5Otm0LH6piM1yaTwAuulEqgHrPqtArFw5s,513
|
5
5
|
pywebexec/static/css/Consolas NF.ttf,sha256=DJEOzF0eqZ-kxu3Gs_VE8X0NJqiobBzmxWDGpdgGRxI,1313900
|
6
6
|
pywebexec/static/css/style.css,sha256=fU-_eAk6Xy0L_GbH9rJBkeCFe5M2RYQA99cvRZ3pW9w,7934
|
7
7
|
pywebexec/static/css/xterm.css,sha256=uo5phWaUiJgcz0DAzv46uoByLLbJLeetYosL1xf68rY,5559
|
@@ -36,9 +36,9 @@ pywebexec/static/js/xterm/xterm.js.map,sha256=Y7O2Pb-fIS7Z8AC1D5s04_aiW_Jf1f4mCf
|
|
36
36
|
pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
37
|
pywebexec/templates/index.html,sha256=KSdQYBdzWKP6v0ETZsMO_729aosGBAzJxAss8T5jCto,2953
|
38
38
|
pywebexec/templates/popup.html,sha256=f5m4u8WKpkevL2mQamGqo4_y-rSuLOXGuNsezuUbniY,1508
|
39
|
-
pywebexec-1.7.
|
40
|
-
pywebexec-1.7.
|
41
|
-
pywebexec-1.7.
|
42
|
-
pywebexec-1.7.
|
43
|
-
pywebexec-1.7.
|
44
|
-
pywebexec-1.7.
|
39
|
+
pywebexec-1.7.19.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
|
40
|
+
pywebexec-1.7.19.dist-info/METADATA,sha256=yD7jkQlQGWpQfEYpoZ62JpLU4wjW8jEYn6uk9NjD5tc,8147
|
41
|
+
pywebexec-1.7.19.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
42
|
+
pywebexec-1.7.19.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
|
43
|
+
pywebexec-1.7.19.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
|
44
|
+
pywebexec-1.7.19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|