pywebexec 1.6.8__tar.gz → 1.6.10__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 (48) hide show
  1. {pywebexec-1.6.8/pywebexec.egg-info → pywebexec-1.6.10}/PKG-INFO +3 -2
  2. {pywebexec-1.6.8 → pywebexec-1.6.10}/README.md +2 -1
  3. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/pywebexec.py +20 -9
  4. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/script.js +9 -1
  5. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/version.py +2 -2
  6. {pywebexec-1.6.8 → pywebexec-1.6.10/pywebexec.egg-info}/PKG-INFO +3 -2
  7. {pywebexec-1.6.8 → pywebexec-1.6.10}/.github/workflows/python-publish.yml +0 -0
  8. {pywebexec-1.6.8 → pywebexec-1.6.10}/.gitignore +0 -0
  9. {pywebexec-1.6.8 → pywebexec-1.6.10}/LICENSE +0 -0
  10. {pywebexec-1.6.8 → pywebexec-1.6.10}/pyproject.toml +0 -0
  11. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/__init__.py +0 -0
  12. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/css/Consolas NF.ttf +0 -0
  13. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/css/style.css +0 -0
  14. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/css/xterm.css +0 -0
  15. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/aborted.svg +0 -0
  16. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/copy.svg +0 -0
  17. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/copy_ok.svg +0 -0
  18. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/down-arrow.svg +0 -0
  19. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/failed.svg +0 -0
  20. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/favicon.svg +0 -0
  21. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/font-decrease.svg +0 -0
  22. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/font-increase.svg +0 -0
  23. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/norun.svg +0 -0
  24. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/pause.svg +0 -0
  25. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/popup.svg +0 -0
  26. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/resume.svg +0 -0
  27. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/running.svg +0 -0
  28. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/images/success.svg +0 -0
  29. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/commands.js +0 -0
  30. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/popup.js +0 -0
  31. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/xterm/LICENSE +0 -0
  32. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/xterm/addon-canvas.js +0 -0
  33. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/xterm/addon-canvas.js.map +0 -0
  34. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/xterm/addon-fit.js +0 -0
  35. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/xterm/addon-fit.js.map +0 -0
  36. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/xterm/addon-unicode11.js +0 -0
  37. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/xterm/addon-unicode11.js.map +0 -0
  38. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/xterm/xterm.js +0 -0
  39. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/static/js/xterm/xterm.js.map +0 -0
  40. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/templates/__init__.py +0 -0
  41. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/templates/index.html +0 -0
  42. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec/templates/popup.html +0 -0
  43. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec.egg-info/SOURCES.txt +0 -0
  44. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec.egg-info/dependency_links.txt +0 -0
  45. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec.egg-info/entry_points.txt +0 -0
  46. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec.egg-info/requires.txt +0 -0
  47. {pywebexec-1.6.8 → pywebexec-1.6.10}/pywebexec.egg-info/top_level.txt +0 -0
  48. {pywebexec-1.6.8 → pywebexec-1.6.10}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.6.8
3
+ Version: 1.6.10
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -200,6 +200,7 @@ $ curl http://myhost:8080/command_output/<command_id> -H "Accept: text/plain"
200
200
  | POST | /run_command | command: str<br>params: array[str] | command_id: uuid<br>message: str |
201
201
  | POST | /stop_command/command_id | | message: str |
202
202
  | GET | /command_status/command_id | | command_id: uuid<br>command: str<br>params: array[str]<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int<br>last_output_line: str |
203
- | GET | /command_output/command_id | offset: int | output: str<br>status: str<br>links: { next: str } |
204
203
  | GET | /commands | | array of<br>command_id: uuid<br>command: str<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int<br>last_output_line: str |
205
204
  | GET | /executables | | array of str |
205
+ | GET | /command_output/command_id | offset: int | output: str<br>status: str<br>links: { next: str } |
206
+ | GET | /command_output_raw/command_id | offset: int | output: stream raw output until end of command<br>curl -N -s http://srv/command_output_raw/command_id|
@@ -138,6 +138,7 @@ $ curl http://myhost:8080/command_output/<command_id> -H "Accept: text/plain"
138
138
  | POST | /run_command | command: str<br>params: array[str] | command_id: uuid<br>message: str |
139
139
  | POST | /stop_command/command_id | | message: str |
140
140
  | GET | /command_status/command_id | | command_id: uuid<br>command: str<br>params: array[str]<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int<br>last_output_line: str |
