Test feedback from python3 - wb8tyw/D-Rats GitHub Wiki

maurizioandreotti commented on about 21-Dec-2021

Hi Just downloaded the code with git desktop and moved it to my build machines for D-rats. first try on windows 7, blindly following usual approach as i compile the "old" d-rats I just copy pasted the source code on my win7 virtual machine (py2.7 and usual libraries)

launching the distXP.bat script i got a compiled version in Dist folder

then launching the d-rats.exe from there i get a pop-up warning of errors, and in the log i get

Traceback (most recent call last):
File "d-rats.py", line 32, in
ImportError: No module named gi

Honestly I was expecting something like this and i guess i will need to setup a new windows vm to compile it. in your wiki i see some notes about it, not really sure if that would be valid for me as i dont have visual studio or any other IDE experience

first try on rasberry pi 2 - the usual one where i test drats

trying to execute the ./d-rats.py it complains that cannot execute the:

/usr/bin/python^M

checking the source files with vi from terminal it seems all lines have a ^M at the end, so needed to parsie with dos2unix

and launching it with:

/usr/bin/python3 ./d-rat.py

got o a window of the ported version!

Outcomes:

as it starts it should connect to K3PDR, but after initial message of "connecting" it doesn't list stations in the right box

if i do a "ping all" it doesn't list connected users (some errors in the log)

if i do a chat "hi all" in the chat it gives back an error line 231 in mainwindow.py (do conninet --> values must be strings)

if i go to edit pref and get back it seems to be connecting, and lists stations (sounds good!)

is it normal that all station in the list have a "b" prefix?

if i try loading the map window it starts with a loop of 404 errors (and it got stuck so have to kill it) --> THIS was due to https, i solved going into config and changing the URL string from "https" to "http"

with this i got to the map window with the empty canvass instead of the tiles log says a lot of errors, mapdisplay 883, broken tile with an error "cairo.Format.ARGB32()" and type error cairo.format not callable and below it say line 922 draw_tile surface ...... file not found

while doing tests i saw in the log chat messages coming in, but no display in the chat window

Response from wb8tyw

Please note that "Visual Studio Code" which I use, is not the same as "Visual Studio" other than sharing the name I have not attempted to use "Visual Studio" in at least 6 years.

Visual Studio Code is available as a free download for many platforms.

I just use "visual studio code" as an editor. It is not used to run/debug the code. Nothing in my d-rats fork should care what editor that you use.

Visual studio besides being the editor is doing several sanity checks on the code such as Spelling, pylint, and something that calls itself both "pylance" and "pyright" depending on where I am looking. It also allows some looking up of python classes.

I have not yet added the spell check dictionary for visual studio code to my fork, but I have added the pylint configuration files, so the standalone pylint utility should work. My short term goal is that everything I merge in will have no active pylint diagnostices, and the long term goal is to remove as many pylint flagged issues as possible. Note for d-rats it will probably not be practical to make it 100% compliant with the default pylint checks due to the way GTK-3 is implemented.

importError: No module named gi

This means that you do not have the GTK-3 packages installed. For development, we probably need to provide one or more scripts to install the proper packages. I have not done that yet, I just have Development Packages Required

/usr/bin/python^M

My fork is being developed on Anti-X Linux (Debian based) and I have confirmed that the d-rats.py module has line-feed line endings as does a spot check of several other modules.

So I have no idea of how your checkout of the repository ended up with the files corrupted in this way.

Trying to test with a live ratflector

I actually have only been testing with a local ratflector.

This test was done with python2

First thing that I discover while trying to use the new code to edit the broken default ratflector is that the config code does not work. Another item to investigate.

12/22/2021 09:55:40:INFO:KeyedListWidget:get_selected: Unable to find selected: broad-exception
Traceback (most recent call last):
  File "/mnt/aviary/home/malmberg/work/d-rats/D-Rats/d_rats/miscwidgets.py", line 261, in get_selected
    return store.get(iter_val, 0)[0]
  File "/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py", line 936, in get
    values.append(self.get_value(treeiter, col))
TypeError: Argument 1 does not allow None as a value

I did not originally have a hostname K3PDR, but from the recent d-rats group-io discussions, I have been told that the replacement for RAT is kd8pmy.net. I have since found the hostname for k3pdr.dstargateway.org.

Editing the config with your version worked, and now I successfully connected to kd8pmy and am waiting for another station to show up.

chat "hi all" gives error line 231 in mainwindow.py (do conninet --> values must be strings)

I sent out a chat message with out an issue. No response yet. Looks like the client is sending out periodic CQ messages.

is it normal that all station in the list have a "b" prefix?

No. As I am seeing no activity on kb8pmy.net, I have no stations. I did not see this on my local setup with two d-rats clients.

Now loaded up with a bunch of working ratflectors.

Not seeing any b prefix. Seeing other problems.

Finally see the b prefix when running under python3 after I locally fixed some other python3 issues. I will need to chase that down. In python3 all data sent out from d-rats is of type "bytes" and not type str. Bytes data is converted to str by default with a b prefix.

Getting lots of tracebacks in the console output. Lots of things still need fixing.

You will see logging for "broad-except". I added that.

On the python projects that I work on, anything catching a broad-except or a bare-except is considered a bug. This is because it they tend to hide programming bugs, and make it harder to debug the code. It also indicates that testing was not properly done for the error paths.

  File "/mnt/aviary/home/malmberg/work/d-rats/D-Rats/d_rats/ui/main_events.py", line 464, in bot_scroll
    adj.set_value(adj.get_upper() - adj.adj.get_page_size)
AttributeError: 'Adjustment' object has no attribute 'adj'

And got a bug report for the existing d-rats:

WX4QZ->CQCQCQ ([QST] To avoid excess QST's and CQ's from filling the chat window, do the following under File -> Preferences -> Appearance:
1) In the IgnoreRegEx window, type \[QST\] \[CQCQCQ\] -- you MUST have a space between each one, or D-Rats will crash each time you load it.
2) In the Chat Window, you will click on Add Filter twice. The first time, type [QST] and press <ENTER>. The second time, type CQCQCQ: and press <ENTER>.
Tabs for each of these filters will be below the chat window; just click on the tab to view them....

if i try loading the map window it does not work

Known issue. None of the existing map code works with GTK-3, A major re-write is in progress.

⚠️ **GitHub.com Fallback** ⚠️