pywebexec 1.1.7__py3-none-any.whl → 1.1.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
@@ -541,6 +541,8 @@ def get_command_output(command_id):
541
541
  with open(output_file_path, 'r') as output_file:
542
542
  output = output_file.read()
543
543
  status_data = read_command_status(command_id) or {}
544
+ if request.headers.get('Accept') == 'text/plain':
545
+ return f"{output}\nstatus: {status_data.get('status')}", 200, {'Content-Type': 'text/plain'}
544
546
  return jsonify({'output': output, 'status': status_data.get("status")})
545
547
  return jsonify({'error': 'Invalid command_id'}), 404
546
548
 
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.1.7'
16
- __version_tuple__ = version_tuple = (1, 1, 7)
15
+ __version__ = version = '1.1.8'
16
+ __version_tuple__ = version_tuple = (1, 1, 8)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.1.7
3
+ Version: 1.1.8
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -99,8 +99,8 @@ all commands output / statuses are available in the executables directory in sub
99
99
  * Basic Auth
100
100
  * LDAP(S)
101
101
  * Can be started as a daemon (POSIX)
102
- * uses gunicorn to serve http/https
103
- * compatible Linux/MacOS
102
+ * Uses gunicorn to serve http/https
103
+ * Linux/MacOS compatible
104
104
 
105
105
  ## Customize server
106
106
  ```shell
@@ -148,12 +148,14 @@ $ pywebexec start
148
148
  $ pywebexec status
149
149
  $ pywebexec stop
150
150
  ```
151
- * log of server are stored in directory `[.config/].pywebexec/pywebexec_<listen>:<port>.log`
151
+ * log of server are stored in directory `~/[.config/].pywebexec/pywebexec_<listen>:<port>.log`
152
152
 
153
153
  ## Launch command through API
154
154
 
155
155
  ```shell
156
- $ curl http://myhost:8080/run_script -H 'Content-Type: application/json' -X POST -d '{ "script_name":"myscript", "param":["param1", ...]}
156
+ $ curl http://myhost:8080/run_script -H 'Content-Type: application/json' -X POST -d '{ "script_name":"myscript", "params":["param1", ...]}
157
+ $ curl http://myhost:8080/command_status/<command_id>
158
+ $ curl http://myhost:8080/command_output/<command_id> -H "Accept: text/plain"
157
159
  ```
158
160
 
159
161
  ## API reference
@@ -1,6 +1,6 @@
1
1
  pywebexec/__init__.py,sha256=4spIsVaF8RJt8S58AG_wWoORRNkws9Iwqprj27C3ljM,99
2
- pywebexec/pywebexec.py,sha256=yGx5OkTNFovjsludN5hdX43qoHb7W3FoxmDuJzlq2CU,21229
3
- pywebexec/version.py,sha256=ob_T_OgPz6CVrt23qLmMWVP7iCzz-_1Y1nAwNnu1aVw,411
2
+ pywebexec/pywebexec.py,sha256=fKJElVfBOK_xKlKLPxawrk2gvHT7u8HtK5MAoC2UqPw,21392
3
+ pywebexec/version.py,sha256=25U1asvORbrAJKCcTUX6CWQKe10elb_RImEWqwOk88Y,411
4
4
  pywebexec/static/css/style.css,sha256=_WrN0deHXugf3xkOr2E2ptBzKYo9GoiaYJ4trzPn6ec,2902
5
5
  pywebexec/static/images/aborted.svg,sha256=_mP43hU5QdRLFZIknBgjx-dIXrHgQG23-QV27ApXK2A,381
6
6
  pywebexec/static/images/copy.svg,sha256=d9OwtGh5GzzZHzYcDrLfNxZYLth1Q64x7bRyYxu4Px0,622
@@ -12,9 +12,9 @@ pywebexec/static/images/success.svg,sha256=PJDcCSTevJh7rkfSFLtc7P0pbeh8PVQBS8DaO
12
12
  pywebexec/static/js/script.js,sha256=RrlozMlUx_7MJTf7IG98rzJsLgwEMyEV9bSW6QpQdZw,7088
13
13
  pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  pywebexec/templates/index.html,sha256=7dFHAmHXGMrK1-M6PIAbMS0bv7Pi5-6vDoyUk3irnQc,1346
15
- pywebexec-1.1.7.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
16
- pywebexec-1.1.7.dist-info/METADATA,sha256=7xSuhpJshzZHZnHGBDVXOvpUzRsoUpXB9gt-MbzmIbg,6770
17
- pywebexec-1.1.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
- pywebexec-1.1.7.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
19
- pywebexec-1.1.7.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
20
- pywebexec-1.1.7.dist-info/RECORD,,
15
+ pywebexec-1.1.8.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
16
+ pywebexec-1.1.8.dist-info/METADATA,sha256=axoc2iFeUTlBAuyYfJDSnKr8PYP-6r0pIR8VTFCD1Vs,6905
17
+ pywebexec-1.1.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
+ pywebexec-1.1.8.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
19
+ pywebexec-1.1.8.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
20
+ pywebexec-1.1.8.dist-info/RECORD,,