Skip to content
Browse files

Add --sleep to tern.

  • Loading branch information...
1 parent b7d679c commit 0a3227771be4f59abde19bc8606f6577aca0293c @sjl sjl committed Apr 1, 2013
Showing with 11 additions and 0 deletions.
  1. +11 −0 apps/subtitles/tern.py
View
11 apps/subtitles/tern.py
@@ -34,6 +34,7 @@
# # https://en.wikipedia.org/wiki/Arctic_Tern
import datetime
+import time
import csv as csv_module
import os, sys
import random
@@ -871,6 +872,10 @@ def build_option_parser():
help='django settings module to use',
metavar='MODULE_NAME')
+ p.add_option('-S', '--sleep', default=None,
+ help='sleep for N milliseconds before starting',
+ metavar='N')
+
g = OptionGroup(p, "Commands")
g.add_option('-C', '--count', dest='command', default=None,
@@ -913,6 +918,12 @@ def main():
setup_path()
setup_settings(options)
+ if options.sleep:
+ ms = int(options.sleep)
+ print 'Sleeping for %dms...' % ms
+ time.sleep(ms / 1000.0)
+ print 'Waking up...'
+
if options.command == 'count':
count()
elif options.command == 'languages':

0 comments on commit 0a32277

Please sign in to comment.
Something went wrong with that request. Please try again.