pywebexec 1.3.6__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 CHANGED
@@ -222,7 +222,7 @@ def start_gunicorn(daemonized=False, baselog=None):
222
222
  sys.exit(1)
223
223
  else:
224
224
  errorlog = "-"
225
- accesslog = "-"
225
+ accesslog = None #"-"
226
226
  pidfile = None
227
227
  options = {
228
228
  'bind': '%s:%s' % (args.listen, args.port),
@@ -437,7 +437,7 @@ def script(filename):
437
437
  s.flush()
438
438
  return data
439
439
  return pty.spawn(shell, read)
440
-
440
+
441
441
 
442
442
  def run_command(command, params, command_id, user):
443
443
  start_time = datetime.now().isoformat()
@@ -474,12 +474,13 @@ def run_command(command, params, command_id, user):
474
474
  status = spawn_pty()
475
475
  end_time = datetime.now().isoformat()
476
476
  # Update the status based on the result
477
- if os.WIFEXITED(status):
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:
478
481
  exit_code = os.WEXITSTATUS(status)
479
482
  if exit_code == 0:
480
483
  update_command_status(command_id, 'success', end_time=end_time, exit_code=exit_code, user=user)
481
- elif exit_code == -15:
482
- update_command_status(command_id, 'aborted', end_time=end_time, exit_code=exit_code, user=user)
483
484
  else:
484
485
  update_command_status(command_id, 'failed', end_time=end_time, exit_code=exit_code, user=user)
485
486
  except Exception as e:
@@ -497,9 +498,12 @@ def stop_command(command_id):
497
498
  pid = status['pid']
498
499
  end_time = datetime.now().isoformat()
499
500
  try:
501
+ update_command_status(command_id, 'aborted', end_time=end_time, exit_code=-15)
500
502
  os.killpg(os.getpgid(pid), 15) # Send SIGTERM to the process group
501
- #os.waitpid(pid, 0) # Wait for the process to terminate
502
- #update_command_status(command_id, 'aborted', end_time=end_time, exit_code=-15)
503
+ try:
504
+ os.waitpid(pid, 0) # Wait for the process to terminate
505
+ except ChildProcessError:
506
+ pass # Ignore if the process has already been reaped
503
507
  return jsonify({'message': 'Command aborted'})
504
508
  except Exception as e:
505
509
  status_data = read_command_status(command_id) or {}
pywebexec/version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.3.6'
16
- __version_tuple__ = version_tuple = (1, 3, 6)
15
+ __version__ = version = '1.3.8'
16
+ __version_tuple__ = version_tuple = (1, 3, 8)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.3.6
3
+ Version: 1.3.8
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -1,6 +1,6 @@
1
1
  pywebexec/__init__.py,sha256=4spIsVaF8RJt8S58AG_wWoORRNkws9Iwqprj27C3ljM,99
2
- pywebexec/pywebexec.py,sha256=OUpyU7X275eVA-yn8coUsfN1vKaXvfxaPczeo-rEzrg,26419
3
- pywebexec/version.py,sha256=d5ulHSpHe8PYDRupuj0qHnCpT54pR8sMjv17y0ht5fs,411
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.6.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
24
- pywebexec-1.3.6.dist-info/METADATA,sha256=vuIpsD_OxyKGVzMWDZO0HEAt0oPOtKt_0em-nvHc__s,7397
25
- pywebexec-1.3.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
26
- pywebexec-1.3.6.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
27
- pywebexec-1.3.6.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
28
- pywebexec-1.3.6.dist-info/RECORD,,
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,,