summaryrefslogtreecommitdiff
path: root/grc/python/Generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/python/Generator.py')
-rw-r--r--grc/python/Generator.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index 7512cfb633..a263679a8e 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -219,8 +219,8 @@ class HierBlockGenerator(TopBlockGenerator):
"""
TopBlockGenerator.__init__(self, flow_graph, file_path)
self._mode = HIER_BLOCK_FILE_MODE
- self._file_path = os.path.join(HIER_BLOCKS_LIB_DIR,
- self._flow_graph.get_option('id') + '.py')
+ self._file_name = self._flow_graph.get_option('id') + '.py'
+ self._file_path = os.path.join(HIER_BLOCKS_LIB_DIR, self._file_name)
self._file_path_xml = self._file_path + '.xml'
def get_file_path_xml(self):
@@ -254,7 +254,7 @@ class HierBlockGenerator(TopBlockGenerator):
self._flow_graph.get_option('id').replace('_', ' ').title()
block_n['key'] = block_key
block_n['category'] = self._flow_graph.get_option('category')
- block_n['import'] = 'execfile("{0}")'.format(self.get_file_path())
+ block_n['import'] = 'execfile(os.path.join(GRC_HIER_PATH, ' + repr(self._file_name) + '))'
# make data
if parameters:
block_n['make'] = '{cls}(\n {kwargs},\n)'.format(