34 from __future__
import print_function
43 """print warning to screen (bold red)""" 44 print(
'\033[31m%s\033[0m'%msg, file=sys.stderr)
48 Utility to compute logged in user name 50 :returns: name of current user, ``str`` 53 name = getpass.getuser()
57 name = pwd.getpwnam(login)[4]
58 name =
''.join(name.split(
','))
66 name = name.decode(
'utf-8')
67 except AttributeError:
73 Read resource template from egg installation, or fallback on rospkg otherwise. 75 :returns: text of template file 77 if pkg_resources.resource_exists(
'roscreate', tmplf):
78 f = pkg_resources.resource_stream(
'roscreate', tmplf)
83 with open(os.path.join(r.get_path(
'roscreate'),
'templates', tmplf))
as f:
87 except AttributeError: