diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2016-06-03 16:17:57 +0200 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2016-06-09 14:49:12 +0200 |
commit | 963773b800655f2902998aedce8d46605d54e60f (patch) | |
tree | 684d4ed1119dab875c21e400152c1df6ef61d4e1 /grc/gui/FlowGraph.py | |
parent | 94c4606edd30dc8b1278580782f2809b69f04641 (diff) |
grc-refactor: remove odict
Diffstat (limited to 'grc/gui/FlowGraph.py')
-rw-r--r-- | grc/gui/FlowGraph.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py index 50e146b4db..8f35222d42 100644 --- a/grc/gui/FlowGraph.py +++ b/grc/gui/FlowGraph.py @@ -213,15 +213,15 @@ class FlowGraph(Element, _Flowgraph): x_off, y_off = 0, 0 #create blocks for block_n in blocks_n: - block_key = block_n.find('key') - if block_key == 'options': continue + block_key = block_n.get('key') + if block_key == 'options': + continue block = self.new_block(block_key) if not block: continue # unknown block was pasted (e.g. dummy block) selected.add(block) #set params - params = dict((n.find('key'), n.find('value')) - for n in block_n.findall('param')) + params = {n['key']: n['value'] for n in block_n.get('param', [])} if block_key == 'epy_block': block.get_param('_io_cache').set_value(params.pop('_io_cache')) block.get_param('_source_code').set_value(params.pop('_source_code')) @@ -241,8 +241,8 @@ class FlowGraph(Element, _Flowgraph): self.update() #create connections for connection_n in connections_n: - source = old_id2block[connection_n.find('source_block_id')].get_source(connection_n.find('source_key')) - sink = old_id2block[connection_n.find('sink_block_id')].get_sink(connection_n.find('sink_key')) + source = old_id2block[connection_n.get('source_block_id')].get_source(connection_n.get('source_key')) + sink = old_id2block[connection_n.get('sink_block_id')].get_sink(connection_n.get('sink_key')) self.connect(source, sink) #set all pasted elements selected for block in selected: selected = selected.union(set(block.get_connections())) |