コード例 #1
0
ファイル: graphs.py プロジェクト: animeshinvinci/pycopia
def testplot(request):
    """This is a web framework handler."""
    from WWW.framework import HttpResponse
    args = (1,)
    proc = proctools.coprocess(makeplot, args)
    out = proc.read()
    proc.wait()
    # render to response
    return HttpResponse(out, mimetype="image/png")
コード例 #2
0
ファイル: test_proctools.py プロジェクト: pruan/TestDepot
	def test_method(self):
		sub = proctools.coprocess(_co_function)
		self.info("childpid: %s (will exit in 5 seconds)" % (sub.childpid,))
		line = sub.readline()
		es = sub.wait()
		if es:
			if line == "hello from co_function\r\n": # CR added by pty
				return self.passed("coprocess started and exited")
			else:
				self.diagnostic(repr(line))
				return self.failed("bad string returned.")
		else:
			self.diagnostic(es)
			return self.failed("coprocess failed.")
コード例 #3
0
 def test_method(self):
     sub = proctools.coprocess(_co_function)
     self.info("childpid: %s (will exit in 5 seconds)" % (sub.childpid,))
     line = sub.readline()
     es = sub.wait()
     if es:
         if line == "hello from co_function\r\n": # CR added by pty
             return self.passed("coprocess started and exited")
         else:
             self.diagnostic(repr(line))
             return self.failed("bad string returned.")
     else:
         self.diagnostic(es)
         return self.failed("coprocess failed.")