Package Details: snake_pygame 0.7.2-1

Git Clone URL: https://aur.archlinux.org/snake_pygame.git (read-only)
Package Base: snake_pygame
Description: A remake of classic Snake game written in Python
Upstream URL: https://openisfreedom.eu/2013/08/13/progetto-creiamo-il-nostro-snake-in-python-con-pygame/
Licenses: GPL2
Submitter: Dea993
Maintainer: Dea993
Last Packager: Dea993
Votes: 3
Popularity: 0.000000
First Submitted: 2013-10-19 12:23
Last Updated: 2018-05-15 09:43

Required by (0)

Sources (1)

Latest Comments

Raimar commented on 2017-07-25 23:03

Dependencies can be changed:
depends=('python-pygame' 'python-numpy' 'python-xdg')

Also:
pkgver=0.7.2
md5sums=('404dfe5a3a6c5fbf50f8a853c763ce23')

Dea993 commented on 2013-10-20 09:33

thanks again muflone for your help.

i'll change the language of the comments into the source code of the game, and i'll use in the next release python xdg

for windows python-xdg not exist then i use os.path.expanduser("~")

thanks again for your help and your suggestion

Muflone commented on 2013-10-19 19:30

Talking you as maintainer of this package:
You could change the source line by replacing the version number 0.6.2 in the URL with $pkgver

Talking you as the source code author:
Never and ever write code and comments in other language than english. The italian language is spoken in only one country in the whole world, so less than 1% of the global population could understand it.

Next you should fully rewrite the part where you determine the local path where to save the files.
NEVER assume that the user's home is under /home. My home folder could be under /shares/mystuff and this is perfectly legit under any OS. The same assumption could be made even for windows, never assume that the home folder is under C:\Users. All windows XP users don't have the C:\users folder and my system partition could even be D:\ or Z:\

Simply use pyxdg as previously suggested you:
http://pyxdg.readthedocs.org/en/latest/basedirectory.html
from xdg import BaseDirectory
path_data = BaseDirectory.save_config_path('snake_pygame')
The folder is automatically created under the right place if python2-xdg is present, not sure about windows. In the case python2 xdg would not exist for windows, you could fallback to os.path.expanduser("~') which always points to the user home folder.