37 from __future__
import print_function
41 cmd =
"find . -type f ! -name '*.svn-base' -a ! -name '*.hg' -a ! -name '*.git' -a " \
42 "\( -name '*.c*' -o -name '*.h*' \)" 45 'class_loader/class_loader.h':
'class_loader/class_loader.hpp',
46 'class_loader/class_loader_core.h':
'class_loader/class_loader_core.hpp',
47 'class_loader/class_loader_exceptions.h':
'class_loader/exceptions.hpp',
48 'class_loader/class_loader_register_macro.h':
'class_loader/register_macro.hpp',
49 'class_loader/meta_object.h':
'class_loader/meta_object.hpp',
50 'class_loader/multi_library_class_loader.h':
'class_loader/multi_library_class_loader.hpp',
51 'class_loader/console_bridge_compatibility.h':
'class_loader/console_bridge_compatibility.hpp',
57 include_prefix =
'#include ' 58 sed_cmd_prefix =
' -exec sed -i \' s' 59 sed_cmd_suffix =
' {} \; ' 62 for old_header, new_header
in header_mappings.iteritems():
63 for leading_token, ending_token
in include_tokens.iteritems():
65 sed_cmd_prefix + sed_separator + \
66 include_prefix + leading_token + old_header + ending_token + sed_separator + \
67 include_prefix + leading_token + new_header + ending_token + sed_separator + \
69 print(
"Looking for '%s' to replace with '%s'" % (old_header, new_header))
71 print(
'Running %s' % full_cmd)
72 ret_code = subprocess.call(full_cmd, shell=
True)