Permalink
Browse files

Option to reset all regardless

  • Loading branch information...
Charlie
Charlie committed Aug 27, 2010
1 parent 10f24c2 commit 72854eb94e3cdaf5330c04f3719ab87c2bed25ae
Showing with 9 additions and 3 deletions.
  1. +9 −3 cronjob.py
View
@@ -7,9 +7,10 @@
import json
import sign
import time
+import sys
-for i in range(1,3):
- result = urllib.urlopen("http://signs.hackerdojo.com/api")
+def setup_signs(api):
+ result = urllib.urlopen("http://signs.hackerdojo.com"+api)
rawdata = result.read()
result.close()
signs = json.loads(rawdata)
@@ -20,5 +21,10 @@
sign.twoLines(s['two_digit_id'], lines[0], lines[1])
if len(lines)==1:
sign.oneLine(s['two_digit_id'], lines[0])
- time.sleep(15)
+if len(sys.argv)==2 and sys.argv[1] == "all":
+ setup_signs("/api/all")
+else:
+ for i in range(1,3):
+ setup_signs("/api")
+ time.sleep(15)

0 comments on commit 72854eb

Please sign in to comment.