pywebexec 1.3.7__py3-none-any.whl → 1.3.8__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 +9 -13
- pywebexec/version.py +2 -2
- {pywebexec-1.3.7.dist-info → pywebexec-1.3.8.dist-info}/METADATA +1 -1
- {pywebexec-1.3.7.dist-info → pywebexec-1.3.8.dist-info}/RECORD +8 -8
- {pywebexec-1.3.7.dist-info → pywebexec-1.3.8.dist-info}/LICENSE +0 -0
- {pywebexec-1.3.7.dist-info → pywebexec-1.3.8.dist-info}/WHEEL +0 -0
- {pywebexec-1.3.7.dist-info → pywebexec-1.3.8.dist-info}/entry_points.txt +0 -0
- {pywebexec-1.3.7.dist-info → pywebexec-1.3.8.dist-info}/top_level.txt +0 -0
pywebexec/pywebexec.py
CHANGED
@@ -437,9 +437,7 @@ def script(filename):
|
|
437
437
|
s.flush()
|
438
438
|
return data
|
439
439
|
return pty.spawn(shell, read)
|
440
|
-
|
441
|
-
|
442
|
-
import fcntl
|
440
|
+
|
443
441
|
|
444
442
|
def run_command(command, params, command_id, user):
|
445
443
|
start_time = datetime.now().isoformat()
|
@@ -465,26 +463,24 @@ def run_command(command, params, command_id, user):
|
|
465
463
|
os.execvp(command, [command] + params)
|
466
464
|
else: # Parent process
|
467
465
|
update_command_status(command_id, 'running', pid=pid, user=user)
|
468
|
-
fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK) # Set the file descriptor to non-blocking mode
|
469
466
|
while True:
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
except OSError:
|
475
|
-
break
|
467
|
+
try:
|
468
|
+
read(fd)
|
469
|
+
except OSError:
|
470
|
+
break
|
476
471
|
(pid, status) = os.waitpid(pid, 0)
|
477
472
|
return status
|
478
473
|
|
479
474
|
status = spawn_pty()
|
480
475
|
end_time = datetime.now().isoformat()
|
481
476
|
# Update the status based on the result
|
482
|
-
if os.
|
477
|
+
if os.WIFSIGNALED(status):
|
478
|
+
exit_code = -os.WTERMSIG(status)
|
479
|
+
update_command_status(command_id, 'aborted', end_time=end_time, exit_code=exit_code, user=user)
|
480
|
+
else:
|
483
481
|
exit_code = os.WEXITSTATUS(status)
|
484
482
|
if exit_code == 0:
|
485
483
|
update_command_status(command_id, 'success', end_time=end_time, exit_code=exit_code, user=user)
|
486
|
-
elif exit_code == -15:
|
487
|
-
update_command_status(command_id, 'aborted', end_time=end_time, exit_code=exit_code, user=user)
|
488
484
|
else:
|
489
485
|
update_command_status(command_id, 'failed', end_time=end_time, exit_code=exit_code, user=user)
|
490
486
|
except Exception as e:
|
pywebexec/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
pywebexec/__init__.py,sha256=4spIsVaF8RJt8S58AG_wWoORRNkws9Iwqprj27C3ljM,99
|
2
|
-
pywebexec/pywebexec.py,sha256=
|
3
|
-
pywebexec/version.py,sha256=
|
2
|
+
pywebexec/pywebexec.py,sha256=JvzLrQujPfIr-lYBD3kjk6gcMmFhNkw0EzPGrUDSvn0,26570
|
3
|
+
pywebexec/version.py,sha256=qiRBw-eWRP8Lkk4ISEcIe48Z7v6e-_S_a_GbGFURp50,411
|
4
4
|
pywebexec/static/css/Consolas NF.ttf,sha256=DJEOzF0eqZ-kxu3Gs_VE8X0NJqiobBzmxWDGpdgGRxI,1313900
|
5
5
|
pywebexec/static/css/style.css,sha256=iLX6k1hoWLinZWyqtbH50U-0hND2M-5_Zr1U1UC_gos,5578
|
6
6
|
pywebexec/static/css/xterm.css,sha256=gy8_LGA7Q61DUf8ElwFQzHqHMBQnbbEmpgZcbdgeSHI,5383
|
@@ -20,9 +20,9 @@ pywebexec/static/js/xterm/xterm-addon-fit.js,sha256=Pprm9pZe4SadVXS5Bc8b9VnC9Ex4
|
|
20
20
|
pywebexec/static/js/xterm/xterm.js,sha256=Bzka76jZwEhVt_LlS0e0qMw7ryGa1p5qfxFyeohphBo,283371
|
21
21
|
pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
pywebexec/templates/index.html,sha256=DYtT555wSNhnFtzzHhPMWJireynCJNnAuTytpoORQeE,2321
|
23
|
-
pywebexec-1.3.
|
24
|
-
pywebexec-1.3.
|
25
|
-
pywebexec-1.3.
|
26
|
-
pywebexec-1.3.
|
27
|
-
pywebexec-1.3.
|
28
|
-
pywebexec-1.3.
|
23
|
+
pywebexec-1.3.8.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
|
24
|
+
pywebexec-1.3.8.dist-info/METADATA,sha256=WuJ_CEfWtHwrYx-5Sx4DNabbdhpRF_DRbp4SCsvhG6g,7397
|
25
|
+
pywebexec-1.3.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
26
|
+
pywebexec-1.3.8.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
|
27
|
+
pywebexec-1.3.8.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
|
28
|
+
pywebexec-1.3.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|