Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gepetto-viewer-corba
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
gepetto-viewer-corba
Commits
d80b5740
Commit
d80b5740
authored
5 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
[Python] Add _GhostGraphicalInterface
parent
15b2b6ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gepetto/corbaserver/client.py
+16
-1
16 additions, 1 deletion
src/gepetto/corbaserver/client.py
with
16 additions
and
1 deletion
src/gepetto/corbaserver/client.py
+
16
−
1
View file @
d80b5740
...
...
@@ -60,11 +60,24 @@ class Client:
# At this point, we are NOT in the python interpreter of gepetto-gui
pass
def
gui_client
(
window_name
=
None
,
dont_raise
=
False
,
url
=
None
,
host
=
None
,
port
=
None
):
class
_GhostGraphicalInterface
:
def
__init__
(
self
):
def
nofunc
(
*
args
):
"""
Connection to the GUI failed. Docstring not available.
"""
pass
from
.gepetto.corbaserver
import
GraphicalInterface
for
d_func
in
filter
(
lambda
x
:
x
.
startswith
(
"
_d_
"
),
GraphicalInterface
.
__dict__
.
keys
()):
self
.
__dict__
[
d_func
[
3
:]]
=
nofunc
def
gui_client
(
window_name
=
None
,
dont_raise
=
False
,
ghost
=
False
,
url
=
None
,
host
=
None
,
port
=
None
):
"""
Initialize CORBA and create default clients.
:param window_name: If provided, creates a window with this name if it does not exist.
:param dont_raise: If True, will not raise if connection failed. It returns None instead.
:param ghost: If True and dont_raise is True and the connection failed, an object with
the same API as the client is returned. This is most useful when you don
'
t rely
on values returned by the GUI.
:param url: URL in the IOR, corbaloc, corbalocs, and corbanames formats.
For a remote corba server, use
url =
"
corbaloc:iiop:<host>:<port>/NameService
"
.
...
...
@@ -81,6 +94,8 @@ def gui_client(window_name = None, dont_raise = False, url = None, host = None,
else
:
print
(
"
Failed to connect to the viewer.
"
)
print
(
"
Check whether gepetto-gui is properly started.
"
)
if
ghost
:
return
_GhostGraphicalInterface
()
return
if
window_name
is
not
None
:
gui
.
createWindow
(
window_name
)
...
...
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