discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Go-back is possible?


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Go-back is possible?
Date: Tue, 03 Dec 2013 08:24:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Frankly, if you *really* want to inline the GRC file in the generated
python, I'd just have one large multiline Python string holding that
file as-is. With a little magic you could even let the python program
re-synthesize itself given a certain command line argument.
Anyway: I can't imagine how the single-line-comment will not clutter
the source code tremendously and make it hard to read and build upon
(which is what I use GRC mainly for).

I think the main problem with GRC-generated python is not the fact
that it's hard to recraft (unless your GRC graphs span multiple
screens and you run out of pencil retracing that on paper), but the
fact that due to progress, block names change between releases, and so
do arguments; thus, reading the source code often brings more clarity
than looking at a half-decapitated flowgraph, even when it's embedded
in the source.

Greetings,
Marcus

On 02.12.2013 23:22, Tim wrote:
> gzip -> base64 encode the grc file into some comments in the python
> file perhaps? a smallish grc file appears to be on the order of
> 1000 chars with such an encoding
> 
> On 12/02/2013 05:11 PM, Dan CaJacob wrote:
>> I have an interesting (to me anyway) idea:
>> 
>> What if we added a default option to the GRC-XML-to-python
>> converter to add the contents of the original GRC file as a big,
>> delineated comment blob.  Then, a simple tool could pull the GRC
>> back out of the python file anytime and you could go back and
>> forth.  An option when building would disable the verbose output
>> for those publishing code or who just don't want the extra
>> cruft.
>> 
>> It's a little lame, but it solves the problem.  I know I've had
>> to hand-craft many old GRCs from python files when the original
>> GRC was lost or the originator was other than myself.  The
>> problem has often crept up with GRCs not properly updated for new
>> versions of code, where the blocks go missing in the GRC
>> representation (I think there was talk of fixing this - graying
>> them out or something).
>> 
>> Very Respectfully,
>> 
>> Dan CaJacob
>> 
>> 
>> On Mon, Dec 2, 2013 at 4:48 PM, Marcus Leech <address@hidden 
>> <mailto:address@hidden>> wrote:
>> 
>> Think of the Python that gets emitted by GRC as object code.
>> What you're asking is to convert said object code back into
>> reasonable source code.
>> 
>> Such things exist for *actual* machine object-code, but, they 
>> produce damned-ugly results.
>> 
>> on Dec 02, 2013, *Raydel Abreu (CM2ESP)* <address@hidden 
>> <mailto:address@hidden>> wrote:
>> 
>> Oh, that's bad, I guess I should use instead the old code-reading
>> method....
>> 
>> Raydel
>> 
>> 
>> 2013/12/2 Marcus Leech <address@hidden 
>> <mailto:address@hidden>>
>> 
>> There's no automatic mechanism for doing that.
>> 
>> 
>> on Dec 02, 2013, *Raydel Abreu (CM2ESP)* <address@hidden 
>> <mailto:address@hidden>> wrote:
>> 
>> Hello,
>> 
>> Is it possible to go back and convert a Python GNU Radio code
>> back into the GRC Flow Graph from which it was generated?
>> 
>> Cheers,
>> 
>> Raydel, CM2ESP
>> 
>> ------------------------------------------------------------------------
>>
>>
>> 
_______________________________________________
>> Discuss-gnuradio mailing list address@hidden
>> <mailto:address@hidden> 
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________ Discuss-gnuradio
>> mailing list address@hidden
>> <mailto:address@hidden> 
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>> 
>> 
>> 
>> 
>> _______________________________________________ Discuss-gnuradio
>> mailing list address@hidden 
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
> 
> 
> 
> _______________________________________________ Discuss-gnuradio
> mailing list address@hidden 
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSnYc5AAoJEAFxB7BbsDrLcP8H/1GqveUwP02dqD0TtX0ZhADM
nSUd/HOx/rGqC1ATHq1vItKTv98spB0ZVf2EUCyOZK5uvES2YMu8KqrTUXemchzH
93nwJ6/Z2apAYAccRtpf5r83Cx9DRyKwUlR4KvW3LBVmqlgYbFE3eYgG2mmsDODz
VgOqgg+fcMQQP+h0rsETiCHb8kN/STayPp6iVxsLDSXlTXKqNu4yXZfy5WvCQOm/
C6Lj3R7DXMKVJEcs/Z0KYvHIYdaK6fVLjsp9ltwDe5qqQaZPkOs+YnJKur3ND++F
ayDdmySX5PevAeSJLsRmFWmOh62sI03JyP4NjYiE+kOS5te/hakqA1qiyFOWfbc=
=xJtK
-----END PGP SIGNATURE-----



reply via email to

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