pywebexec 1.3.7__tar.gz → 1.3.8__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.
Files changed (35) hide show
  1. {pywebexec-1.3.7/pywebexec.egg-info → pywebexec-1.3.8}/PKG-INFO +1 -1
  2. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/pywebexec.py +9 -13
  3. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/version.py +2 -2
  4. {pywebexec-1.3.7 → pywebexec-1.3.8/pywebexec.egg-info}/PKG-INFO +1 -1
  5. {pywebexec-1.3.7 → pywebexec-1.3.8}/.github/workflows/python-publish.yml +0 -0
  6. {pywebexec-1.3.7 → pywebexec-1.3.8}/.gitignore +0 -0
  7. {pywebexec-1.3.7 → pywebexec-1.3.8}/LICENSE +0 -0
  8. {pywebexec-1.3.7 → pywebexec-1.3.8}/README.md +0 -0
  9. {pywebexec-1.3.7 → pywebexec-1.3.8}/pyproject.toml +0 -0
  10. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/__init__.py +0 -0
  11. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/css/Consolas NF.ttf +0 -0
  12. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/css/style.css +0 -0
  13. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/css/xterm.css +0 -0
  14. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/images/aborted.svg +0 -0
  15. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/images/copy.svg +0 -0
  16. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/images/copy_ok.svg +0 -0
  17. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/images/down-arrow.svg +0 -0
  18. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/images/failed.svg +0 -0
  19. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/images/favicon.svg +0 -0
  20. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/images/running.gif +0 -0
  21. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/images/success.svg +0 -0
  22. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/js/commands.js +0 -0
  23. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/js/script.js +0 -0
  24. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/js/xterm/LICENSE +0 -0
  25. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/js/xterm/ansi_up.min.js +0 -0
  26. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/js/xterm/xterm-addon-fit.js +0 -0
  27. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/static/js/xterm/xterm.js +0 -0
  28. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/templates/__init__.py +0 -0
  29. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec/templates/index.html +0 -0
  30. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec.egg-info/SOURCES.txt +0 -0
  31. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec.egg-info/dependency_links.txt +0 -0
  32. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec.egg-info/entry_points.txt +0 -0
  33. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec.egg-info/requires.txt +0 -0
  34. {pywebexec-1.3.7 → pywebexec-1.3.8}/pywebexec.egg-info/top_level.txt +0 -0
  35. {pywebexec-1.3.7 → pywebexec-1.3.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.3.7
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
@@ -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
- r, _, _ = select.select([fd], [], [], 1.0) # Use select to monitor the file descriptor
471
- if fd in r:
472
- try:
473
- read(fd)
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.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:
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:
@@ -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.7'
16
- __version_tuple__ = version_tuple = (1, 3, 7)
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.7
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
File without changes
File without changes
File without changes
File without changes
File without changes