141
- | GET | /command_output/command_id | offset: int | output: str<br>status: str<br>links: { next: str } |
142
141
  | GET | /commands | | array of<br>command_id: uuid<br>command: str<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int<br>last_output_line: str |
143
142
  | GET | /executables | | array of str |
143
+ | GET | /command_output/command_id | offset: int | output: str<br>status: str<br>links: { next: str } |
144
+ | GET | /command_output_raw/command_id | offset: int | output: stream raw output until end of command<br>curl -N -s http://srv/command_output_raw/command_id|
@@ -1,5 +1,5 @@
1
1
  import sys
2
- from flask import Flask, request, jsonify, render_template, session, redirect, url_for
2
+ from flask import Flask, request, jsonify, render_template, session, redirect, url_for, Response, stream_with_context
3
3
  from flask_httpauth import HTTPBasicAuth
4
4
  import threading
5
5
  import os
@@ -798,14 +798,25 @@ def get_command_output(command_id):
798
798
  @app.route('/command_output_raw/<command_id>', methods=['GET'])
799
799
  def get_command_output_raw(command_id):
800
800
  offset = int(request.args.get('offset', 0))
801
- maxsize = int(request.args.get('maxsize', 10485760))
802
- output_file_path = get_output_file_path(command_id)
803
- if os.path.exists(output_file_path):
804
- with open(output_file_path, 'rb') as output_file:
805
- output_file.seek(offset)
806
- output = output_file.read(maxsize)
807
- return output, 200, {'Content-Type': 'text/plain'}
808
- return jsonify({'error': 'Invalid command_id'}), 404
801
+ @stream_with_context
802
+ def generate(offset):
803
+ try:
804
+ output_file_path = get_output_file_path(command_id)
805
+ if os.path.exists(output_file_path):
806
+ with open(output_file_path, 'rb') as output_file:
807
+ while True:
808
+ while True:
809
+ chunk = output_file.read(1024)
810
+ if not chunk:
811
+ time.sleep(0.5)
812
+ break
813
+ yield chunk
814
+ status = read_command_status(command_id)
815
+ if not status or status['status'] != 'running':
816
+ break
817
+ except GeneratorExit:
818
+ return
819
+ return Response(generate(offset), content_type='text/plain')
809
820
 
810
821
  @app.route('/executables', methods=['GET'])
811
822
  def list_executables():
@@ -18,7 +18,7 @@ function initTerminal()
18
18
  cursorBlink: false,
19
19
  cursorInactiveStyle: 'none',
20
20
  disableStdin: true,
21
- convertEol: true,
21
+ //convertEol: true,
22
22
  fontFamily: '"Consolas NF", "Fira Code", monospace, "Powerline Extra Symbols", courier-new, courier',
23
23
  fontSize: fontSize,
24
24
  scrollback: maxScrollback,
@@ -80,6 +80,14 @@ terminal.onTitleChange((title) => {
80
80
  document.getElementById('commandInfo').innerText = title;
81
81
  })
82
82
 
83
+ /*terminal.onResize((evt) => {
84
+ const terminal_size = {
85
+ Width: evt.cols,
86
+ Height: evt.rows,
87
+ };
88
+ console.log(terminal_size);
89
+ })*/
90
+
83
91
  terminal.onSelectionChange(() => {
84
92
  const selectionText = terminal.getSelection();
85
93
  if (selectionText) {
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.6.8'
16
- __version_tuple__ = version_tuple = (1, 6, 8)
15
+ __version__ = version = '1.6.10'
16
+ __version_tuple__ = version_tuple = (1, 6, 10)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.6.8
3
+ Version: 1.6.10
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -200,6 +200,7 @@ $ curl http://myhost:8080/command_output/<command_id> -H "Accept: text/plain"
200
200
  | POST | /run_command | command: str<br>params: array[str] | command_id: uuid<br>message: str |
201
201
  | POST | /stop_command/command_id | | message: str |
202
202
  | GET | /command_status/command_id | | command_id: uuid<br>command: str<br>params: array[str]<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int<br>last_output_line: str |
203
- | GET | /command_output/command_id | offset: int | output: str<br>status: str<br>links: { next: str } |
204
203
  | GET | /commands | | array of<br>command_id: uuid<br>command: str<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int<br>last_output_line: str |
205
204
  | GET | /executables | | array of str |
205
+ | GET | /command_output/command_id | offset: int | output: str<br>status: str<br>links: { next: str } |
206
+ | GET | /command_output_raw/command_id | offset: int | output: stream raw output until end of command<br>curl -N -s http://srv/command_output_raw/command_id|
File without changes
File without changes
File without changes
File without changes