Spaces:
Build error
Build error
freemt
commited on
Commit
·
8840474
1
Parent(s):
ae4aed4
Update longer (500 chars) cmd
Browse files
app.py
CHANGED
|
@@ -36,7 +36,7 @@ def process(command):
|
|
| 36 |
# print("print input:\n\t %s" % command)
|
| 37 |
# print("print input*:\n\t %s" % "*".join(command.splitlines()))
|
| 38 |
is_command = True
|
| 39 |
-
is_command = command.strip().splitlines().__len__() < 2 and len(command.strip()) <
|
| 40 |
|
| 41 |
if is_command:
|
| 42 |
try:
|
|
@@ -50,16 +50,10 @@ def process(command):
|
|
| 50 |
out, err = "", str(e)
|
| 51 |
success = False
|
| 52 |
|
| 53 |
-
if
|
| 54 |
-
out
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
err,
|
| 58 |
-
)
|
| 59 |
-
).strip()
|
| 60 |
-
if not out:
|
| 61 |
-
out = "No output, that's all we know."
|
| 62 |
-
return out, None
|
| 63 |
|
| 64 |
# quick test altair altair-save tooltip
|
| 65 |
# from PIL import Image
|
|
|
|
| 36 |
# print("print input:\n\t %s" % command)
|
| 37 |
# print("print input*:\n\t %s" % "*".join(command.splitlines()))
|
| 38 |
is_command = True
|
| 39 |
+
is_command = command.strip().splitlines().__len__() < 2 and len(command.strip()) < 500
|
| 40 |
|
| 41 |
if is_command:
|
| 42 |
try:
|
|
|
|
| 50 |
out, err = "", str(e)
|
| 51 |
success = False
|
| 52 |
|
| 53 |
+
if out.strip() and err.strip():
|
| 54 |
+
return out, err
|
| 55 |
+
else:
|
| 56 |
+
"No output, that's all we know.", None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
# quick test altair altair-save tooltip
|
| 59 |
# from PIL import Image
|