Only store 9 images

This commit is contained in:
simon.kagstrom 2010-02-28 18:57:31 +00:00
parent a167829510
commit bb34cfd531
2 changed files with 3 additions and 3 deletions

View File

@ -447,7 +447,7 @@ class Peer:
if entry.get_key() == self.screenshot_key:
try:
which = self.srv.next_image_nr
self.srv.next_image_nr = (self.srv.next_image_nr + 1) % 12
self.srv.next_image_nr = (self.srv.next_image_nr + 1) % 9
f = open("%s%d.png" % (self.srv.image_dir, which), "w")
f.write(entry.get_data())
f.close()
@ -583,7 +583,7 @@ class Broker(SocketServer.UDPServer):
self.image_dir = image_dir
self.data_key = DATA_KEY_RANGE
self.next_image_nr = random.randrange(0,12)
self.next_image_nr = random.randrange(0,9)
stats.load(self.stat_data)
try:

View File

@ -66,7 +66,7 @@ class HtmlGenerator:
images = ""
if cnt % 4 == 0:
cur = cnt
images = "<TH ROWSPAN=4><IMG SRC=\"images/%d.png\"></TH><TH ROWSPAN=4><IMG SRC=\"images/%d.png\"></TH><TH ROWSPAN=4><IMG SRC=\"images/%d.png\"></TH><TH ROWSPAN=4><IMG SRC=\"images/%d.png\"></TH>" % (cur, cur + 1, cur + 2, cur + 3)
images = "<TH ROWSPAN=4><IMG SRC=\"images/%d.png\"></TH><TH ROWSPAN=4><IMG SRC=\"images/%d.png\"></TH><TH ROWSPAN=4><IMG SRC=\"images/%d.png\"></TH>" % (cur, cur + 1, cur + 2)
outf.write("<TR><TD>%s</TD><TD>&nbsp;</TD>%s</TR>\n" % (item, images) )
cnt = cnt + 1
outf.write("<TR><TD>&nbsp;</TD></TR>")