commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 07/18: grc: show epy_blocks and epy_module


From: git
Subject: [Commit-gnuradio] [gnuradio] 07/18: grc: show epy_blocks and epy_module source in generated code preview
Date: Tue, 8 Dec 2015 00:31:22 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit ad1df327929560803c8623724c025fe580c6650c
Author: Sebastian Koslowski <address@hidden>
Date:   Wed Dec 2 22:54:58 2015 +0100

    grc: show epy_blocks and epy_module source in generated code preview
---
 grc/gui/PropsDialog.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py
index f5a136e..bf7d31d 100644
--- a/grc/gui/PropsDialog.py
+++ b/grc/gui/PropsDialog.py
@@ -210,6 +210,14 @@ class PropsDialog(gtk.Dialog):
 
         buffer = self._code_text_display.get_buffer()
         block = self._block
+        key = block.get_key()
+
+        if key == 'epy_block':
+            src = block.get_param('_source_code').get_value()
+        elif key == 'epy_module':
+            src = block.get_param('source_code').get_value()
+        else:
+            src = ''
 
         def insert(header, text):
             if not text:
@@ -219,9 +227,11 @@ class PropsDialog(gtk.Dialog):
 
         buffer.delete(buffer.get_start_iter(), buffer.get_end_iter())
         insert('# Imports\n', '\n'.join(block.get_imports()))
-        if block.get_key().startswith('variable'):
+        if key.startswith('variable'):
             insert('\n\n# Variables\n', block.get_var_make())
         insert('\n\n# Blocks\n', block.get_make())
+        if src:
+            insert('\n\n# External Code ({}.py)\n'.format(block.get_id()), src)
 
     def _handle_key_press(self, widget, event):
         """



reply via email to

[Prev in Thread] Current Thread [Next in Thread]