Hi,
I'm trying to figure out a better way to ship extra so called
"resource" files with my wxPython-based application such that they can
be accessed in a cross-platform manner. I'm aware this is a common
problem, but google hasn't suggested a standard solution.
I currently use distutils rather clumsily and place these files in the
data_files array:
data_files=[
('share/pallavi', [
'config/pallavi_config.py',
'config/pallavi128.xpm'
]),
('share/pallavi/lexing_languages', map(lambda x:
"config/lexing_languages/%s" % x ,filter(lambda x: x.endswith(".py"),
os.listdir('config/lexing_languages')))),
],
This installs the relevant files to /usr/share/pallavi or
/usr/local/share/pallavi under Linux systems (assuming the installer
doesn't pass strange prefixes to setup.py), and to
C:\Python2x\share\pallavi\ under Windows (with the same assumption). I
don't know what happens on a Mac and I'm not in a position to worry
about it until a Mac user becomes interested in my software or I buy
one (its on my wish list!)
I don't know how to reliably access these paths under wxPython.
wx.StandardPaths returns /usr/share/pallavi under Linux, which is
exactly what I need. However, under Windows, it currently returns
C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx and the
documentation tells me it should actually be returning C:\Program
Files\Pallavi\.
So I need to know how to either:
a) get wxPython to return C:\Python2x\share\pallavi or whichever
similar path is related to the Python installation OR
b) get wxPython to return C:\Program Files\Pallavi instead of that
site-packages url AND get my setup.py to install the data_files to
C:\Program Files\Pallavi instead of C:\Python2x\share\pallavi under
Windows.
Like I say, I assume this is a common problem, but I'm a bit clumsy
when it comes to Windows installations... I didn't expect as many
Windows users interested in my project as has turned out to be the
case. I apologize if this has been asked before; I couldn't find any
references.
Thanks for any insight,
Dusty