File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,4 +55,9 @@ COPY jupyter /.jupyter
5555RUN chown cryo:smurf -R /.jupyter
5656ENV JUPYTER_CONFIG_DIR=/.jupyter
5757
58+ # IPython startup script to pre-warm tab completion
59+ RUN mkdir -p /.ipython/profile_default/startup
60+ COPY jupyter/ipython_startup.py /.ipython/profile_default/startup/00-warm-completion.py
61+ RUN chown cryo:smurf -R /.ipython
62+
5863ENTRYPOINT ["start_client.sh" ]
Original file line number Diff line number Diff line change 1+ import threading
2+
3+
4+ def _warm_completion ():
5+ """Pre-warm jedi's completion cache for SmurfControl."""
6+ try :
7+ import pysmurf .client
8+ obj = pysmurf .client .SmurfControl (offline = True )
9+ dir (obj )
10+ from IPython import get_ipython
11+ ip = get_ipython ()
12+ if ip is not None :
13+ ip .complete ('obj.get' )
14+ except Exception :
15+ pass
16+
17+
18+ threading .Thread (target = _warm_completion , daemon = True ).start ()
You can’t perform that action at this time.
0 commit comments