Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2555b09

Browse files
committed
update backend_driver
svn path=/trunk/matplotlib/; revision=3413
1 parent b69acdd commit 2555b09

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

examples/backend_driver.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
from __future__ import division
88
import os, time, sys
9+
import matplotlib.backends as mplbe
10+
911
files = (
1012
'alignment_test.py',
1113
'arctest.py',
@@ -30,6 +32,7 @@
3032
'image_demo.py',
3133
'image_demo2.py',
3234
'image_demo_na.py',
35+
'image_masked.py',
3336
'image_origin.py',
3437
'invert_axes.py',
3538
'layer_images.py',
@@ -74,14 +77,6 @@
7477
)
7578

7679

77-
#tests known to fail on python22 (require datetime)
78-
fail22 = (
79-
'date_demo1.py',
80-
'date_demo2.py',
81-
'finance_demo.py',
82-
)
83-
84-
8580
# tests known to fail on a given backend
8681

8782
failbackend = dict(
@@ -118,7 +113,7 @@ def drive(backend, python='python', switches = []):
118113
line_lstrip.startswith('show')):
119114
continue
120115
tmpfile.write(line)
121-
if backend in ('GTK', 'WX', 'TkAgg'):
116+
if backend in mplbe.interactive_bk:
122117
tmpfile.write('show()')
123118
else:
124119
tmpfile.write('savefig("%s", dpi=150)' % outfile)
@@ -130,19 +125,15 @@ def drive(backend, python='python', switches = []):
130125

131126
if __name__ == '__main__':
132127
times = {}
133-
# backends = ['Agg', 'Cairo', 'GDK', 'PS', 'SVG', 'Template']
134-
#backends = ['Agg', 'PS', 'SVG', 'Template']
135-
# backends = [ 'GTK', 'WX', 'TkAgg']
136128
default_backends = ['Agg', 'PS', 'SVG', 'Template']
137-
#default_backends = ['Agg']
138-
#backends = ['Agg']
139129
if sys.platform == 'win32':
140130
python = r'c:\Python24\python.exe'
141131
else:
142132
python = 'python'
133+
backends = []
143134
switches = []
144135
if sys.argv[1:]:
145-
backends = [b for b in sys.argv[1:] if b in default_backends]
136+
backends = [b for b in sys.argv[1:] if b in mplbe.all_backends]
146137
switches = [s for s in sys.argv[1:] if s.startswith('--')]
147138
if not backends:
148139
backends = default_backends

0 commit comments

Comments
 (0)