summaryrefslogtreecommitdiff
path: root/gr-utils/python/modtool/modtool_makexml.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@kit.edu>2013-11-24 16:41:57 +0100
committerMartin Braun <martin.braun@kit.edu>2013-11-27 22:33:44 +0100
commit49ed57c55e01dffe69668ae34deddd619b3486c8 (patch)
tree8c8ba0c0e2c1f4658667aa8aad19eaa167f5447b /gr-utils/python/modtool/modtool_makexml.py
parentfa5480e8bccec39278e9c5f81c09d1e702fd0fd7 (diff)
modtool: Added git support
Diffstat (limited to 'gr-utils/python/modtool/modtool_makexml.py')
-rw-r--r--gr-utils/python/modtool/modtool_makexml.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/gr-utils/python/modtool/modtool_makexml.py b/gr-utils/python/modtool/modtool_makexml.py
index 4b67d1b062..28eabe1b81 100644
--- a/gr-utils/python/modtool/modtool_makexml.py
+++ b/gr-utils/python/modtool/modtool_makexml.py
@@ -66,6 +66,7 @@ class ModToolMakeXML(ModTool):
(params, iosig, blockname) = self._parse_cc_h(f)
self._make_grc_xml_from_block_data(params, iosig, blockname)
# 2) Go through python/
+ # TODO
def _search_files(self, path, path_glob):
""" Search for files matching pattern in the given path. """
@@ -84,6 +85,7 @@ class ModToolMakeXML(ModTool):
generator. Also, check the makefile if the .xml file is in there.
If necessary, add. """
fname_xml = '%s_%s.xml' % (self._info['modname'], blockname)
+ path_to_xml = os.path.join('grc', fname_xml)
# Some adaptions for the GRC
for inout in ('in', 'out'):
if iosig[inout]['max_ports'] == '-1':
@@ -93,11 +95,13 @@ class ModToolMakeXML(ModTool):
'name': 'Num %sputs' % inout,
'default': '2',
'in_constructor': False})
- if os.path.isfile(os.path.join('grc', fname_xml)):
+ file_exists = False
+ if os.path.isfile(path_to_xml):
if not self._info['yes']:
if not ask_yes_no('Overwrite existing GRC file?', False):
return
else:
+ file_exists = True
print "Warning: Overwriting existing GRC file."
grc_generator = GRCXMLGenerator(
modname=self._info['modname'],
@@ -105,13 +109,18 @@ class ModToolMakeXML(ModTool):
params=params,
iosig=iosig
)
- grc_generator.save(os.path.join('grc', fname_xml))
+ grc_generator.save(path_to_xml)
+ if file_exists:
+ self.scm.mark_files_updated((path_to_xml,))
+ else:
+ self.scm.add_files((path_to_xml,))
if not self._skip_subdirs['grc']:
ed = CMakeFileEditor(self._file['cmgrc'])
if re.search(fname_xml, ed.cfile) is None and not ed.check_for_glob('*.xml'):
print "Adding GRC bindings to grc/CMakeLists.txt..."
ed.append_value('install', fname_xml, to_ignore_end='DESTINATION[^()]+')
ed.write()
+ self.scm.mark_files_updated(self._file['cmgrc'])
def _parse_cc_h(self, fname_cc):
""" Go through a .cc and .h-file defining a block and return info """