summaryrefslogtreecommitdiff
path: root/grc/base/FlowGraph.py
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2014-08-26 12:21:42 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2014-08-26 12:21:42 -0700
commit5af1200d20fd41a940ece92d53eabc94427e9145 (patch)
treed208dfd4862a8b466a30f6180ac34248539dc10e /grc/base/FlowGraph.py
parent07c6d92ba2ca5ff9f82ada8b1b571a701c603910 (diff)
parent1e0707c9cb76cf00771a282a8e544ba4d6c807df (diff)
Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg'
Diffstat (limited to 'grc/base/FlowGraph.py')
-rw-r--r--grc/base/FlowGraph.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/grc/base/FlowGraph.py b/grc/base/FlowGraph.py
index 2281e24dbe..e51843c4ff 100644
--- a/grc/base/FlowGraph.py
+++ b/grc/base/FlowGraph.py
@@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
from . import odict
from Element import Element
from .. gui import Messages
+from . Constants import FLOW_GRAPH_FILE_FORMAT_VERSION
class FlowGraph(Element):
@@ -246,7 +247,11 @@ class FlowGraph(Element):
n['timestamp'] = time.ctime()
n['block'] = [block.export_data() for block in self.get_blocks()]
n['connection'] = [connection.export_data() for connection in self.get_connections()]
- return odict({'flow_graph': n})
+ instructions = odict({
+ 'created': self.get_parent().get_version_short(),
+ 'format': FLOW_GRAPH_FILE_FORMAT_VERSION,
+ })
+ return odict({'flow_graph': n, '_instructions': instructions})
def import_data(self, n=None):
"""
@@ -257,6 +262,7 @@ class FlowGraph(Element):
Args:
n: the nested data odict
"""
+ errors = False
#remove previous elements
self._elements = list()
#use blank data if none provided
@@ -318,13 +324,13 @@ class FlowGraph(Element):
sink = sink_block.get_sink(sink_key)
#build the connection
self.connect(source, sink)
- except LookupError, e: Messages.send_error_load(
- 'Connection between %s(%s) and %s(%s) could not be made.\n\t%s'%(
- source_block_id, source_key, sink_block_id, sink_key, e
- )
- )
+ except LookupError, e:
+ Messages.send_error_load(
+ 'Connection between %s(%s) and %s(%s) could not be made.\n\t%s'%(
+ source_block_id, source_key, sink_block_id, sink_key, e))
+ errors = True
self.rewrite() #global rewrite
-
+ return errors
@staticmethod
def update_old_message_port_keys(source_key, sink_key, source_block, sink_block):