Closed GoogleCodeExporter closed 9 years ago
I see your point, that prefixes = ("/usr/share", "/usr/local/share",
"/usr/share/locale", "/usr/share/games", "/usr/local/share/games") might not be
enough for everyone. I do however not see a way to locate the directory of the
datafiles without iterating through a list of possible locations.
We could call 'locate pychess' on the entire system, but that would give us the
danger of wrong data being found.
Do you have a suggestion?
Original comment by lobais
on 29 Dec 2008 at 12:43
I think the solution is to ensure that setup.py and pychess are consistent and
write and read the data files from the same directory. Then you do not need to
search for data by iterating over possible data directories.
distutils setup() writes the data files to sys.prefix, so get pychess to read
the data files from sys.prefix too.
This modified code for prefix.py works on my system:
import sys
if "site-packages" in __file__:
_prefix = join (sys.prefix, "share", "pychess")
_installed = True
if not isdir (_prefix):
raise Exception("can't find pychess 'share' directory")
else:
_prefix = abspath (join (dirname (__file__), "../../.."))
_installed = False
The directories "/usr/share/games", "/usr/local/share/games" would not be
detected.
But the current pychess setup.py does not install the data to these directories
anyway.
Original comment by steve872...@yahoo.com.au
on 29 Dec 2008 at 3:10
You are right. Thx. for the patch, applied to trunk.
Original comment by gbtami
on 1 Jan 2009 at 9:51
Original issue reported on code.google.com by
steve872...@yahoo.com.au
on 29 Dec 2008 at 12:25