Skip to content

Python3 + PyQt6 port for Debian derived Linux #2227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from

Conversation

kashikoibumi
Copy link

Managed to work with Python3 + PyQt6 for Debian derived Linux.
Runnable with start.sh .

Currently, one to one messaging with randomly generated address is not working.
It requires some more work and test.
Messaging by chan, broadcast, deterministic generated address is working.

Although, this is far from perfect, this may be worth for porting to Python3, since this is a working example.

Unresolved problems:
* File->Quit menu does not work.
* Validator in add chan dialog does not work.
Remained works:
* Objects are not saved.
* Decryption does not work.
* Can not shutdown.
Messages can be received and viewed now.

Remained problems:
* Message sending is not working yet.
It seems that one to one messaging using pubkey retrieving
is not working yet.
Now getpubkey and one-to-one messaging works.
@kashikoibumi
Copy link
Author

Updated: One-to-one messaging involving getpubkey works now.

@PeterSurda
Copy link
Member

I appreciate your enthusiasm. However may I recommend focusing on the tests, and leaving Qt for later? There have been attempts to do a quick and dirty port to python3, but they all had code quality problems.

@kashikoibumi
Copy link
Author

I don't care what GUI toolkit you choose finally at all. I choose PyQt6 merely because PyBitmessage is using PyQt4 for long time. There is no other good reason.
But Python2 is already abandoned. So if you want to use some Python today or tomorrow or perhaps yesterday, it must be Python3. I care that.
I understand my quick dirty fix has no quality now. I think I can be work a bit more hard for quality later, but current priority is somewhat working example.
I also think that discussing code quality in Python is totally nonsense. If you want the code to be clean and robust, you should abandon Python just now and migrate to a good language at least using static typing.

I have no love in Python nor Qt, but I love Bitmessage :)

I will continue fixing remained problems and code quality of my pull request as long as my motivation is retained.

@kashikoibumi
Copy link
Author

Since I am not a Python programmer, I struggled to adapt my code to your validators whole the last night, and finally totally failed.
I used autopep8, pycodestyle and flake8, but I had to manually split long lines and then manually indent by trial and error.
It was a nightmare.

Finally, I found a tool named 'black'.
black seems to be totally automatic and strict, although it modifies all the source code files totally into her style.
I prefer black.
Can I use it?

* deterministic_keys() now accepts both str and bytes for passphrase.

* The test for RandomTrackingDict is modified to use bytes
 for random keys.
The error is fixed by making stderr binary mode.
@kashikoibumi
Copy link
Author

It's too late, but I found a tool to abstract away Qt versions:
https://github.com/mottosso/Qt.py .
And also it's more too late, I found the tool is mensioned in the issue:
'Porting bitmessageqt to Qt5 #1389'.
I think I should switch to that line.

@kashikoibumi
Copy link
Author

I have switched to use Qt.py in #2250 .
So this PR should be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants