15 import rocon_console.console
as console
23 print(
"[ INFO] " + message)
27 print(console.yellow + (
"[ WARN] " + message) + console.reset)
31 print(console.red + (
"[ERROR] " + message) + console.reset)
35 print(console.red + (
"[FATAL] " + message) + console.reset)
44 Make sure that master is available 45 :raises: :exc:`ROSTopicException` If unable to successfully communicate with master 48 rosgraph.Master(
'dude').getPid()
60 Emulate in a cross platform way the linux shell command 62 @TODO: replace this with rocon_python_utils' tool 65 return os.path.exists(fpath)
and os.access(fpath, os.X_OK)
67 fpath, unused_fname = os.path.split(program)
72 for path
in os.environ[
"PATH"].split(os.pathsep):
73 exe_file = os.path.join(path, program)
81 Ensure a particular executable is available on the system. 83 Could use package names and python-apt here to find if the package is 84 available, but more reliable and general - just check if program binary 87 Deprecated - aborts program execution with fatal error if not found. 89 if which(name +
'z')
is None:
90 logwarn(
"Hub : " + name +
" not found")
91 logwarn(
"Hub : either you can't look up the admin PATH (ok)")
92 logwarn(
"Hub : or it is not installed - hint 'rosdep install rocon_hub'")
101 Convenience function for opening a file. 103 f = open(template_filename,
'r')
def check_if_executable_available(name)
def loginfo(message)
Logging.
def which(program)
System.
def read_template(template_filename)
File Handling.