You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@livy.apache.org by GitBox <gi...@apache.org> on 2019/01/22 21:31:54 UTC

[GitHub] vanzin commented on a change in pull request #119: [LIVY-527] added autocompletion api and implementation for ipython

vanzin commented on a change in pull request #119: [LIVY-527] added autocompletion api and implementation for ipython
URL: https://github.com/apache/incubator-livy/pull/119#discussion_r249967903
 
 

 ##########
 File path: repl/src/main/resources/fake_shell.py
 ##########
 @@ -49,6 +49,22 @@
 
 TOP_FRAME_REGEX = re.compile(r'\s*File "<stdin>".*in <module>')
 
+def get_completer():
+    try:
+        __IPYTHON__
+        from IPython.core.completer import IPCompleter
+        ip = get_ipython()
+        ip_completer = IPCompleter(ip,global_namespace=global_dict)
+        global_dict['ip_completer'] = ip_completer
 
 Review comment:
   I see what you mean (`ip_completer` vs. `p_completer`). 
   
   I think it would be better to keep a single variable for the completer, and a boolean that says whether to use the IPython API.
   
   But my main question was: do they need to be stored in `global_dict` or can they just be a global variable in this module instead?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services