print 'Beginning keytest.py'
+FNULL = open('/dev/null', 'w')
+
DELAY = '59'
class CommandSource:
drop = random.randint(0, len(self.lines) - 1)
del self.lines[drop]
- p = p - 1 / len(self.lines)
+ #p = p - 1 / len(self.lines)
origlines = self.lines
self.lines = []
for l in origlines:
line = self.lines[self.i]
self.count = self.count + 1
self.i = self.i + 1
- print 'Line read: <<' + line + '>>\n'
+ #print 'Line read: <<' + line + '>>\n'
+ sys.stdout.write('r')
return line.rstrip('\n').rstrip()
before_secs = time.time()
while not lyx_sleeping():
time.sleep(0.02)
- print '.',
+ sys.stdout.write('.')
if time.time() - before_secs > 180:
print 'Killing due to freeze (KILL_FREEZE)'
os.system('import -window root '+screenshot_out+str(x.count)+".png")
time.sleep(0.1)
sys.stdout.flush()
- subprocess.call(["xvkbd", "-xsendevent", "-delay", DELAY, "-text", keystr])
+ if (subprocess.call(
+ ["xvkbd", "-xsendevent", "-delay", DELAY, "-text", keystr],
+ stdout=FNULL,stderr=FNULL
+ ) == 0):
+ sys.stdout.write('*')
+ else:
+ sys.stdout.write('X')
def system_retry(num_retry, cmd):
i = 0
write_commands = True
while True:
- os.system('echo -n LOADAVG:; cat /proc/loadavg')
+ #os.system('echo -n LOADAVG:; cat /proc/loadavg')
c = x.getCommand()
if c == 'Loop':
outfile.close()