summaryrefslogtreecommitdiff
path: root/grc/core/generator/Generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/core/generator/Generator.py')
-rw-r--r--grc/core/generator/Generator.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/grc/core/generator/Generator.py b/grc/core/generator/Generator.py
index 5c2fa6e0d5..91671072d6 100644
--- a/grc/core/generator/Generator.py
+++ b/grc/core/generator/Generator.py
@@ -259,9 +259,12 @@ class HierBlockGenerator(TopBlockGenerator):
TopBlockGenerator.__init__(self, flow_graph, file_path)
platform = flow_graph.get_parent()
+ hier_block_lib_dir = platform.config.hier_block_lib_dir
+ if not os.path.exists(hier_block_lib_dir):
+ os.mkdir(hier_block_lib_dir)
+
self._mode = HIER_BLOCK_FILE_MODE
- self.file_path = os.path.join(platform.config.hier_block_lib_dir,
- self._flow_graph.get_option('id') + '.py')
+ self.file_path = os.path.join(hier_block_lib_dir, self._flow_graph.get_option('id') + '.py')
self._file_path_xml = self.file_path + '.xml'
def get_file_path_xml(self):
@@ -388,4 +391,4 @@ class QtHierBlockGenerator(HierBlockGenerator):
"\n#set $win = 'self.%s' % $id"
"\n${gui_hint()($win)}"
)
- return n \ No newline at end of file
+ return n