From: <jd...@us...> - 2009-06-07 14:11:32
|
Revision: 7192 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7192&view=rev Author: jdh2358 Date: 2009-06-07 13:55:10 +0000 (Sun, 07 Jun 2009) Log Message: ----------- add support for bz2 files per sf support request 2794556 Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/cbook.py Modified: trunk/matplotlib/lib/matplotlib/cbook.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cbook.py 2009-06-07 13:46:10 UTC (rev 7191) +++ trunk/matplotlib/lib/matplotlib/cbook.py 2009-06-07 13:55:10 UTC (rev 7192) @@ -314,6 +314,11 @@ # get rid of 'U' in flag for gzipped files. flag = flag.replace('U','') fh = gzip.open(fname, flag) + elif fname.endswith('.bz2'): + # get rid of 'U' in flag for bz2 files + flag = flag.replace('U','') + import bz2 + fh = bz2.BZ2File(fname, flag) else: fh = file(fname, flag) opened = True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |