1
2 """Read a file's content slowly line by line.
3
4 If we write monitor output to file for later piping into a player,
5 we have to slow down reading and piping to not overload the player.
6 Regarding the playerChamplain this is a job for dave capella's slowcat.
7
8 @author: dave w capella - http://grox.net/mailme
9 @date: Sun Feb 10 21:57:42 PST 2008
10 """
11
12 __author__ = "dave w capella - http://grox.net/mailme"
13 __copyright__ = "(c) 2002-2008 - dave w capella - All Rights Reserved"
14 __license__ = "distributed under the terms of the GNU Public License, includes NO WARRANTY and NO SUPPORT."
15
16
17
18
19
20 import sys, time
21
22 delay = .02
23
24 if len(sys.argv) > 1:
25 arg = sys.argv[1]
26 if arg != "-d":
27 print "usage: %s [-d delay]" % (sys.argv[0])
28 print "delay: delay in seconds"
29 print "example: %s -d .02 < vtfile" % (sys.argv[0])
30 sys.exit()
31 if len(sys.argv) > 2:
32 delay = float(sys.argv[2])
33
34 while 1:
35 try:
36 print raw_input()
37 except:
38 break
39 time.sleep(delay)
40
41
42
43