Week 4: Core/CLI split

The Core and the CLI splits!

As planned for week 4, the Core and the CLI portions of the modtool have been separated so the modtool becomes scriptable from python scripts. The work is done on the forked repository module_sep branch. Moreover, I have also worked on the enhancement of python3 branch.

The CLI portion of the modtool still holds the same functionality for all the commands. The entire click portion and the user CLI interaction is placed in the CLI modules whereas the core functionality of modtool that can be exposed as an API is in the Core modules. All the print statements in the core are only executed if the user has used the command through the command line interface. Moreover, since the setup function of the core becomes redundant for the CLI calls, it will only be executed for the API calls. The entire code has been thoroughly tested.

Currently, the user needs to call the run function from the imported module with the options and arguments passed as a dictionary. For example:-

>>> from gnuradio.modtool.core import *
>>> ModToolNewModule().run({‘directory’:’/home/swapnil/Documents/modtool’, ‘module_name’:’square_ff’})
>>> ModToolAdd().run({‘blockname’:’test_block’, ‘directory’:’/home/swapnil/Documents/modtool/gr-square_ff’, ‘lang’:’cpp’, ‘block_type’:’general’, ‘add_cpp_qa’: True})

works absolutely awesome.

Similarly, all the commands except for gr_modtool info work from the python scripts.

There is a slight problem with the ModToolException as it is giving traceback for the exceptions raised.

There was a problem with the grc_xml_generator for python3 compatibility. Here is the link to the pull request.
Here is the link to another enhancement pull request for modtool_newmod.py.

Tasks for Week 5

  • Bug fixes and enhancement of the current work on the module_sep branch
  • Completely expose the API for the modtool
  • Complete modtool testing for the API

Link to forked repository module_sep branch.

Link to the updated Github project.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s