Thank you for your donations!   Download the book!   Public source code repository   Join the group!

Finally

I have finished conversion of images rendering code from Python 2.7 + pygtk to Python 3.8 + pycairo. I didn't retain compatibility with Python 2.7, since this code is used just for my book.

Even though I didn't plan to do any refactoring, it happened that this conversion was also nudging me to do some code clean-up. For instance, it wasn't really necessary, but I enforced that each board always have size according to variant it represents. Then, I added view, which describes which portion of a board is actually visible. Sure, there was board descriptor class already with the same purpose, but it was more clumsy in use, felt like an afterthought, which it was.

While I initially disliked context-sensitive nature of cairo, it actually works very well. Also, performance. It seems to me that new code is visibly faster than the old one. I'd say that cairo code might be twice as fast as old gtk code. And, on top of that, cairo is much more flexible.

Up next, versioning clean-up, updating and displaying version info on a GitHub page.

After that, dunno. At the moment, I have no clear plan of actions.

No comments:

Post a Comment