Open brunetton opened 2 months ago
Forgot to mention: I "fixed" it by manually copying HUD_config.xml
to ~/.fpdb folder, and it seems to be OK
hi Bruno,
tx for your structured post, i'll keep your suggestion, i will add it in my next push, by simply adding, it solves the issue:
if __name__ == "__main__":
Configuration.get_config("HUD_config.xml", True)
from qt_material import apply_stylesheet
app = QApplication([])
apply_stylesheet(app, theme='dark_purple.xml')
me = fpdb()
app.exec_()
Jejellyroll
Indeed, but I'm not sure reading Configuration.get_config("HUD_config.xml", True)
clearly indicates the dev who reads the code that this call "initialize" the configuration if inexistant. I know that kind of remark can be kind of boring, but I think that a project have to be the clearer possible if you want other people to easily participate without breaking things on each PR. But yeah it's more time consuming at the beginning to think of code clarity !
hello Bruno
I'm in line with what you said, but before making a PR, to add your proposal, I need to define a gitflow more standard to our practices (here, I make a proposal: https://github.com/jejellyroll-fr/fpdb-3/discussions/26)
And the second point, which I'd also like to address, is code coverage and non-regression testing, which today is almost non-existent.
Let's keep your proposal, as an improvement to be implemented via a PR, in the meantime, I'll do a quick and dirty fix ;)
I also have other issues such as the python binding of the poker-eval lib c, or the project architecture ... which I don't like, or the web version of the project ;)
Your help will be invaluable, because even though I've learned a lot about python in the last few months, I'm still not expert enough ;)
Describe the bug (on Linux)
Running from Git repo for the first time, config dir is not initialized, and program crash with an exception trying to find ~/.fpdb/HUD_config.xml
To Reproduce Steps to reproduce the behavior:
Expected behavior Config dir containing config files needed to run program should be initialized when not existing (user should be aware of the fact the the app is running for the first time although)
Additional information
For now only
log
dir exists in~/.fpdb
, it's created by the call toConfiguration.set_logfile("fpdb-log.txt")
ofimport Hand
inGuiHandViewer
init (called byGuiSessionViewer
) (took me some time to figure it out)Proposal
Are you opened to a PR to add the configuration init at the beginning of
fpdb.pyw
? For me, it's no use to start loading any UI before make sure that basic needs to start are met. Something like:Configuration should be a singleton, isn't it ? (not sure, I didn't explored the code deep for now)
Thanks !