Merged r11309:11357 from grc branch.
[debian/gnuradio] / grc / python / FlowGraph.py
index 47089a305e1b202542580b28ad775bf00be53fe1..8cad8be492216d46c86884750f0badfb9e6b83fa 100644 (file)
@@ -99,16 +99,7 @@ class FlowGraph(_FlowGraph):
                @return a sorted list of variable blocks in order of dependency (indep -> dep)
                """
                variables = filter(lambda b: _variable_matcher.match(b.get_key()), self.get_enabled_blocks())
-               #map var id to variable block
-               id2var = dict([(var.get_id(), var) for var in variables])
-               #map var id to variable code
-               #variable code is a concatenation of all param code (without the id param)
-               id2expr = dict([(var.get_id(), var.get_var_make()) for var in variables])
-               #sort according to dependency
-               sorted_ids = expr_utils.sort_variables(id2expr)
-               #create list of sorted variable blocks
-               variables = [id2var[id] for id in sorted_ids]
-               return variables
+               return expr_utils.sort_objects(variables, lambda v: v.get_id(), lambda v: v.get_var_make())
 
        def get_parameters(self):
                """