summaryrefslogtreecommitdiff
path: root/grc/core
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe+github@gmail.com>2016-07-15 15:29:23 -0700
committerSebastian Koslowski <koslowski@kit.edu>2016-08-03 17:37:55 +0200
commitf3f86da18174ba6db53111b9473c61845e2f460e (patch)
tree3ae077c0b6029b4098f9ac6647cb0ef00b2a5a23 /grc/core
parent457186838d12607bcf9f5e61eaf937ff5fa090e0 (diff)
grc: look for default_flow_graph.grc in ~/.grc_gnuradio
allows users to create their own template flow graph
Diffstat (limited to 'grc/core')
-rw-r--r--grc/core/Constants.py1
-rw-r--r--grc/core/Platform.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/grc/core/Constants.py b/grc/core/Constants.py
index eeb1d7f848..808ff12628 100644
--- a/grc/core/Constants.py
+++ b/grc/core/Constants.py
@@ -27,6 +27,7 @@ FLOW_GRAPH_DTD = os.path.join(DATA_DIR, 'flow_graph.dtd')
BLOCK_TREE_DTD = os.path.join(DATA_DIR, 'block_tree.dtd')
BLOCK_DTD = os.path.join(DATA_DIR, 'block.dtd')
DEFAULT_FLOW_GRAPH = os.path.join(DATA_DIR, 'default_flow_graph.grc')
+USER_DEFAULT_FLOW_GRAPH = os.path.expanduser('~/.grc_gnuradio/default_flow_graph.grc')
DOMAIN_DTD = os.path.join(DATA_DIR, 'domain.dtd')
# File format versions:
diff --git a/grc/core/Platform.py b/grc/core/Platform.py
index 9b25e67d65..557ceba6df 100644
--- a/grc/core/Platform.py
+++ b/grc/core/Platform.py
@@ -61,7 +61,8 @@ class Platform(Element):
)
self._block_dtd = Constants.BLOCK_DTD
- self._default_flow_graph = Constants.DEFAULT_FLOW_GRAPH
+ self._default_flow_graph = Constants.USER_DEFAULT_FLOW_GRAPH if \
+ os.path.exists(Constants.USER_DEFAULT_FLOW_GRAPH) else Constants.DEFAULT_FLOW_GRAPH
# Create a dummy flow graph for the blocks
self._flow_graph = Element(self)