[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/04: grc: look for default_flow_graph.grc
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/04: grc: look for default_flow_graph.grc in ~/.grc_gnuradio |
Date: |
Wed, 3 Aug 2016 16:50:26 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit f3f86da18174ba6db53111b9473c61845e2f460e
Author: Chris Kuethe <address@hidden>
Date: Fri Jul 15 15:29:23 2016 -0700
grc: look for default_flow_graph.grc in ~/.grc_gnuradio
allows users to create their own template flow graph
---
grc/core/Constants.py | 1 +
grc/core/Platform.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/grc/core/Constants.py b/grc/core/Constants.py
index eeb1d7f..808ff12 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 9b25e67..557ceba 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)