34 from __future__
import print_function
45 """print warning to screen (bold red)""" 46 print(
'\033[31m%s\033[0m' % msg, file=sys.stderr)
51 Utility to compute logged in user name 53 :returns: name of current user, ``str`` 56 name = getpass.getuser()
60 name = pwd.getpwnam(login)[4]
61 name =
''.join(name.split(
','))
69 name = name.decode(
'utf-8')
70 except AttributeError:
77 Read resource template from egg installation, or fallback on rospkg otherwise. 79 :returns: text of template file 81 if pkg_resources.resource_exists(
'roscreate', tmplf):
82 f = pkg_resources.resource_stream(
'roscreate', tmplf)
87 with open(os.path.join(r.get_path(
'roscreate'),
'templates', tmplf))
as f:
91 except AttributeError: