diff --git a/main.py b/main.py index 473f53a..2370430 100644 --- a/main.py +++ b/main.py @@ -19,7 +19,7 @@ yellow=(0x00,0xcc,0xff) light_green=(0x33,0xff,0xcc) green=(0x00,0xcc,0x00) imgpath="/tmp/uptime-graph/" -def update_history(history): +def update_history(history,recent): average=0 for i in recent: average+=i @@ -75,7 +75,7 @@ if __name__=="__main__": if len(recent_blog)<10: recent_blog.append(delay) else: - update_history(blog) + update_history(blog,recent_blog) update_graph("blog.png",blog) recent_blog=[] recent_blog.append(delay) @@ -92,7 +92,7 @@ if __name__=="__main__": if len(recent_cloud)<10: recent_cloud.append(delay) else: - update_history(cloud) + update_history(cloud,recent_cloud) update_graph("cloud.png",cloud) recent_cloud=[] recent_cloud.append(delay) @@ -109,7 +109,7 @@ if __name__=="__main__": if len(recent_code)<10: recent_code.append(delay) else: - update_history(code) + update_history(code,recent_code) update_graph("code.png",code) recent_code=[] recent_code.append(delay) @@ -126,7 +126,7 @@ if __name__=="__main__": if len(recent_git)<10: recent_git.append(delay) else: - update_history(git) + update_history(git,recent_git) update_graph("git.png",git) recent_git=[] recent_git.append(delay) \ No newline at end of file