pywebexec 1.4.2__tar.gz → 1.4.3__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.4.2/pywebexec.egg-info → pywebexec-1.4.3}/PKG-INFO +1 -1
  2. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/pywebexec.py +18 -20
  3. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/js/commands.js +3 -1
  4. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/version.py +2 -2
  5. {pywebexec-1.4.2 → pywebexec-1.4.3/pywebexec.egg-info}/PKG-INFO +1 -1
  6. {pywebexec-1.4.2 → pywebexec-1.4.3}/.github/workflows/python-publish.yml +0 -0
  7. {pywebexec-1.4.2 → pywebexec-1.4.3}/.gitignore +0 -0
  8. {pywebexec-1.4.2 → pywebexec-1.4.3}/LICENSE +0 -0
  9. {pywebexec-1.4.2 → pywebexec-1.4.3}/README.md +0 -0
  10. {pywebexec-1.4.2 → pywebexec-1.4.3}/pyproject.toml +0 -0
  11. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/__init__.py +0 -0
  12. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/css/Consolas NF.ttf +0 -0
  13. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/css/style.css +0 -0
  14. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/css/xterm.css +0 -0
  15. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/images/aborted.svg +0 -0
  16. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/images/copy.svg +0 -0
  17. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/images/copy_ok.svg +0 -0
  18. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/images/down-arrow.svg +0 -0
  19. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/images/failed.svg +0 -0
  20. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/images/favicon.svg +0 -0
  21. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/images/running.gif +0 -0
  22. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/images/success.svg +0 -0
  23. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/js/script.js +0 -0
  24. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/js/xterm/LICENSE +0 -0
  25. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/js/xterm/ansi_up.min.js +0 -0
  26. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/js/xterm/xterm-addon-fit.js +0 -0
  27. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/static/js/xterm/xterm.js +0 -0
  28. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/templates/__init__.py +0 -0
  29. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec/templates/index.html +0 -0
  30. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec.egg-info/SOURCES.txt +0 -0
  31. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec.egg-info/dependency_links.txt +0 -0
  32. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec.egg-info/entry_points.txt +0 -0
  33. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec.egg-info/requires.txt +0 -0
  34. {pywebexec-1.4.2 → pywebexec-1.4.3}/pywebexec.egg-info/top_level.txt +0 -0
  35. {pywebexec-1.4.2 → pywebexec-1.4.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -454,27 +454,25 @@ def run_command(command, params, command_id, user):
454
454
  update_command_status(command_id, 'running', command=command, params=params, start_time=start_time, user=user)
455
455
  output_file_path = get_output_file_path(command_id)
456
456
  try:
457
- def spawn_tty():
458
- with open(output_file_path, 'wb') as fd:
459
- p = pexpect.spawn(command, params, ignore_sighup=True, timeout=None)
460
- update_command_status(command_id, 'running', pid=p.pid, user=user)
461
- p.setwinsize(24, 120)
462
- p.logfile = fd
463
- p.expect(pexpect.EOF)
464
- fd.flush()
465
- status = p.wait()
466
- end_time = datetime.now().isoformat()
467
- # Update the status based on the result
468
- if status is None:
469
- exit_code = -15
470
- update_command_status(command_id, 'aborted', end_time=end_time, exit_code=exit_code, user=user)
457
+ with open(output_file_path, 'wb') as fd:
458
+ p = pexpect.spawn(command, params, ignore_sighup=True, timeout=None)
459
+ update_command_status(command_id, 'running', pid=p.pid, user=user)
460
+ p.setwinsize(24, 125)
461
+ p.logfile = fd
462
+ p.expect(pexpect.EOF)
463
+ fd.flush()
464
+ status = p.wait()
465
+ end_time = datetime.now().isoformat()
466
+ # Update the status based on the result
467
+ if status is None:
468
+ exit_code = -15
469
+ update_command_status(command_id, 'aborted', end_time=end_time, exit_code=exit_code, user=user)
470
+ else:
471
+ exit_code = status
472
+ if exit_code == 0:
473
+ update_command_status(command_id, 'success', end_time=end_time, exit_code=exit_code, user=user)
471
474
  else:
472
- exit_code = status
473
- if exit_code == 0:
474
- update_command_status(command_id, 'success', end_time=end_time, exit_code=exit_code, user=user)
475
- else:
476
- update_command_status(command_id, 'failed', end_time=end_time, exit_code=exit_code, user=user)
477
- spawn_tty()
475
+ update_command_status(command_id, 'failed', end_time=end_time, exit_code=exit_code, user=user)
478
476
  except Exception as e:
479
477
  end_time = datetime.now().isoformat()
480
478
  update_command_status(command_id, 'failed', end_time=end_time, exit_code=1, user=user)
@@ -25,7 +25,7 @@ function filterCommands() {
25
25
  options[i].style.display = 'none';
26
26
  }
27
27
  }
28
- if (nbVisibleItems>1) {
28
+ if (nbVisibleItems > 1) {
29
29
  commandListSelect.size = Math.min(20, nbVisibleItems);
30
30
  commandListSelect.style.display = 'block';
31
31
  } else {
@@ -211,6 +211,8 @@ async function fetchExecutables() {
211
211
  alert("Failed to fetch executables");
212
212
  }
213
213
  commandListSelect.size = Math.min(20, commandListSelect.options.length);
214
+ if (commandListSelect.options.length == 1)
215
+ commandInput.value = commandListSelect.options[0].text;
214
216
  if (commandListSelect.options.length == 0)
215
217
  document.getElementById('launchForm').style.display = 'none';
216
218
 
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.4.2'
16
- __version_tuple__ = version_tuple = (1, 4, 2)
15
+ __version__ = version = '1.4.3'
16
+ __version_tuple__ = version_tuple = (1, 4, 3)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.4.2
3
+ Version: 1.4.3
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