Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Humanoid Path Planner
hpp-rbprm-corba
Commits
82d8ca0f
Commit
82d8ca0f
authored
Jun 08, 2020
by
Guilhem Saurel
Browse files
[Python] ServerManager is now available in hpp-corbaserver
parent
3431a1e1
Changes
1
Show whitespace changes
Inline
Side-by-side
src/hpp/corbaserver/rbprm/utils.py
View file @
82d8ca0f
...
...
@@ -4,17 +4,23 @@
import
os
import
subprocess
import
time
import
warnings
try
:
from
hpp.utils
import
ServerManager
warnings
.
warn
(
'Please import ServerManager directly from hpp.utils'
,
DeprecationWarning
)
except
ImportError
:
# hpp-corbaserver < 4.9.1 fallback
try
:
from
subprocess
import
DEVNULL
,
run
except
ImportError
:
# Python2 fallback
except
ImportError
:
# Python2 fallback
DEVNULL
=
os
.
open
(
os
.
devnull
,
os
.
O_RDWR
)
def
run
(
*
args
):
subprocess
.
Popen
(
*
args
).
wait
()
class
ServerManager
:
class
ServerManager
:
"""A context to ensure a server is running."""
def
__init__
(
self
,
server
):
self
.
server
=
server
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment