replace output

This commit is contained in:
cloverhearts 2017-04-10 17:30:28 +09:00 committed by CloverHearts
parent 1d372df49d
commit ca795cff40
2 changed files with 11 additions and 11 deletions

View file

@ -47,7 +47,7 @@ class __ZeppelinLogger__(object):
pass
class PyZeppelinContext(object):
class __PyZeppelinContext__(object):
""" A context impl that uses Py4j to communicate to JVM
"""
@ -204,11 +204,11 @@ intp = gateway.entry_point
intp.onPythonScriptInitialized(os.getpid())
java_import(gateway.jvm, "org.apache.zeppelin.display.Input")
z = _zc = PyZeppelinContext(intp)
z = _zc = __PyZeppelinContext__(intp)
_zc._setup_matplotlib()
output = __ZeppelinLogger__()
sys.stdout = output
__zcStdOutput__ = __ZeppelinLogger__()
sys.stdout = __zcStdOutput__
#sys.stderr = output
while True :
@ -290,4 +290,4 @@ while True :
except:
intp.setStatementsFinished(traceback.format_exc(), True)
output.reset()
__zcStdOutput__.reset()

View file

@ -49,7 +49,7 @@ class __ZeppelinLogger__(object):
pass
class PyZeppelinContext(dict):
class __PyZeppelinContext__(dict):
def __init__(self, zc):
self.z = zc
self._displayhook = lambda *args: None
@ -230,9 +230,9 @@ class PySparkCompletion:
self.interpreterObject.setStatementsFinished(result, False)
output = __ZeppelinLogger__()
sys.stdout = output
sys.stderr = output
__zcStdOutput__ = __ZeppelinLogger__()
sys.stdout = __zcStdOutput__
sys.stderr = __zcStdOutput__
client = GatewayClient(port=int(sys.argv[1]))
sparkVersion = SparkVersion(int(sys.argv[2]))
@ -282,7 +282,7 @@ else:
sqlContext = sqlc
completion = PySparkCompletion(intp)
z = _zc = PyZeppelinContext(intp.getZeppelinContext())
z = _zc = __PyZeppelinContext__(intp.getZeppelinContext())
_zc._setup_matplotlib()
while True :
@ -358,4 +358,4 @@ while True :
except:
intp.setStatementsFinished(traceback.format_exc(), True)
output.reset()
__zcStdOutput__.reset()