1. ronald martinez
  2. hash-m4cf1

Commits

ronald martinez  committed 7f773ce

ok

  • Participants
  • Parent commits 86223bd
  • Branches master

Comments (0)

Files changed (2)

File settings.py

View file
  • Ignore whitespace
 DEBUG = True
-WAIT_FOR_TOKEN = 10
+WAIT_FOR_TOKEN = 20
 DATABASE_FILE = 'm4cf1'
 CODE_LEN = 6
 SECRET_KEY = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'

File test.py

View file
  • Ignore whitespace
+import sys
+import time
+
+from generate_token import Token
+
+wait_for_seconds = 15
+
+token = Token(wait_for_seconds)
+
+seed = 'm4cf1'
+#seed = token.generate_seed(uuid)
+print 'seed: %s' % seed
+
+
+def server():
+
+    while True:
+        print token.generate_code(seed)
+        time.sleep(wait_for_seconds)
+
+if __name__ == '__main__':
+
+    sys_args = sys.argv
+
+    if len(sys_args) == 2:
+        if sys_args[1] == 'server':
+            server()
+    else:
+        code = raw_input('Enter code:')
+        print token.verify_code(seed, code)