Week 1: Move from Argparse to Click

The GSoc’18 Coding period begins!

As planned for the Week 1, the CLI parsing of the modtool has been moved from Argparse to Click on the forked repository’s modtool branch. Moreover, I have also read about the existing plug-in architectures with Click and discussed the same with the mentors.

Click is based on decorators and uses the concept of groups (a type of Multicommand) and commands for the CLI parsing wherein several commands can be registered to a group and both groups and commands can have their specific options (optional) and arguments (generally mandatory, can be made optional).

Currently, no option (or argument) has been registered to the base group because of two main reasons:-

  1. Click does not possess the magical behavior to differentiate whether an option belongs to a group or a command. So, if we register options to the base group, the command will be gr_modtool –skip-lib -t general instead of gr_modtool add -t general –skip-lib.
  2. Some command may not require options like ‘skip-lib’ like gr_modtool info.

But to reduce the redundancy the options common to most of the commands have been registered to the commands as common_params.

In the initial phase of the week, I also faced difficulty in building the ‘python3’ branch of GNU Radio due to multiple installations of log4cpp (most probably) which was rectified with the able guidance of the mentors.

I also found an issue with str.translate(), the pull request has been sent.


Tasks for Week 2

  1. Bug fixes of the Click CLI, if any.
  2. Write the current modtool scripts as a plug-in architecture.
  3. Start working for external plug-ins.
  4. Bug fixes of the python3 branch, if any.

Link to the link to the updated Github project.

Advertisements

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