# GRC - python code generation quirk for Function Probe with empty BlockID

**URL:** <https://www.ruby-forum.com/t/grc-python-code-generation-quirk-for-function-probe-with-empty-blockid/240691>\
**Category:** GNU Radio\
**Created:** [April 25, 2014, 6:46pm UTC](https://www.ruby-forum.com/t/grc-python-code-generation-quirk-for-function-probe-with-empty-blockid/240691 "2014-04-25T18:46:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [April 25, 2014, 6:46pm UTC](https://www.ruby-forum.com/t/grc-python-code-generation-quirk-for-function-probe-with-empty-blockid/240691/1 "2014-04-25T18:46:25Z")

</div>

Hi,

I’ve been pottering around in GRC trying to get a pair of function  
probe’s to update the QT fosphor GUI sink’s centre frequency by calling

self.set\_freq(float(subprocess.check\_output([’/usr/bin/rigctl’, ‘-m’,  
‘2’, ‘f’]).strip()))

at 5Hz and

self.set\_samp\_rate(self.samp\_rate)

at 20Hz.

This seems to work, except for the fact that the GRC python generator  
generates the following lines of code instead of that I’ve shown above:

val = self…set\_freq(float(subprocess.check\_output([’/usr/bin/rigctl’,  
‘-m’, ‘2’, ‘f’]).strip()))

and

val = self…set\_samp\_rate(self.samp\_rate)

Note the pair of dots in those lines. This occurs because the Block ID  
in the function probe is empty, in that I want the block ID to refer to  
the top block, i.e. self. I can’t put “self” as the Block ID, as the  
generated code is “self.self” which Python moans about. leaving the  
BlockID empty creates the pair of dots.

I wonder if GRC could/should be modified to suppress the extra generated  
dot if the Block ID is empty? It would certainly help me to avoid  
editing generated code 🙂

Cheers,

Darren, G0HWW
