summaryrefslogtreecommitdiff
path: root/gr-utils/python/modtool/modtool_disable.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-utils/python/modtool/modtool_disable.py')
-rw-r--r--gr-utils/python/modtool/modtool_disable.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/gr-utils/python/modtool/modtool_disable.py b/gr-utils/python/modtool/modtool_disable.py
index 619858978d..556b2e1ab2 100644
--- a/gr-utils/python/modtool/modtool_disable.py
+++ b/gr-utils/python/modtool/modtool_disable.py
@@ -76,11 +76,11 @@ class ModToolDisable(ModTool):
def _handle_cc_qa(cmake, fname):
""" Do stuff for cc qa """
if self._info['version'] == '37':
- cmake.comment_out_lines('\$\{CMAKE_CURRENT_SOURCE_DIR\}/'+fname)
+ cmake.comment_out_lines(r'\$\{CMAKE_CURRENT_SOURCE_DIR\}/'+fname)
fname_base = os.path.splitext(fname)[0]
ed = CMakeFileEditor(self._file['qalib']) # Abusing the CMakeFileEditor...
- ed.comment_out_lines('#include\s+"%s.h"' % fname_base, comment_str='//')
- ed.comment_out_lines('%s::suite\(\)' % fname_base, comment_str='//')
+ ed.comment_out_lines(r'#include\s+"%s.h"' % fname_base, comment_str='//')
+ ed.comment_out_lines(r'%s::suite\(\)' % fname_base, comment_str='//')
ed.write()
self.scm.mark_file_updated(self._file['qalib'])
elif self._info['version'] == '36':
@@ -93,9 +93,8 @@ class ModToolDisable(ModTool):
""" Comment out include files from the SWIG file,
as well as the block magic """
swigfile = open(self._file['swig']).read()
- (swigfile, nsubs) = re.subn('(.include\s+"(%s/)?%s")' % (
- self._info['modname'], fname),
- r'//\1', swigfile)
+ (swigfile, nsubs) = re.subn(r'(.include\s+"(%s/)?%s")' % (
+ self._info['modname'], fname), r'//\1', swigfile)
if nsubs > 0:
print("Changing %s..." % self._file['swig'])
if nsubs > 1: # Need to find a single BLOCK_MAGIC
@@ -124,15 +123,16 @@ class ModToolDisable(ModTool):
self.setup(options)
# List of special rules: 0: subdir, 1: filename re match, 2: callback
special_treatments = (
- ('python', 'qa.+py$', _handle_py_qa),
- ('python', '^(?!qa).+py$', _handle_py_mod),
- ('lib', 'qa.+\.cc$', _handle_cc_qa),
- ('include/%s' % self._info['modname'], '.+\.h$', _handle_h_swig),
- ('include', '.+\.h$', _handle_h_swig),
- ('swig', '.+\.i$', _handle_i_swig)
+ ('python', r'qa.+py$', _handle_py_qa),
+ ('python', r'^(?!qa).+py$', _handle_py_mod),
+ ('lib', r'qa.+\.cc$', _handle_cc_qa),
+ ('include/%s' % self._info['modname'], r'.+\.h$', _handle_h_swig),
+ ('include', r'.+\.h$', _handle_h_swig),
+ ('swig', r'.+\.i$', _handle_i_swig)
)
for subdir in self._subdirs:
- if self._skip_subdirs[subdir]: continue
+ if self._skip_subdirs[subdir]:
+ continue
if self._info['version'] == '37' and subdir == 'include':
subdir = 'include/%s' % self._info['modname']
try: