mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
replace output
This commit is contained in:
parent
1d372df49d
commit
ca795cff40
2 changed files with 11 additions and 11 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue