shlomif / pysolfc Goto Github PK
View Code? Open in Web Editor NEWA comprehensive, feature-rich, open source, and portable, collection of Solitaire games.
Home Page: http://pysolfc.sourceforge.net/
License: GNU General Public License v3.0
A comprehensive, feature-rich, open source, and portable, collection of Solitaire games.
Home Page: http://pysolfc.sourceforge.net/
License: GNU General Public License v3.0
Traceback:
Traceback (most recent call last):
File "pysol.py", line 32, in <module>
sys.exit(main(sys.argv))
File "/Users/craig/Envs/py2-pysolfc/pysollib/main.py", line 369, in main
r = pysol_init(app, args)
File "/Users/craig/Envs/py2-pysolfc/pysollib/main.py", line 183, in pysol_init
app.dataloader = DataLoader(args[0], f)
File "/Users/craig/Envs/py2-pysolfc/pysollib/util.py", line 146, in __init__
str(filenames))
OSError: pysol.py: DataLoader could not find ('html/license.html',)
Replicated master branch into empty python 2.7.13 environment like such:
$ git clone ...
$ cd PySolFC
$ python2 -m virtualenv .
$ source bin/activate
$ pip install six
$ python pysol.py
Happens on the Windows 7 computer I tried it on too. I believe the issue is the naming of the directory, I've tested a change and got it to run. I will submit a pull request for it when I make sure it is not affecting anything else.
The Step 2 - build PySol. is not suitable for Debian: no gmake nad urpmi.
The default Card-sets PATH installed form Debian repostiories is - /usr/share/games/pysolfc
How can I define a draw and load that into PySol to work it with the solver?
In the "Find card" window there could be an option (a checkbox?) to show where each card is located, i.e. the app would search not only for uncovered cards, but for covered ones too including the deck and the waste. The numerical value could be displayed (in the "Find card" window, on the table?) to tell the user exactly when a given card will show up in a particular deck (the card's position). This option would work like a nice hint, allowing for some deep strategies too. Of course, with this option activated, no card symbol would be grayed out (see: #19 unless a given card is unavailable in a solitaire), just as it is now.
I mean the text in "Help" -> "How to play", it might be taken by the user for "rules" at first glance. Change it something like "How to play PySol" or "How to use PySol".
As an option, apart from playing a solitaire by yourself.
Before you can see the next game all the cards/tiles of the previous game have to be dealt. Maybe animations should be disabled for this mode altogether, I guess the user wants to "preview" a given game as quickly as possible, and animations don't help with that.
If the black-hole-solver cannot be found in the path, the error is "Iterations count exceeded", instead of some thing more accurate and helpful. This should be fixed with a test.
To reproduce:
Select a "Black Hole" game.
Make sure black-hole-solver is not in the path.
Invoke Assist -> Solver and press start.
For example, if you play "Klondike" and you change "Cardset..." to "Tiny cardsets" -> "Crystal Mahjongg", the cards would turn into mahjong tiles. Also, each game in "Playable Preview" would be previewed with mahjong tiles. It is possible to mix up this way any other types of cards and tiles as well. I think there should exist restrictions on which game can use which cards or tiles, so that choosing, for instance, Hanafuda cards when playing Matrix games would be impossible. What is more, I have found out that even if you don't change any settings, and you launch a card game first, each mahjong game will be previewed with playing cards in "Playable preview".
BTW, restarting PySolFC does not help, you have to "select" a solitaire again (e.g. from the game list) to fix a wrong card/tile type on the table.
Update: Discussions are better held on the Google Group .
I've got a question. Should we wait with bug reporting and feature requests until the Python 3 port will be ready? Or maybe we should create new tickets now to facilitate the creation of a roadmap/development plan for the future and discussion? It's obvious that the implementation of some features can take a very long time and that some stuff is low-priority.
Apart from our own ideas, I suggest looking at the biggest solitaire packages on the market, i.e. Pretty Good Solitaire, SolSuite, and BVS Solitaire Collection (even in a virtual machine), as well as at some open source solitaire apps to see if we find something interesting.
See https://bugs.mageia.org/show_bug.cgi?id=10729 :
Description of problem:
After the upgrade to python-pillow, PySolFC cannot load .jpg files as table tiles. It can load .gifs fine.
shlomif[rpms]:$mageia/python-pillow$ rpm -ql PySolFC | grep -P '\.jpg$'
/usr/share/PySolFC/images/stats/progression.jpg
/usr/share/PySolFC/tiles/save-aspect/Paradise_Wide.jpg
/usr/share/PySolFC/tiles/stretch/Blue_Fractal.jpg
But I cannot see the Paradise_Wide.jpg and the Blue_Fractal.jpg table tile in the list in [Menu] -> Options -> "Table Tile..." nor is my custom table tile still displayed. This seems like a regression from python-imaging.
Version-Release number of selected component (if applicable):
Cauldron.
How reproducible:
Steps to Reproduce:
Reproducible:
Steps to Reproduce:
When you finish porting PySolFC to Python 3 and you add SVG support (to make PySolFC resolution-independent), you can definitely think about a name change. My suggestion is: PySol+ (BTW, PySolFC was a strange name in the first place).
That would be the right time to think about promotion too:
-- create a very simple website using: https://pages.github.com/ Including info on your efforts as well as on PySol's history and legacy.
-- tell people that PySol is still alive in the form of PySol+ using reddit, Hacker News, Slashdot, and GamingOnLinux (these website are frequented by those who are "in the know", they gonna tell the others about the project). A lot of users are really nostalgic about PySol, but they simply don't know that your repo exists. It took me some time to find it as well.
-- create a Patreon account (nice example: https://www.patreon.com/Nekotekina) to earn some cash because why not?
I have no previous experience of Github, I'm hoping some here in Github/PySolFC have participated in other shared projects on Github and can advise what works.
My impression is that our need for discussion is cluttering issues, leading us off-topic. In a few years (months?) time that will make it hard to review an issue. E.g. on Ubuntu's Launchpad often a bug is reported and if it isn't fixed quickly then there can be 50 or 100 follow-ups, arguments, irrelevancies, etc. Developers have little spare time, and such bugs are just left to rot, the extensive trail discourages devs. So we should aim to keep our issues focussed.
I would imagine a PySolFC mailing list would be a good way to avoid some of this clutter. Github doesn't seem to have mailing lists for projects. Might the wiki be a solution?
File → "Save as" stopped working properly and throws this exception:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib64/python2.7/lib-tk/Tkinter.py", line 1542, in __call__
return self.func(*args)
File "/home/shlomif/Download/unpack/games/pysolfc/git/PySolFC/pysollib/ui/tktile/menubar.py", line 1223, in mSaveAs
d = tkinter_filedialog.SaveAs()
AttributeError: 'module' object has no attribute 'SaveAs'
I'd like to add function/class/method documentation using ReStructed Text (RST), which is usable by Sphinx and other tools. This would make it easier to view documentation in one place and to quickly see what a function/method is returning and does, as I've noticed quite a few functions being rather opaque when trying to debug my local copy.
Reference and example file:
http://thomas-cokelaer.info/tutorials/sphinx/docstring_python.html
http://docutils.sourceforge.net/docutils/statemachine.py
If you click "Options" -> "Statusbar" -> "Show help bar" you will have as if two "status bars". I think it would look more elegant if we merge the "help bar" with the "status bar" and change the "Show help bar" option to "Show help info".
Maybe fullscreen mode would be enough... However, I have never seen a solitaire where you could play directly on the desktop so that feature could be quite unique. :)
See "Options→Cardset". The python2 version in the try-to-fix-py3-bugs works fine, but the python 3 version does nothing.
As Python 2.x is going away, we need to convert the code to use Python 3 instead. A prerequisite for that is to merge duplicate or mostly duplicate code that uses the APIs that were removed in Python 3.
With respect to #11 - we have a task to run the 2to3 on ranges of *.py modules and apply modified changes that will be acceptable in both python 2 and python 3 based on the diff. This module may help - https://pythonhosted.org/six/index.html .
If you're looking to help pysol, then give a shout in a comment here and I can assign you a range of paths for a pull request.
If you try to read an icon description (wait for the tool-tip to show up), and then you move the cursor over to another icon, the PySolFC window and the icon description tool-tip start to flicker like a crazy.
When playing PileOn or Small PileOn, (Select > French Games > One-Deck Games > Small PileOn), in rare occasions an assertion error can be triggered.
The assertion says assert c.face_up
and as of this writing (commit 29a9a61) is in line 520 of game.py, visible here:
Line 514 in 29a9a61
The reason is that occasionally (very rarely, but it has happened to me twice in a session) all four cards in a stack are equal, causing the stack to face down.
It is easier to reproduce with a reduced version, e.g. adding this to pysollib/game/pileon.py
:
class SmallerPileOn(PileOn):
TWIDTH = 3
NSTACKS = 5
PLAYCARDS = 4
registerGame(GameInfo(10001, SmallerPileOn, "Smaller PileOn",
GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0, GI.SL_MOSTLY_SKILL,
ranks=tuple([0]+range(16-SmallerPileOn.NSTACKS, 13)),
#(0, 10, 11, 12),
rules_filename = "pileon.html"))
and then selecting Smaller PileOn and pressing 'N' repeatedly.
Possible solutions that I can think of are to avoid generating such a deal (e.g. by redealing in case this situation is detected) and to remove the assertion.
Custom PySol cardsets outside the downloadable cardset pack are a rare thing in the Internet even in 2017. This is probably due to the fact that the config file specification is not well documented. Perhaps a guide for creating custom cardsets might solve this issue a bit.
PySolFC a fantastic solitaire collection, it's just a pity that there is only one person currently working on it. :( Even after all these years, the mechanics seem to be all right, the music is awesome, however, the UI could be modernized. By switching to SVG cards one could support any resolution. I have also this crazy idea, that cards could be played directly on the desktop... This would be like a real solitaire on a real table (without window boundaries).
Regards,
Jan
Cannot make a dist on current master:
lb@lb7520 ~/PySolFCwork $ make dist
PYTHONPATH=pwd
./scripts/all_games.py > docs/all_games.html
Traceback (most recent call last):
File "./scripts/all_games.py", line 257, in
create_html(sort_by)
File "./scripts/all_games.py", line 176, in create_html
all_games(sort_by)
File "./scripts/all_games.py", line 142, in all_games
rules_fn = getGameRulesFilename(gi.name)
File "./scripts/all_games.py", line 36, in getGameRulesFilename
return latin1_normalize(n) + '.html'
NameError: global name 'latin1_normalize' is not defined
make: *** [Makefile:26: all_games_html] Fehler 1
When I check with flake8:
lb@lb7520 ~/PySolFCwork $ flake8 scripts/all_games.py
scripts/all_games.py:14:1: F401 'pysollib.games.mahjongg' imported but unused
scripts/all_games.py:18:1: F401 'pysollib.mfxutil.latin1_to_ascii' imported but$
scripts/all_games.py:36:12: F821 undefined name 'latin1_normalize'
Needs manual testing because skipped in tests/style/py-flake8.t. But -
is it allowed to ask why such a skipping list exists ?
Before creating PySolFC 2.1 builds for various systems, I suggest taking into account the fact that currently used cardsets are extremely small, and they look really, really bad on modern screens. To temporarily alleviate this issue and to avoid negative user feedback (while waiting for proper vector support), we might simply ship PySolFC with at least one additional (which could be used as the default one) higher resolution cardset. I mean something like this guy did here (ignore the card backs s/he suggested, just focus on the cards). AFAIK, these seem to be cardsets which are in the public domain, we might need to ask him/her about this.
But PySolFC definitely looks much better this way... Some time ago I talked to shlomif on IRC that PySolFC needs a major graphical overhaul, taking care of (even if temporarily) the most serious issue, i.e. small cardsets could be a step in the right direction.
All the matters regarding programming solutions for PySolFC and development can be discussed here first. If necessary, separate issue tickets would be created.
This topic will be used solely by PROGRAMMERS and not by users.
Title says it all really :)
Alternative vertical layout, so that the finder-dialog fits next to the playing window.
As suggested by Hans-Joachim Gurt at SF.net
This is on this branch - https://github.com/shlomif/PySolFC/tree/try-to-fix-py3-bugs - and it happens on game no. 24 for instance. What happens is that it puts a card on top of a card with the same color. I should note that it doesn't happen when running under python 2.
It would be nice to implement the "Find card" option for other PySol card games as well (now it only works with French cards, I guess.) We can also think about searching options for mahjong tiles.
In this branch: https://github.com/shlomif/PySolFC/tree/try-to-fix-py3-bugs - part of the tkhelp functionality was commented out, because it used some APIs that were removed in py3. We need to get it working again.
Note that it is accessible from the "Help" menu of PySol.
I think PySolFC looks to me a bit outdated, mainly because of the current icon set. I guess it could be refreshed.
Of course, I don't mean that you have to code and create new graphics. :P It just would be good to look for some designer (maybe let's post this on various Linux forums?).
I am unable to follow the installation description and successfully run pysol from the github repo.
I have performed the following steps, taken from the brief installation description in the readme.
$ git clone https://github.com/shlomif/PySolFC.git
$ cd PySolFC
$ ln -s html-src html
$ ln -s data/images images
$ tar -xvf PySolFC-Cardsets-2.0.tar.bz2
$ mkdir -p ~/.PySolFC
$ rmdir ~/.PySolFC/cardsets
$ ln -s ~/.PySolFC/cardsets PySolFC-Cardsets-2.0
When I then run python2 pysol.py
, I get the "No cardsets were found" error.
I'll note that I have python and tkinter. I did download the cardsets from sourceforge. I'm not sure about the intention of the final symbolic link, but I tried several variations of this symlink and I didn't succeed.
We wish to prepare a functional Windows binary installer that will install cpython (preferably 3.x) and then the pysol sources and provide a usable way to run it for non-technical people. Some leads:
This /r/Python thread - https://www.reddit.com/r/Python/comments/8237i3/help_is_needed_in_preparing_a_windows_binary/
The artifacts produced by appveyor - see https://ci.appveyor.com/project/shlomif/PySolFC . They don't seem to be usable in a windows 7 x86-64 virtualbox VM.
Currently saving and restoring games of "^ms[0-9]+$" deals results in an error. This should be fixed.
I think it would be a good idea to gray out the card symbols in the "Find card" window for the cards which are not currently uncovered. When all the card symbols are visible, it's sometimes more difficult to find a card using the "Find card" option than when actually looking at the cards on the table...
Example. Yeah, blue hyperlinks might be a bit distracting, but you get a general idea. Check also these nice "how to play" examples with graphical card symbols if you click on, e.g. "down by alternate color".
"Playable preview..." offers the same functionality as the "All games..." option + much more. Thus, I suggest renaming "Playable preview" to "All games...", and getting rid of the old "All games..." view altogether.
Of course, for this change to make any sense, the problem with slow switching between games in "Playable preview..." has to be fixed first.
To fully understand my vision of enhancing "Playable preview..." (or the "All games..." view after renaming) check these issues too: #34 #35
Let's say the user wants to find a solitaire by name:
He or she presses, for instance, the "F" key.
"Playble Preview" opens with the text cursor in the search field.
The user immediately starts typing.
The results could be presented nicely, for instance, in the column view.
This solitaire search field could also be used to look for alternate solitaire names as well as other info.
Switch for "stay on top" (but only when Pysol is the active application).
As suggested by Hans-Joachim Gurt at SF.net
Let's say that we want to, for instance, activate "Redeal animation" first and then activate also "Winning animation." Well... We have to go to "Options" in the menu bar two times because after choosing "Redeal animation", all the menus close and we have to start again.
So to tweak settings more effectively we need a settings panel (menu bar: "Options" -> "Settings..."). It will also allow us to nicely put settings into different categories as well as to avoid cluttering the menu bar with new settings that we may plan to add. Some of the most important settings might be available through the old menu bar "Options" too.
An inspiration for the settings panel
I think a table view with customizable columns (by customizable, I mean with an option for adding/removing columns with different sorting categories, as well as with an option to move such columns to the left or right) would work much better than these folders with solitaire categories that we have now. Clicking on a given column's header would revert the sorting order, i.e. for example, A-Z -> Z-A.
If you have no idea what I mean, check this out for an inspiration (focus on the table/columns part of the screenshot).
current master: shishensho.py, line 352:
cl.reverse()
AttributeError: 'xrange' object has no attribute 'reverse'
change to:
cl = reversed(cl)
As suggested by the user Hans-Joachim Gurt at SF.net
For fast access of gaming appearance.
As a case. e.g.: Ability to create in card-set tree - "Favourite folder"
On this branch - https://github.com/shlomif/PySolFC/tree/add-flake8-tests - I added this test - https://github.com/shlomif/PySolFC/blob/add-flake8-tests/tests/style/py-flake8.t - which checks a subset of the python files for compliance with the python 3 version of flake8. This will help us convert to python 3 ( see #11 ) later on and is easy thing to help with - just add more files to the glob and make them comply with flake8. You may look at the previous commits in the repository for some inspiration including the "if sys.version" compatibility shims.
Currently the solver dialog (Assist → Solver when playing Freecell or other supported games) does not remember its "Preset" , "Max Iterations" and "Show Progress" settings - either across sessions of PySol or even after closing and invoking it again. It should remember those but note that it should not remember the "Game" setting because one can switch to a different game.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.