MCPcopy
hub / github.com/cherrypy/cherrypy / read_process

Function read_process

cherrypy/_cpmodpy.py:289–304  ·  view source on GitHub ↗
(cmd, args='')

Source from the content-addressed store, hash-verified

287
288
289def read_process(cmd, args=''):
290 fullcmd = '%s %s' % (cmd, args)
291 pipeout = popen(fullcmd)
292 try:
293 firstline = pipeout.readline()
294 cmd_not_found = re.search(
295 b'(not recognized|No such file|not found)',
296 firstline,
297 re.IGNORECASE
298 )
299 if cmd_not_found:
300 raise IOError('%s must be on your system path.' % cmd)
301 output = firstline + pipeout.read()
302 finally:
303 pipeout.close()
304 return output
305
306
307class ModPythonServer(object):

Callers 1

startMethod · 0.70

Calls 4

popenFunction · 0.85
readlineMethod · 0.45
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…