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