gnuradio
gnuradio copied to clipboard
grc: use state directory in generated python
Description
Oversight on my side: new statedir is used for saving hier-blocks, but not for reading them
Related Issue
main version of maint-3.10 #7454
Which blocks/areas does this affect?
GRC
Testing Done
Manual
Checklist
- [x] I have read the CONTRIBUTING document.
- [x] I have squashed my commits to have one significant change per commit.
- [x] I have signed my commits before making this PR
- [x] My code follows the code style of this project. See GREP1.md.
- [ ] I have updated the documentation where necessary.
- [ ] I have added tests to cover my changes, and all previous tests pass.
It sounds like this one is worth another release? Or does the problem hit only under certain conditions?
If .grc_gnuradio exists but not .local/state/gnuradio, then I get the following error:
Traceback (most recent call last):
File "/home/argilo/prefix_310/src/gr-ieee-80211/examples/wifi_loopback.py", line 24, in get_state_directory
log.warn(f"Found persistent state path '{newpath}', but file does not exist. " +
^^^
NameError: name 'log' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/argilo/prefix_310/src/gr-ieee-80211/examples/wifi_loopback.py", line 47, in <module>
sys.path.append(os.environ.get('GRC_HIER_PATH', get_state_directory()))
^^^^^^^^^^^^^^^^^^^^^
File "/home/argilo/prefix_310/src/gr-ieee-80211/examples/wifi_loopback.py", line 33, in get_state_directory
log.warn("Could not retrieve GNU Radio persistent state directory from GNU Radio." +
^^^
NameError: name 'log' is not defined
@argilo is that with the PR, or is that why we need the PR?
It's a bug in this PR.
This pr should be applied. Otherwise we can generate hier blocks and use them in defining flowgraphs, but the flowgraphs fail to execute. The fg's only execute if you copy the corresponding *.py file from ~/.local/state/gnuradio to ~/.grc_gnuradio
Backport note: maint-3.10 PR is already queued up.
This is an improvement, but there were still several bugs present in this PR. We should probably open up an issue for those.