Werner F. Bruhin wrote:
> Hi Andrew,
>
> Werner F. Bruhin wrote:
>
>> Hi Andrew,
>>
>> Andrew Straw wrote:
>>
>>
>>> Dear Werner,
>>>
>>> This seems to be an unintended side-effect of reorganizing the mpl
>>> data file location that I did prior to this release. (I.e. it's not
>>> your code that broke, I think it's mpl.) Unfortunately, since I didn't
>>> (and still don't) use py2exe, it will be hard for me to fix this. Can
>>> you send a patch that gets py2exe working again?
>>>
>>>
>> The work around I did is using glob.glob instead as follows:
>>
>> # matplotlib data
>> ##mpdir, mpfiles = matplotlib.get_py2exe_datafiles()
>> mpfiles = glob.glob('C:\Python25\lib\site-packages\matplotlib\mpl-data\*.*')
>>
>> But I can't confirm yet that this works as I am also trying out
>> something else in my InnoSetup script. Will confirm ASAP and will try
>> and look into matplotlib.get_py2exe_datafiles() and see how it could be
>> fixed.
>>
>>
> I have change matplotlib.get_py2exe_datafiles() to:
> def get_py2exe_datafiles():
> import glob
>
> mplfiles = []
> for item in glob.glob(os.sep.join([get_data_path(), '*/*'])):
> if os.path.isdir(item):
> mplfiles += glob.glob(os.sep.join([item, '/*']))
>
> mplfiles.append(os.sep.join([get_data_path(), 'matplotlibrc']))
>
> try:
> mplfiles.remove(os.sep.join([get_data_path(), 'Matplotlib.nib']))
> except:
> pass
>
> return ('matplotlibdata', mplfiles)
>
> Now this creates a "flat" folder, i.e. all datafiles are directly under
> matplotlibdata. In my tests this works for me in my limited tests, with
> the exception that I also get the "Could not match Bitstream Vera
> ......etc" error - but this is something I also get with py2exe, so I
> don't know if this is an issue.
>
> Andrew, do you know if the sub-folder structure should be retained when
> using py2exe for matplotlib to work correctly in all circumstances? If
> that would be the case let me know and I try to come up with something.
Dear Werner,
I am reluctant to eliminate the sub-folder structure because I think it
would add the possibility of unnecessary bugs to just the py2exe built
version. Would it be possible for you to re-factor this to include the
directory layout? When you test it, can you test some interactive plot
to make sure all the button icons are loaded properly?
Thanks,
Andrew
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users