PEP8 the rest of the file

This commit is contained in:
2013-07-14 14:50:04 -04:00
parent ce7a103066
commit 93c407a9e3
2 changed files with 49 additions and 43 deletions
+17 -17
View File
@@ -1,11 +1,11 @@
#!/usr/bin/env python
import string, os
VER="mlog 1.00"
VER = "mlog 1.00"
hosts=["weekend", "wingbat"]
hosts = ["weekend", "wingbat"]
URI="/~andreas/private/mlog.cgi?"
URI = "/~andreas/private/mlog.cgi?"
print "Content-type: text/html"
print "max-age: 0"
@@ -24,35 +24,35 @@ print "<pre>"
def hstlines(host):
cmd="/sbin/ping -c 1 -w 2 %s 2>&1 >/dev/null" % host
r=os.system(cmd)
cmd = "/sbin/ping -c 1 -w 2 %s 2>&1 >/dev/null" % host
r = os.system(cmd)
if r == 0:
p=os.popen("rsh %s tail -200 .heyu/logs/motion.log | grep -v again | tail -32" % host, "r")
l=p.readlines()
p = os.popen("rsh %s tail -200 .heyu/logs/motion.log | grep -v again | tail -32" % host, "r")
l = p.readlines()
else:
l=["<B>Host %s is unreachable</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" % host]
l = ["<B>Host %s is unreachable</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" % host]
return l
rep=[]
for host in hosts:
rep = []
for host in hosts:
rep.append(hstlines(host))
print '<table cellpading="0" cellspacing="0" border="0" style="color:black;text-align:left">'
i=0
print "<tr><th>%s</th></tr>" % string.join(hosts,'</th><th>')
i = 0
print "<tr><th>%s</th></tr>" % string.join(hosts, '</th><th>')
while 1:
line=[]
f=0
line = []
f = 0
for h in rep:
try:
line.append(h[i][:-1])
f=1
f = 1
except:
line.append("")
if f == 0:
break
print "<tr><td>%s</td></tr>" % string.join(line,'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>')
i+=1
print "<tr><td>%s</td></tr>" % string.join(line, '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>')
i += 1
print '</table></pre>'
execfile("/home/andreas/cgi-bin/trailer.py")