summaryrefslogtreecommitdiff
path: root/grc/core/Config.py
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-08-03 09:45:14 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2016-08-03 09:45:14 -0700
commit124c641c12c091368bf79c6fa612eded9de8e2f4 (patch)
tree14962dc9814712df2bf2708d4d83c8624f870156 /grc/core/Config.py
parenta6e3db2db0ac46b560820ecc8d8691c22fecb793 (diff)
parentb18c00c327446c1c2c7431f304f60f7537564bea (diff)
Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg'
Diffstat (limited to 'grc/core/Config.py')
-rw-r--r--grc/core/Config.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/grc/core/Config.py b/grc/core/Config.py
index ac38d9978c..78ff344998 100644
--- a/grc/core/Config.py
+++ b/grc/core/Config.py
@@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import os
from os.path import expanduser, normpath, expandvars, exists
+from . import Constants
+
class Config(object):
@@ -28,7 +30,7 @@ class Config(object):
license = __doc__.strip()
website = 'http://gnuradio.org'
- hier_block_lib_dir = os.environ.get('GRC_HIER_PATH', expanduser('~/.grc_gnuradio'))
+ hier_block_lib_dir = os.environ.get('GRC_HIER_PATH', Constants.DEFAULT_HIER_BLOCK_LIB_DIR)
def __init__(self, prefs_file, version, version_parts=None):
self.prefs = prefs_file
@@ -53,3 +55,12 @@ class Config(object):
for path in collected_paths if exists(path)]
return valid_paths
+
+ @property
+ def default_flow_graph(self):
+ user_default = (
+ os.environ.get('GRC_DEFAULT_FLOW_GRAPH') or
+ self.prefs.get_string('grc', 'default_flow_graph', '') or
+ os.path.join(self.hier_block_lib_dir, 'default_flow_graph.grc')
+ )
+ return user_default if exists(user_default) else Constants.DEFAULT_FLOW_GRAPH