Skip to content
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

Python3 port #26

Open
MegaphoneJon opened this issue Jun 24, 2020 · 11 comments
Open

Python3 port #26

MegaphoneJon opened this issue Jun 24, 2020 · 11 comments

Comments

@MegaphoneJon
Copy link

Is there interest in porting this to Python 3? I've spent a couple of hours doing the basics, and I can reach the main screen. I don't want to invest a lot more time if there's no interest though, let me know thoughts!

@MegaphoneJon
Copy link
Author

I've been plugging away at this here and there, and have made good progress. Hand importing works well; tournament summary importing is missing a couple of columns, I'll track that down at some point. I just got the HUD working, though the aux windows don't stay on top (I believe I had this problem a couple of years ago, I'll look through my issues filed on Phil Roberts' repo).

I've been testing on Linux (Ubuntu 20.04) with PokerStars play money games, so of course there are plenty of untested code paths, but progress has been pretty stready, you can check my branch out here if you like.

@EasternSun300
Copy link

EasternSun300 commented Jul 9, 2020

Hello,
I saw that you have begun porting fpdb to python3. Im not very good at python, im able to manually change the DB path in the code, but i would like to ask you to make an option in options to change the database path ( I think there already is an option for this but i cant find anything about it in the code (Configure -> Preferences -> Databases -> there is an option called default which is by default = true). A simple dialog to choose DB path would be enough. in windows it defaults to appdata which is on the system drive and people with smaller SSD's would have problems with the database. I imported 600 hands in the database and it was 24MB. The DB path is defined in Database.py line 847.
Another huge quality of life improvement is to make mucked display after each hand regardless if it went to showdown or not exactly like in the famous hud everyone is using. This is defined in mucked.py Line 341. It makes a problem though and that is that Mucked windows positions are not saved in config file, they are displayed over the HUD window and it makes you wait for it to disappear, which is wasting your time. If you can make the mucked.py save its positions in the config its gonna be awesome. in mucked.py it uses the Common position but it shouldnt be touched, because it stacks all the mucked cards and board on top of eachother.
I was able to make a windows executable, but after deleting python and pyqt5, im unable to run my executable anymore. Its looking for those libraries in %pythonpath%\site-packages\pyqt5\plugins\platforms.
Could you update the .spec file to include the QT libraries "pyqt5\plugins\platforms" as data?
I think those are 2 great ideas for the HUD its too bad im unable to code them myself.

@MegaphoneJon
Copy link
Author

@EasternSun300 I've made the sqlite path configurable - I use MySQL myself, but I just did some testing and it seems to work. The commit is here. However:

  • I'm also not a Python programmer.
  • I don't have easy access to Windows or MacOS.

So I have no idea how to package a pre-built app, so my port is only for folks who can set this up without one unless someone steps in. I also haven't heard anything from Chaz since I posted this ticket two weeks ago, so I don't know that there's any point in submitting a Python2 version of this patch. @ChazDazzle lmk if you want one!

That said, I'm not going to do any other Python2 backports. fpdb needs to adopt Python 3 or become unusable for a lot of folks (including me and anyone else running the latest Ubuntu). I'm at the point where I'm fixing the old Qt bugs I reported and make sure Pokerstars regression tests pass. After that, fpdb will be working for my purposes. There's no point in making the other improvements you suggest unless I know that someone besides me will even use my version.

@EasternSun300
Copy link

EasternSun300 commented Jul 9, 2020

I would use the python3 version. Its going to save alot of time for all the people who would like to use fpdb, since it takes alot of time to find all the packages required for the py2 version. The move mucked was available in fpdb 0.30.X and you their positions were saved in the config. since then its removed. it would be nice to have it back.
Edit: the display of mucked even with no SD is nonsense it would show only the board.

@MegaphoneJon
Copy link
Author

@EasternSun300 That's great to hear - I'll merge the configurable db path into my main branch and if you could test it tomorrow after I do so, that would be great.

Please open a separate ticket for the "mucked" issue; I'm going to prioritize my own HUD concerns first, but once that's done we can look at the mucked display.

@ChazDazzle
Copy link
Owner

ChazDazzle commented Jul 9, 2020

@MegaphoneJon I don't need a python 2 version of that but thanks for asking.

As you can see i continue to update this repo with changes to accommodate new hand history version and new sites. I do not work on any of the GUI code.

Has anyone worked on converting the pokereval code to python 3? That would be required before i'd make the switch.

@MegaphoneJon
Copy link
Author

@ChazDazzle Thanks for the feedback.
Is this the repo that needs converting to Python3? https://github.com/ChazDazzle/pypoker-eval

@ChazDazzle
Copy link
Owner

Yes that's the one. Thanks

@jejellyroll-fr
Copy link

hello MegaphoneJon, your work is very interresting, can you say wich version of python to use? 3.5?

@MegaphoneJon
Copy link
Author

@jedeopxw I used Python 3.8. Note that while my branch worked fine for me, I didn't succeed in porting pypoker-eval, so while you're free to use my Python3 fork, it isn't going to be upstreamed and I'm not working on it.

@jejellyroll-fr
Copy link

@MegaphoneJon Thank you for your answer. I managed to boot into Py3.9. I will restart a new project (new ui, fix all bugs and deprecated function...) from your sources.
For the calculation of equity, I will see later ;)

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

No branches or pull requests

4 participants