You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

2h 18m 43s logged

Making Exporting Functional

This will be the final session (for now) on the archive generator. There are still plenty of bugs, but after this session, it is at the point where it is actually functional, so I merged the generator into the main branch. According to GitHub, this is a Python project now.

Part 1: object Message has no attribute “person”

Most of the time in this session was spent trying to fix this attribute error. This is where using textual makes debugging slightly more difficult, as there is no terminal to print to. There is a debug terminal that can be attached, but it still is more complicated. I tried to make Labels pop up with debug information, but the never appeared or caused more errors.

Part 2: Logging

I got so frustrated with the attribute error that I added logging to the entire application. I started to write my own logging script, but then learned that Python comes with a logging library. I initalised it to use all logging level, although I only use Debug and Info. This helped fix a few other bugs, such as not actually writing messages to the output (once the attribute error was fixed). I used logging to print all the vars in the messages being processed; from this I found that none of the instance variables existed.

Part 3: The solution

I turned to Google to try to fix my problem. After Googling attribute errors, I saw a suggestion that passing the class, not an initalised instance, could be the cause. As it turns out, when adding a new message to the messages list, I had capitalised the “M”, adding the object not the instance. I spent quite a lot of time for a single character mistake. I’m glad I found it, but it took a frustratingly long time to find for how simple it was.

Finished?

The archive generator is not done. There are still bugs, it hasn’t been stress tested, the UI looks bad, and only basic messages can be created. But it is functional enough so that I can work on the actual application for the time being.

0
1

Comments 0

No comments yet. Be the first!