ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/qstat.py
(Generate patch)

Comparing UserCode/VHbb/python/qstat.py (file contents):
Revision 1.1 by peller, Thu Oct 11 12:28:59 2012 UTC vs.
Revision 1.3 by peller, Fri Apr 5 13:35:00 2013 UTC

# Line 1 | Line 1
1   #!/usr/bin/env python
2   import os,sys
3   from time import sleep
4 + import signal
5 + def signal_handler(signal, frame):
6 +        print 'ciao!'
7 +        sys.exit(0)
8 + signal.signal(signal.SIGINT, signal_handler)
9 +
10 + p = sys.argv
11 + p[0] = 'qstat'
12 + pj = ' '.join(p)
13   class progbar:
14      def __init__(self,width):
15          self.width=width
# Line 11 | Line 20 | class progbar:
20          sys.stdout.write("\033[1;42m \033[1;m")
21          sys.stdout.flush()
22   def getnum():
23 <    q=os.popen('qstat')
23 >    q=os.popen(pj)
24      num=len(q.readlines())
25      if num > 2: return num-2
26      else: return 0

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines