pywebexec 1.7.19__py3-none-any.whl → 1.8.1__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 +22 -22
- pywebexec/static/css/style.css +3 -3
- pywebexec/static/fonts/CommitMonoNerdFontMono-Regular.otf +0 -0
- pywebexec/static/fonts/LICENSE +90 -0
- pywebexec/static/js/popup.js +15 -15
- pywebexec/static/js/script.js +15 -15
- pywebexec/version.py +2 -2
- {pywebexec-1.7.19.dist-info → pywebexec-1.8.1.dist-info}/METADATA +1 -1
- {pywebexec-1.7.19.dist-info → pywebexec-1.8.1.dist-info}/RECORD +13 -12
- pywebexec/static/css/Consolas NF.ttf +0 -0
- {pywebexec-1.7.19.dist-info → pywebexec-1.8.1.dist-info}/LICENSE +0 -0
- {pywebexec-1.7.19.dist-info → pywebexec-1.8.1.dist-info}/WHEEL +0 -0
- {pywebexec-1.7.19.dist-info → pywebexec-1.8.1.dist-info}/entry_points.txt +0 -0
- {pywebexec-1.7.19.dist-info → pywebexec-1.8.1.dist-info}/top_level.txt +0 -0
pywebexec/pywebexec.py
CHANGED
@@ -404,13 +404,15 @@ def get_output_file_path(command_id):
|
|
404
404
|
|
405
405
|
def update_command_status(command_id, updates):
|
406
406
|
status_file_path = get_status_file_path(command_id)
|
407
|
-
status = read_command_status(command_id)
|
408
|
-
status = status.copy()
|
407
|
+
status = read_command_status(command_id)
|
409
408
|
status.update(updates)
|
409
|
+
status = status.copy()
|
410
410
|
if status.get('status') != 'running':
|
411
411
|
output_file_path = get_output_file_path(command_id)
|
412
412
|
if os.path.exists(output_file_path):
|
413
413
|
status['last_output_line'] = get_last_line(output_file_path, status.get('cols'), status.get('rows'))
|
414
|
+
if 'last_read' in status:
|
415
|
+
del status['last_read']
|
414
416
|
with open(status_file_path, 'w') as f:
|
415
417
|
json.dump(status, f)
|
416
418
|
os.sync()
|
@@ -419,24 +421,25 @@ def update_command_status(command_id, updates):
|
|
419
421
|
|
420
422
|
def read_command_status(command_id):
|
421
423
|
# Return cached status if available
|
422
|
-
|
423
|
-
if command_id in status_cache:
|
424
|
-
|
424
|
+
global status_cache
|
425
|
+
if not command_id in status_cache:
|
426
|
+
status_cache[command_id] = {}
|
427
|
+
status_data = status_cache[command_id]
|
425
428
|
status = status_data.get('status')
|
426
429
|
if status and status != "running":
|
427
430
|
return status_data
|
428
|
-
if
|
431
|
+
if status_data.get('last_read',0)>datetime.now().timestamp()-0.5:
|
429
432
|
return status_data
|
430
433
|
status_file_path = get_status_file_path(command_id)
|
431
434
|
if not os.path.exists(status_file_path):
|
432
|
-
return
|
435
|
+
return status_data
|
433
436
|
with open(status_file_path, 'r') as f:
|
434
437
|
try:
|
435
438
|
status_data.update(json.load(f))
|
436
439
|
except json.JSONDecodeError:
|
437
|
-
return
|
440
|
+
return status_data
|
438
441
|
status_data['last_read'] = datetime.now().timestamp()
|
439
|
-
status_cache[command_id] = status_data
|
442
|
+
#status_cache[command_id] = status_data
|
440
443
|
return status_data
|
441
444
|
|
442
445
|
def sigwinch_passthrough(sig, data):
|
@@ -552,7 +555,6 @@ def read_commands():
|
|
552
555
|
'last_update': datetime.now().timestamp(),
|
553
556
|
'last_output_line': get_last_line(output_file_path, status.get('cols'), status.get('rows')),
|
554
557
|
})
|
555
|
-
status_cache[command_id] = status
|
556
558
|
commands.append({
|
557
559
|
'command_id': command_id,
|
558
560
|
'status': status.get('status'),
|
@@ -730,13 +732,6 @@ def get_command_status(command_id):
|
|
730
732
|
status = read_command_status(command_id)
|
731
733
|
if not status:
|
732
734
|
return jsonify({'error': 'Invalid command_id'}), 404
|
733
|
-
|
734
|
-
# output_file_path = get_output_file_path(command_id)
|
735
|
-
# if os.path.exists(output_file_path):
|
736
|
-
# with open(output_file_path, 'r') as output_file:
|
737
|
-
# output = output_file.read()
|
738
|
-
# status['output'] = output
|
739
|
-
|
740
735
|
return jsonify(status)
|
741
736
|
|
742
737
|
@app.route('/')
|
@@ -756,11 +751,16 @@ def get_command_output(command_id):
|
|
756
751
|
maxsize = int(request.args.get('maxsize', 10485760))
|
757
752
|
output_file_path = get_output_file_path(command_id)
|
758
753
|
if os.path.exists(output_file_path):
|
759
|
-
|
760
|
-
|
761
|
-
output =
|
762
|
-
new_offset =
|
763
|
-
|
754
|
+
size = os.path.getsize(output_file_path)
|
755
|
+
if offset >= size:
|
756
|
+
output = ''
|
757
|
+
new_offset = offset
|
758
|
+
else:
|
759
|
+
with open(output_file_path, 'rb') as output_file:
|
760
|
+
output_file.seek(offset)
|
761
|
+
output = output_file.read().decode('utf-8', errors='replace')
|
762
|
+
new_offset = output_file.tell()
|
763
|
+
status_data = read_command_status(command_id)
|
764
764
|
token = app.config.get("TOKEN_URL")
|
765
765
|
token_param = f"&token={token}" if token else ""
|
766
766
|
response = {
|
pywebexec/static/css/style.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
@font-face {
|
2
|
-
font-family: '
|
3
|
-
src: url('/static/
|
2
|
+
font-family: 'CommitMono Nerd Font Mono';
|
3
|
+
src: url('/static/fonts/CommitMonoNerdFontMono-Regular.otf');
|
4
4
|
font-weight: 400;
|
5
5
|
font-style: normal;
|
6
6
|
}
|
@@ -48,7 +48,7 @@ th {
|
|
48
48
|
cursor: pointer;
|
49
49
|
}
|
50
50
|
.monospace {
|
51
|
-
font-family:
|
51
|
+
font-family: "CommitMono Nerd Font Mono", monospace;
|
52
52
|
font-size: 13px;
|
53
53
|
}
|
54
54
|
.system-font {
|
Binary file
|
@@ -0,0 +1,90 @@
|
|
1
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
2
|
+
This license is copied below, and is also available with a FAQ at:
|
3
|
+
http://scripts.sil.org/OFL
|
4
|
+
|
5
|
+
-----------------------------------------------------------
|
6
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
7
|
+
-----------------------------------------------------------
|
8
|
+
|
9
|
+
PREAMBLE
|
10
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
11
|
+
development of collaborative font projects, to support the font creation
|
12
|
+
efforts of academic and linguistic communities, and to provide a free and
|
13
|
+
open framework in which fonts may be shared and improved in partnership
|
14
|
+
with others.
|
15
|
+
|
16
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
17
|
+
redistributed freely as long as they are not sold by themselves. The
|
18
|
+
fonts, including any derivative works, can be bundled, embedded,
|
19
|
+
redistributed and/or sold with any software provided that any reserved
|
20
|
+
names are not used by derivative works. The fonts and derivatives,
|
21
|
+
however, cannot be released under any other type of license. The
|
22
|
+
requirement for fonts to remain under this license does not apply
|
23
|
+
to any document created using the fonts or their derivatives.
|
24
|
+
|
25
|
+
DEFINITIONS
|
26
|
+
"Font Software" refers to the set of files released by the Copyright
|
27
|
+
Holder(s) under this license and clearly marked as such. This may
|
28
|
+
include source files, build scripts and documentation.
|
29
|
+
|
30
|
+
"Reserved Font Name" refers to any names specified as such after the
|
31
|
+
copyright statement(s).
|
32
|
+
|
33
|
+
"Original Version" refers to the collection of Font Software components as
|
34
|
+
distributed by the Copyright Holder(s).
|
35
|
+
|
36
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
37
|
+
or substituting -- in part or in whole -- any of the components of the
|
38
|
+
Original Version, by changing formats or by porting the Font Software to a
|
39
|
+
new environment.
|
40
|
+
|
41
|
+
"Author" refers to any designer, engineer, programmer, technical
|
42
|
+
writer or other person who contributed to the Font Software.
|
43
|
+
|
44
|
+
PERMISSION & CONDITIONS
|
45
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
46
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
47
|
+
redistribute, and sell modified and unmodified copies of the Font
|
48
|
+
Software, subject to the following conditions:
|
49
|
+
|
50
|
+
1) Neither the Font Software nor any of its individual components,
|
51
|
+
in Original or Modified Versions, may be sold by itself.
|
52
|
+
|
53
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
54
|
+
redistributed and/or sold with any software, provided that each copy
|
55
|
+
contains the above copyright notice and this license. These can be
|
56
|
+
included either as stand-alone text files, human-readable headers or
|
57
|
+
in the appropriate machine-readable metadata fields within text or
|
58
|
+
binary files as long as those fields can be easily viewed by the user.
|
59
|
+
|
60
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
61
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
62
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
63
|
+
presented to the users.
|
64
|
+
|
65
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
66
|
+
Software shall not be used to promote, endorse or advertise any
|
67
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
68
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
69
|
+
permission.
|
70
|
+
|
71
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
72
|
+
must be distributed entirely under this license, and must not be
|
73
|
+
distributed under any other license. The requirement for fonts to
|
74
|
+
remain under this license does not apply to any document created
|
75
|
+
using the Font Software.
|
76
|
+
|
77
|
+
TERMINATION
|
78
|
+
This license becomes null and void if any of the above conditions are
|
79
|
+
not met.
|
80
|
+
|
81
|
+
DISCLAIMER
|
82
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
83
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
84
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
85
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
86
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
87
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
88
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
89
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
90
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
pywebexec/static/js/popup.js
CHANGED
@@ -6,7 +6,7 @@ let terminal = new Terminal({
|
|
6
6
|
cursorInactiveStyle: 'none',
|
7
7
|
disableStdin: true,
|
8
8
|
convertEol: true,
|
9
|
-
fontFamily: '
|
9
|
+
fontFamily: '"CommitMono Nerd Font Mono", monospace, courier-new, courier',
|
10
10
|
fontSize: fontSize,
|
11
11
|
scrollback: maxScrollback,
|
12
12
|
theme: {
|
@@ -36,20 +36,20 @@ terminal.loadAddon(new CanvasAddon.CanvasAddon());
|
|
36
36
|
unicode11Addon = new Unicode11Addon.Unicode11Addon();
|
37
37
|
terminal.loadAddon(unicode11Addon);
|
38
38
|
terminal.unicode.activeVersion = '11';
|
39
|
-
terminal.register({
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
});
|
39
|
+
// terminal.register({
|
40
|
+
// wcwidth: (character) => {
|
41
|
+
// const code = character.charCodeAt(0);
|
42
|
+
// if (code == 0x1F525) return 2; // Fire emoji
|
43
|
+
// // Handle powerline symbols (usually should be width 1)
|
44
|
+
// if (code >= 0xE0A0 && code <= 0xE0D4) return 1;
|
45
|
+
// // Handle other specific unicode ranges
|
46
|
+
// if (code >= 0x1100 && code <= 0x11FF) return 2; // Hangul Jamo
|
47
|
+
// if (code >= 0x3000 && code <= 0x30FF) return 2; // CJK Symbols and Japanese
|
48
|
+
// if (code >= 0x4E00 && code <= 0x9FFF) return 2; // CJK Unified Ideographs
|
49
|
+
// // Default to system wcwidth
|
50
|
+
// return null;
|
51
|
+
// }
|
52
|
+
// });
|
53
53
|
|
54
54
|
const fitAddon = new FitAddon.FitAddon();
|
55
55
|
terminal.loadAddon(fitAddon);
|
pywebexec/static/js/script.js
CHANGED
@@ -22,7 +22,7 @@ function initTerminal()
|
|
22
22
|
cursorInactiveStyle: 'none',
|
23
23
|
disableStdin: true,
|
24
24
|
//convertEol: true,
|
25
|
-
fontFamily: '"
|
25
|
+
fontFamily: '"CommitMono Nerd Font Mono", "Fira Code", monospace, "Powerline Extra Symbols", courier-new, courier',
|
26
26
|
fontSize: fontSize,
|
27
27
|
scrollback: maxScrollback,
|
28
28
|
theme: {
|
@@ -59,20 +59,20 @@ terminal.loadAddon(new CanvasAddon.CanvasAddon());
|
|
59
59
|
unicode11Addon = new Unicode11Addon.Unicode11Addon();
|
60
60
|
terminal.loadAddon(unicode11Addon);
|
61
61
|
terminal.unicode.activeVersion = '11';
|
62
|
-
terminal.register({
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
});
|
62
|
+
// terminal.register({
|
63
|
+
// wcwidth: (character) => {
|
64
|
+
// const code = character.charCodeAt(0);
|
65
|
+
// if (code == 0x1F525) return 3; // Fire emoji
|
66
|
+
// // Handle powerline symbols (usually should be width 1)
|
67
|
+
// if (code >= 0xE0A0 && code <= 0xE0D4) return 1;
|
68
|
+
// // Handle other specific unicode ranges
|
69
|
+
// if (code >= 0x1100 && code <= 0x11FF) return 3; // Hangul Jamo
|
70
|
+
// if (code >= 0x3000 && code <= 0x30FF) return 3; // CJK Symbols and Japanese
|
71
|
+
// if (code >= 0x4E00 && code <= 0x9FFF) return 3; // CJK Unified Ideographs
|
72
|
+
// // Default to system wcwidth
|
73
|
+
// return null;
|
74
|
+
// }
|
75
|
+
// });
|
76
76
|
|
77
77
|
const fitAddon = new FitAddon.FitAddon();
|
78
78
|
terminal.loadAddon(fitAddon);
|
pywebexec/version.py
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
pywebexec/__init__.py,sha256=197fHJy0UDBwTTpGCGortZRr-w2kTaD7MxqdbVmTEi0,61
|
2
2
|
pywebexec/host_ip.py,sha256=Ud_HTflWVQ8789aoQ2RZdT1wGI-ccvrwSWGz_c7T3TI,1241
|
3
|
-
pywebexec/pywebexec.py,sha256=
|
4
|
-
pywebexec/version.py,sha256=
|
5
|
-
pywebexec/static/css/
|
6
|
-
pywebexec/static/css/style.css,sha256=fU-_eAk6Xy0L_GbH9rJBkeCFe5M2RYQA99cvRZ3pW9w,7934
|
3
|
+
pywebexec/pywebexec.py,sha256=Pwsjq9VpM19l10-suEZ5nEXBv-LOaJNZy91ubuAkBos,32541
|
4
|
+
pywebexec/version.py,sha256=8ety3-vW-PuHKrxUFSl1a0H98STtZwISOYo9asXn_xo,511
|
5
|
+
pywebexec/static/css/style.css,sha256=xIVBpx_qfJOqMF678cIdbIs6rT_iZ8EPfFGC1TBYWoE,7986
|
7
6
|
pywebexec/static/css/xterm.css,sha256=uo5phWaUiJgcz0DAzv46uoByLLbJLeetYosL1xf68rY,5559
|
7
|
+
pywebexec/static/fonts/CommitMonoNerdFontMono-Regular.otf,sha256=gGTSi6NCkg_8ylwMsiDTlQ6YudJDg10nDLwSoIRSs18,7827928
|
8
|
+
pywebexec/static/fonts/LICENSE,sha256=Li3JN3B4GQhudjHQLmGD--UjFqidoKYR2bCdO-fUvXI,4389
|
8
9
|
pywebexec/static/images/aborted.svg,sha256=2nuvSwGBIZGWtlM1DrBO3qiSq1reDbcZDAj9rJXBnjY,380
|
9
10
|
pywebexec/static/images/copy.svg,sha256=d9OwtGh5GzzZHzYcDrLfNxZYLth1Q64x7bRyYxu4Px0,622
|
10
11
|
pywebexec/static/images/copy_ok.svg,sha256=mEqUVUhSq8xaJK2msQkxRawnz_KwlCZ-tok8QS6hJ3g,451
|
@@ -22,8 +23,8 @@ pywebexec/static/images/resume.svg,sha256=99LP1Ya2JXakRCO9kW8JMuT_4a_CannF65Eiuw
|
|
22
23
|
pywebexec/static/images/running.svg,sha256=fBCYwYb2O9K4N3waC2nURP25NRwZlqR4PbDZy6JQMww,610
|
23
24
|
pywebexec/static/images/success.svg,sha256=NVwezvVMplt46ElW798vqGfrL21Mw_DWHUp_qiD_FU8,489
|
24
25
|
pywebexec/static/js/commands.js,sha256=TmfcauQlfIeAeC8pwQvKspc4PA_VYLbPTnVCDVBZ87I,8420
|
25
|
-
pywebexec/static/js/popup.js,sha256=
|
26
|
-
pywebexec/static/js/script.js,sha256=
|
26
|
+
pywebexec/static/js/popup.js,sha256=aXT2oxkpUAkVAhKtAyyVMsMb1MVTDJ0Br0aA9ZBRvGI,9510
|
27
|
+
pywebexec/static/js/script.js,sha256=e_yjyZazcn9YS7VQhDV_8f3gFfnd7rEF0cQyi5hQ1aA,18594
|
27
28
|
pywebexec/static/js/xterm/LICENSE,sha256=EU1P4eXTull-_T9I80VuwnJXubB-zLzUl3xpEYj2T1M,1083
|
28
29
|
pywebexec/static/js/xterm/addon-canvas.js,sha256=ez6QTVvsmLVNJmdJlM-ZQ5bErwlxAQ_9DUmDIptl2TM,94607
|
29
30
|
pywebexec/static/js/xterm/addon-canvas.js.map,sha256=ECBA4B-BqUpdFeRzlsEWLSQnudnhLP-yPQJ8_hKquMo,379537
|
@@ -36,9 +37,9 @@ pywebexec/static/js/xterm/xterm.js.map,sha256=Y7O2Pb-fIS7Z8AC1D5s04_aiW_Jf1f4mCf
|
|
36
37
|
pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
38
|
pywebexec/templates/index.html,sha256=KSdQYBdzWKP6v0ETZsMO_729aosGBAzJxAss8T5jCto,2953
|
38
39
|
pywebexec/templates/popup.html,sha256=f5m4u8WKpkevL2mQamGqo4_y-rSuLOXGuNsezuUbniY,1508
|
39
|
-
pywebexec-1.
|
40
|
-
pywebexec-1.
|
41
|
-
pywebexec-1.
|
42
|
-
pywebexec-1.
|
43
|
-
pywebexec-1.
|
44
|
-
pywebexec-1.
|
40
|
+
pywebexec-1.8.1.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
|
41
|
+
pywebexec-1.8.1.dist-info/METADATA,sha256=L23NFLbVDGDKYroC9kP37hV8YXjoQ0lAnBZzVK4CBuY,8146
|
42
|
+
pywebexec-1.8.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
43
|
+
pywebexec-1.8.1.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
|
44
|
+
pywebexec-1.8.1.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
|
45
|
+
pywebexec-1.8.1.dist-info/RECORD,,
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|