SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] get_py2exe_datafiles fix

From: Andrew S. <str...@as...> - 2007年06月30日 17:28:32
Dear Tim,
I checked in a similar patch from Tocer a couple days ago. Does your 
version do anything different? Does the version in svn work for you?
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/__init__.py?r1=3391&r2=3418
(Sorry, I don't really use Windows or py2exe.)
-Andrew
Tim Swast wrote:
> I was having trouble with py2exe not getting the datafiles that it 
> needed. I noticed someone else got it to work by copying all the files, 
> but losing the directory structure. I tried that, but I still had 
> missing datafiles at runtime.
> 
> This function will return everything needed for py2exe to work 
> correctly. Instead of returning one tuple, it returns a list of tuples, 
> so the use changes a little bit, but at least it works.
> 
> def get_py2exe_datafiles():
> outdirname = 'matplotlibdata'
> mplfiles = []
> 
> for root, dirs, files in os.walk(get_data_path()):
> py2exe_files = []
> 
> # Append root to each file so py2exe can find them
> for file in files:
> py2exe_files.append(os.sep.join([root, file]))
> 
> if len(py2exe_files) > 0:
> py2exe_root = root[len(get_data_path()+os.sep):]
> 
> if len(py2exe_root) > 0:
> mplfiles.append((os.sep.join([outdirname, py2exe_root]), 
> py2exe_files))
> else:
> # Don't do a join for the root directory
> mplfiles.append((outdirname, py2exe_files))
> 
> return mplfiles
> 
> 
> Sorry for not submitting as a patch: I haven't quite figured out how to 
> do that yet.
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> 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-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /