|
From: <jo...@us...> - 2008-12-11 20:32:08
|
Revision: 6565
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6565&view=rev
Author: jouni
Date: 2008-12-11 20:32:04 +0000 (Thu, 11 Dec 2008)
Log Message:
-----------
Use subprocess.Popen instead of os.popen in dviread
(Windows problem reported by Jorgen Stenarson)
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/dviread.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-11 18:59:00 UTC (rev 6564)
+++ trunk/matplotlib/CHANGELOG 2008-12-11 20:32:04 UTC (rev 6565)
@@ -1,3 +1,6 @@
+2008-12-11 Use subprocess.Popen instead of os.popen in dviread
+ (Windows problem reported by Jorgen Stenarson) - JKS
+
2008-12-10 Added Michael's font_manager fix and Jae-Joon's
figure/subplot fix. Bumped version number to 0.98.5 - JDH
Modified: trunk/matplotlib/lib/matplotlib/dviread.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/dviread.py 2008-12-11 18:59:00 UTC (rev 6564)
+++ trunk/matplotlib/lib/matplotlib/dviread.py 2008-12-11 20:32:04 UTC (rev 6565)
@@ -21,8 +21,8 @@
import matplotlib
import matplotlib.cbook as mpl_cbook
import numpy as np
-import os
import struct
+import subprocess
_dvistate = mpl_cbook.Bunch(pre=0, outer=1, inpage=2, post_post=3, finale=4)
@@ -742,25 +742,15 @@
doesn't use kpathsea, so what do we do? (TODO)
"""
- cmd = 'kpsewhich '
+ cmd = ['kpsewhich']
if format is not None:
- assert "'" not in format
- cmd += "--format='" + format + "' "
- assert "'" not in filename
- cmd += "'" + filename + "'"
-
+ cmd += ['--format=' + format]
+ cmd += [filename]
+
matplotlib.verbose.report('find_tex_file(%s): %s' \
% (filename,cmd), 'debug')
- pipe = os.popen(cmd, 'r')
- result = ""
- while True:
- data = _read_nointr(pipe)
- if data == "":
- break
- result += data
- pipe.close()
- result = result.rstrip()
-
+ pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ result = pipe.communicate()[0].rstrip()
matplotlib.verbose.report('find_tex_file result: %s' % result,
'debug')
return result
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|