]> git.gag.com Git - debian/gnuradio/commitdiff
fixed utils import
authorjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Sun, 14 Sep 2008 17:28:56 +0000 (17:28 +0000)
committerjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Sun, 14 Sep 2008 17:28:56 +0000 (17:28 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9573 221aa14e-8319-0410-a670-987f0aec2ac5

grc/src/utils/converter.py

index d0ff94e66529c10436409a99ac78c558f2bdf07a..36cdd065f4423eaee830250539e7b85cf9533142 100644 (file)
@@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
 from .. platforms.base.Constants import FLOW_GRAPH_DTD
 import ParseXML
+from .. import utils
 from .. utils import odict
 from lxml import etree
 import difflib
@@ -51,8 +52,8 @@ def _get_params(block):
        @param block the old block
        @retun a list of params
        """
-       params = Utils.exists_or_else(block, 'params', {}) or {}
-       params = Utils.listify(params, 'param')
+       params = utils.exists_or_else(block, 'params', {}) or {}
+       params = utils.listify(params, 'param')
        return params
 
 def _convert_id(id):
@@ -104,12 +105,12 @@ def convert(file_path, platform):
        try: window_height = min(3*int(old_n['window_height'])/2, 2048)
        except: window_height = 2048
        window_size = '%d, %d'%(window_width, window_height)
-       variables = Utils.exists_or_else(old_n, 'vars', {}) or {}
-       variables = Utils.listify(variables, 'var')
-       blocks = Utils.exists_or_else(old_n, 'signal_blocks', {}) or {}
-       blocks = Utils.listify(blocks, 'signal_block')
-       connections = Utils.exists_or_else(old_n, 'connections', {}) or {}
-       connections = Utils.listify(connections, 'connection')
+       variables = utils.exists_or_else(old_n, 'vars', {}) or {}
+       variables = utils.listify(variables, 'var')
+       blocks = utils.exists_or_else(old_n, 'signal_blocks', {}) or {}
+       blocks = utils.listify(blocks, 'signal_block')
+       connections = utils.exists_or_else(old_n, 'connections', {}) or {}
+       connections = utils.listify(connections, 'connection')
        #initialize new nested data
        new_n = odict()
        new_n['block'] = list()
@@ -148,9 +149,9 @@ def convert(file_path, platform):
        for variable in variables:
                key = variable['key']
                value = variable['value']
-               minimum = Utils.exists_or_else(variable, 'min', '')
-               maximum = Utils.exists_or_else(variable, 'max', '')
-               step = Utils.exists_or_else(variable, 'step', '')
+               minimum = utils.exists_or_else(variable, 'min', '')
+               maximum = utils.exists_or_else(variable, 'max', '')
+               step = utils.exists_or_else(variable, 'step', '')
                x = x + 150
                coor = '(%d, %d)'%(x, 10)
                var_block = odict()
@@ -188,10 +189,10 @@ def convert(file_path, platform):
                if tag in ('Note', 'About'): continue
                id = _convert_id(block['id'])
                coor = '(%s, %s + 100)'%(
-                       Utils.exists_or_else(block, 'x_coordinate', '0'),
-                       Utils.exists_or_else(block, 'y_coordinate', '0'),
+                       utils.exists_or_else(block, 'x_coordinate', '0'),
+                       utils.exists_or_else(block, 'y_coordinate', '0'),
                )
-               rot = Utils.exists_or_else(block, 'rotation', '0')
+               rot = utils.exists_or_else(block, 'rotation', '0')
                params = _get_params(block)
                #new block
                new_block = odict()