Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openrave
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Till Hofmann
openrave
Commits
4e13f231
Commit
4e13f231
authored
12 years ago
by
rdiankov
Browse files
Options
Downloads
Patches
Plain Diff
0.8.0 hotfix for ipython 0.11+
parent
2d6ab8dd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/openrave.py.in
+18
-3
18 additions, 3 deletions
python/openrave.py.in
with
18 additions
and
3 deletions
python/openrave.py.in
+
18
−
3
View file @
4e13f231
...
@@ -199,8 +199,14 @@ if __name__ == "__main__":
...
@@ -199,8 +199,14 @@ if __name__ == "__main__":
ipythonthread = None
ipythonthread = None
if options.ipython:
if options.ipython:
api_version = None
import IPython
if IPython.__version__.startswith("0.10"):
api_version = '0.10'
elif IPython.__version__.startswith("0.11"):
api_version = '0.11'
# start ipython in a separate thread
# start ipython in a separate thread
from IPython.Shell import IPShellEmbed
def ipythonthreadfn(env):
def ipythonthreadfn(env):
try:
try:
with env:
with env:
...
@@ -208,8 +214,17 @@ if __name__ == "__main__":
...
@@ -208,8 +214,17 @@ if __name__ == "__main__":
robot=None if len(robots) == 0 else robots[0]
robot=None if len(robots) == 0 else robots[0]
bodies=env.GetBodies()
bodies=env.GetBodies()
body=None if len(bodies) == 0 else bodies[0]
body=None if len(bodies) == 0 else bodies[0]
ipshell = IPShellEmbed(argv='',banner = 'OpenRAVE Dropping into IPython, variables: env, robot, body',exit_msg = 'Leaving Interpreter and closing program.')
if api_version == '0.10':
ipshell(local_ns=locals())
ipshell = IPython.Shell.IPShellEmbed(argv='',banner = 'OpenRAVE %s dropping into IPython, variables: env, robot, body'%openravepy.__version__,exit_msg = 'Leaving Interpreter and closing program.')
ipshell(local_ns=locals())
else:
from IPython.config.loader import Config
cfg = Config()
cfg.InteractiveShellEmbed.local_ns = locals()
cfg.InteractiveShellEmbed.global_ns = globals()
IPython.embed(config=cfg, banner2 = 'OpenRAVE %s dropping into IPython, variables: env, robot, body'%openravepy.__version__)
from IPython.frontend.terminal.embed import InteractiveShellEmbed
ipshell = InteractiveShellEmbed(config=cfg)
finally:
finally:
# ipython exited. if viewer is valid, then exit the viewer also
# ipython exited. if viewer is valid, then exit the viewer also
if viewer is not None:
if viewer is not None:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment