freemt
commited on
Commit
•
25a8a17
1
Parent(s):
05d53db
Update app.py
Browse files
app.py
CHANGED
@@ -28,21 +28,21 @@ def process(command):
|
|
28 |
split(command), encoding="utf8", stdout=-1, stderr=-1
|
29 |
) # sp.PIPE: -1
|
30 |
out, err = proc.communicate()
|
31 |
-
|
32 |
except Exception as e:
|
33 |
out, err = "", str(e)
|
34 |
-
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
|
47 |
# not is_command or not flag: text, do seg_text
|
48 |
_ = "\n\n".join(seg_text(command.strip()))
|
|
|
28 |
split(command), encoding="utf8", stdout=-1, stderr=-1
|
29 |
) # sp.PIPE: -1
|
30 |
out, err = proc.communicate()
|
31 |
+
success = True
|
32 |
except Exception as e:
|
33 |
out, err = "", str(e)
|
34 |
+
success = False
|
35 |
|
36 |
+
if success:
|
37 |
+
out = "\n".join(
|
38 |
+
(
|
39 |
+
out,
|
40 |
+
err,
|
41 |
+
)
|
42 |
+
).strip()
|
43 |
+
if not out:
|
44 |
+
out = "No output, that's all we know."
|
45 |
+
return out
|
46 |
|
47 |
# not is_command or not flag: text, do seg_text
|
48 |
_ = "\n\n".join(seg_text(command.strip()))
|