Changeset 478 for tbroadcast/HEAD/python
- Timestamp:
- Nov 28, 2008, 12:42:04 PM (16 years ago)
- Location:
- tbroadcast/HEAD/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tbroadcast/HEAD/python/executer.py
r244 r478 209 209 return 1, retVal['stdout'], retVal['stderr'], 1 210 210 211 ############################################################################ 212 def getstatusoutput(cmd): 213 """Return (status, stdout) of executing cmd in a shell. 214 215 A trailing line separator is removed from the output string. The exit status of the command is encoded in the format specified for wait(), when the exit status is zero (termination without errors), 0 is returned. 216 """ 217 import os 218 p = os.popen(cmd, 'r') 219 out = p.read() 220 sts = p.close() 221 if sts is None: sts = 0 222 if out.endswith(os.linesep): 223 out = out[:out.rindex(os.linesep)] 224 return sts, out 225 211 226 ################################################################################# 212 227 ###################################### EoF ###################################### -
tbroadcast/HEAD/python/tbroadcast.py
r393 r478 24 24 from threadpool import makeRequests 25 25 from executer import exeCommand 26 from executer import getstatusoutput 26 27 27 28 class Scheduler: … … 71 72 def get_current_project(self): 72 73 cmd = 'cmt show projects | grep current' 73 status, output = commands.getstatusoutput (cmd) 74 status, output = getstatusoutput (cmd) 75 # status, output = commands.getstatusoutput (cmd) 74 76 if status != 0: 75 77 print output … … 98 100 cmd = 'cmt -private show cycles' 99 101 cycle_found = False 100 status, output = commands.getstatusoutput (cmd) 102 status, output = getstatusoutput (cmd) 103 # status, output = commands.getstatusoutput (cmd) 101 104 if status != 0: 102 105 print output … … 249 252 else: 250 253 cmd = 'cat ' + file 251 status, output = commands.getstatusoutput (cmd) 254 status, output = getstatusoutput (cmd) 255 # status, output = commands.getstatusoutput (cmd) 252 256 if status != 0: 253 257 print output … … 309 313 def get_current_package(self): 310 314 cmd = 'cmt show macro package' 311 status, output = commands.getstatusoutput (cmd) 315 status, output = getstatusoutput (cmd) 316 # status, output = commands.getstatusoutput (cmd) 312 317 if status != 0: 313 318 print output … … 326 331 #return os.getcwd () 327 332 cmd = 'cmt -use='+name+' run pwd' 328 status, output = commands.getstatusoutput (cmd) 333 status, output = getstatusoutput (cmd) 334 # status, output = commands.getstatusoutput (cmd) 329 335 if status != 0: 330 336 print output
Note: See TracChangeset
for help on using the changeset viewer.