summaryrefslogtreecommitdiff
path: root/grc/python/Platform.py
diff options
context:
space:
mode:
authorBalint Seeber <balint@ettus.com>2014-04-04 09:32:42 -0700
committerSebastian Koslowski <koslowski@kit.edu>2014-04-09 17:42:05 +0200
commit0b69cb314c4e63dc82bd971551cb2cdbae12a302 (patch)
tree8866439fc3d4c10a2c6a8a17ec89b3ebbd51368f /grc/python/Platform.py
parentcd06fdc9372bb2489cc7a455b75cef445343296d (diff)
grc: honour order of block paths, print them out on startup, override hier block and pref file path with GRC_HIER_PATH & GRC_PREFS_PATH
Diffstat (limited to 'grc/python/Platform.py')
-rw-r--r--grc/python/Platform.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/grc/python/Platform.py b/grc/python/Platform.py
index f6adaf47a5..7e5ad81808 100644
--- a/grc/python/Platform.py
+++ b/grc/python/Platform.py
@@ -18,6 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
import os
+from collections import OrderedDict
from gnuradio import gr
from .. base.Platform import Platform as _Platform
from .. gui.Platform import Platform as _GUIPlatform
@@ -43,7 +44,20 @@ class Platform(_Platform, _GUIPlatform):
#ensure hier dir
if not os.path.exists(HIER_BLOCKS_LIB_DIR): os.mkdir(HIER_BLOCKS_LIB_DIR)
#convert block paths to absolute paths
- block_paths = set(map(os.path.abspath, BLOCKS_DIRS))
+ # Create a mapping from the absolute path to what was passed in
+ user_to_abs_path = map(lambda x: (os.path.abspath(x), x), BLOCKS_DIRS)
+ # Keep each unique absolute path and maintain order
+ paths_dict = OrderedDict(user_to_abs_path)
+ # Prepare the ordered, unique absolute path list for _Platform
+ block_paths = paths_dict.keys()
+ # Print out the paths that are used (differently, depending on whether they
+ # were transformed from their original state)
+ print "Block paths:"
+ for p in block_paths:
+ if p != paths_dict[p]:
+ print "\t%s (%s)" % (paths_dict[p], p)
+ else:
+ print "\t%s" % (p)
#init
_Platform.__init__(
self,