WinLink module conversion - wb8tyw/D-Rats GitHub Wiki

Starting conversion of wl2k module.

I have not used wl2k so I will need to learn how to use it and test it.

First step, silence pylint issues

The first step of converting a module to python3, is to scan it with pylint and then fix or silence all the pylint dignostics.

Pylint finds real coding errors, possible coding errors, and violations of current python conventions, in addition to several things that just specific to the pylint maintainers.

In general, we want to be a pylint clean as possible with the default settings to have the most readable code.

Some pylint issues with GTK routines must be suppressed though, and some others, while they should eventually get fixed, are going to be beyond the scope of this stage.

So for this pass, we add Sphinx compatible DocStrings, fixup variable names where we can, and generally silence everything else.

This code still will not be expected to work on python3.

This pass exposed two existing coding bugs where uninitialized variables were referenced in diagnostic messages.

https://github.com/wb8tyw/D-Rats/pull/136

Fix for lzhuf on Mac OS

Next KA5MYE found the bug in lzhuf.h that was blocking Mac users from using w2lk.

https://github.com/wb8tyw/D-Rats/pull/137

Use logging module instead of printlog

Once printlog is completely removed from d-rats, will look at properly setting the log levels for all the messages and see about adding methods to filter what logging is seen on the console and or console logs.

https://github.com/wb8tyw/D-Rats/pull/138

Now is time to fix up the exception handling.

This pass is to fix up the exception handling.

A broad exception should never be caught or raised. This hides programming bugs and makes problems in the program harder to diagnose.

Ideally all modules will have some type of unit testing that makes sure that all code in a module is tested. We are quite a way from having that in D-Rats yet.

Most of the w2lk exceptions need to be based on DataPathIOError and DataPathNotConnected Error for proper handling by the caller.

https://github.com/wb8tyw/D-Rats/pull/139

Mocking up a server and testing.

First step will be to mock up a loop back server. I will probably need to extend it to prompt for logins, passwords and such. The goal is for the unit test to make sure that all application code gets called.

Testing was able to identify what variables needed to be strings and which needed to be bytes, except for e-mail handling, which I have not done any python3 d-rats testing on.

The D-Rats version number used in D-RATS has up to now only been used as a text string. The w2lk protocol needs a version number with some restrictions on the format, so I created a new version variable and a comment to note the restriction.

Also got hit with a GOobject deprecated message, and found the same issue in two other modules so fixed that.

Did not reach the goal of having all lines of code unit tested, but there is enough now to have some confidence in the rest of the code.

https://github.com/wb8tyw/D-Rats/pull/140