10 CONFIG_PATH = os.path.expanduser(
'~/.ros/roscompile.yaml')
12 PKG_PATH = rospkg.RosPack().get_path(
'roscompile')
13 TRAILING_PATTERN = re.compile(
r'^(.*[^\w])\w+\n$')
15 roscompile_functions = collections.OrderedDict()
19 roscompile_functions[f.__name__] = f
24 fn = os.path.join(PKG_PATH,
'data', basename +
'.ignore')
26 if not os.path.exists(fn):
43 ignore_lines.append(pattern % variables)
48 existing_permissions = stat.S_IMODE(os.lstat(fn).st_mode)
49 os.chmod(fn, existing_permissions | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
53 existing_permissions = stat.S_IMODE(os.lstat(fn).st_mode)
54 os.chmod(fn, existing_permissions | ~stat.S_IXUSR | ~stat.S_IXGRP | ~stat.S_IXOTH)
60 if os.path.exists(CONFIG_PATH):
61 CONFIG = yaml.safe_load(open(CONFIG_PATH))
69 s1 = re.sub(
'(.)([A-Z][a-z]+)',
r'\1_\2', name)
70 return re.sub(
'([a-z0-9])([A-Z])',
r'\1_\2', s1).lower()
74 return ''.join([x.title()
for x
in name.split(
'_')])