diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2016-08-03 09:45:31 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2016-08-03 09:45:31 -0700 |
commit | 77f902e1a7d731805cfcd1a15d22d149898709b0 (patch) | |
tree | 49baf44d7604d4ddc20fe65ab5c368db2401d094 /grc/core/Config.py | |
parent | cfda705a5e07f9611f5b8d0e3425fe58a851b61b (diff) | |
parent | 124c641c12c091368bf79c6fa612eded9de8e2f4 (diff) |
Merge branch 'master' into next
Diffstat (limited to 'grc/core/Config.py')
-rw-r--r-- | grc/core/Config.py | 13 |
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 |