Skip to content

Commit

Permalink
Better output and fix blocking on process kill
Browse files Browse the repository at this point in the history
  • Loading branch information
R2Boyo25 committed May 7, 2023
1 parent 4d854b5 commit f17a6d3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
flask
toml
flask_sock
ansi2html
3 changes: 2 additions & 1 deletion static/proc.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ th {
background-color: #080808;
padding: 25px;
border-radius: 25px;
font-size: 1.5em;
}

table {
table:not(:last-of-type) {
margin-bottom: 50px;
}
5 changes: 5 additions & 0 deletions static/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ td, th {
height: 50px;
word-wrap: break-word;
font-size: 20pt;
vertical-align: middle;
}

tr:nth-child(even) {
background-color: #0000002f
}

#output {
Expand Down
10 changes: 8 additions & 2 deletions villicus.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ def out(self):
while 1:
tmp = self.process.stdout.readline()

if not tmp and not self.process.poll():
if not tmp:
break

self.curout.append(tmp.decode().strip("\n"))

if not self.process.poll():
break

return "\n".join(self.curout)

@property
Expand Down Expand Up @@ -332,9 +335,12 @@ def unpauseProc(proc):
return redirect("/proc/" + proc)


from ansi2html import Ansi2HTMLConverter
conv = Ansi2HTMLConverter()

@app.route("/out/<proc>")
def statTest(proc):
return str(procs.proc(proc).out).replace("\n", "<br>\n")
return conv.convert(str(procs.proc(proc).out))


@app.route("/reload")
Expand Down

0 comments on commit f17a6d3

Please sign in to comment.