Skip to content

Commit 7d7f073

Browse files
committed
removed pre py2.4 compatability code and some other dead code
svn path=/trunk/matplotlib/; revision=5164
1 parent 3bddca5 commit 7d7f073

23 files changed

+24
-1270
lines changed

API_CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
matplotlib now requires python2.4, so matplotlib.cbook will no
2+
loner provide set, enumerate, reversed or izip compatability functions
3+
14
In numpy 1.0 bins are specified by the left edges only. The axes
25
method "hist" now uses future numpy 1.3 semantic for histograms.
36
Providing binedges, the last value gives the upper-right edge now,

CHANGELOG

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
2008-05-16 Reorganized examples dir
1+
2008-05-16 removed some unneeded code w/ the python 2.4 requirement.
2+
cbook no longer provides compatibility for reversed,
3+
enumerate, set or izip. removed lib/subprocess, mpl1,
4+
sandbox/units, and the swig code. This stuff should remain
5+
on the maintenance branch for archival purposes. JDH
6+
7+
2008-05-16 Reorganized examples dir - JDH
28

39
2008-05-16 Added 'elinewidth' keyword arg to errorbar, based on patch
410
by Christopher Brown - MM

lib/matplotlib/_cm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import matplotlib as mpl
1313
import matplotlib.colors as colors
14-
from matplotlib.cbook import reversed
1514
LUTSIZE = mpl.rcParams['image.lut']
1615

1716
_binary_data = {

lib/matplotlib/axis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from __future__ import division
55

66
from artist import Artist, setp
7-
from cbook import enumerate, silent_list, popall, CallbackRegistry
7+
from cbook import silent_list, popall, CallbackRegistry
88
from lines import Line2D, TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN
99
from matplotlib import rcParams
1010
from patches import bbox_artist

lib/matplotlib/backends/backend_agg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
from matplotlib._pylab_helpers import Gcf
3232
from matplotlib.backend_bases import RendererBase,\
3333
GraphicsContextBase, FigureManagerBase, FigureCanvasBase
34-
from matplotlib.cbook import enumerate, is_string_like, exception_to_str, \
35-
maxdict
34+
from matplotlib.cbook import is_string_like, exception_to_str, maxdict
3635
from matplotlib.figure import Figure
3736
from matplotlib.font_manager import findfont
3837
from matplotlib.ft2font import FT2Font, LOAD_FORCE_AUTOHINT

lib/matplotlib/backends/backend_cairo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _fn_name(): return sys._getframe(1).f_code.co_name
3636

3737
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
3838
FigureManagerBase, FigureCanvasBase
39-
from matplotlib.cbook import enumerate, izip, is_string_like
39+
from matplotlib.cbook import is_string_like
4040
from matplotlib.figure import Figure
4141
from matplotlib.mathtext import MathTextParser
4242
from matplotlib.path import Path

lib/matplotlib/backends/backend_emf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from matplotlib._pylab_helpers import Gcf
1818
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
1919
FigureManagerBase, FigureCanvasBase
20-
from matplotlib.cbook import enumerate
2120
from matplotlib.figure import Figure
2221
from matplotlib.transforms import Bbox
2322

lib/matplotlib/backends/backend_fltkagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import matplotlib
2121

2222
from matplotlib import rcParams, verbose
23-
from matplotlib.cbook import is_string_like, enumerate
23+
from matplotlib.cbook import is_string_like
2424
from matplotlib.backend_bases import \
2525
RendererBase, GraphicsContextBase, FigureManagerBase, FigureCanvasBase,\
2626
NavigationToolbar2, cursors

lib/matplotlib/backends/backend_gdk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def fn_name(): return sys._getframe(1).f_code.co_name
2222
from matplotlib._pylab_helpers import Gcf
2323
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
2424
FigureManagerBase, FigureCanvasBase
25-
from matplotlib.cbook import is_string_like, enumerate
25+
from matplotlib.cbook import is_string_like
2626
from matplotlib.figure import Figure
2727
from matplotlib.mathtext import MathTextParser
2828
from matplotlib.transforms import Affine2D

lib/matplotlib/backends/backend_gtk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def fn_name(): return sys._getframe(1).f_code.co_name
1919
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
2020
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
2121
from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
22-
from matplotlib.cbook import is_string_like, is_writable_file_like, enumerate
22+
from matplotlib.cbook import is_string_like, is_writable_file_like
2323
from matplotlib.colors import colorConverter
2424
from matplotlib.figure import Figure
2525
from matplotlib.widgets import SubplotTool

lib/matplotlib/backends/backend_pdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
2626
FigureManagerBase, FigureCanvasBase
2727
from matplotlib.backends.backend_mixed import MixedModeRenderer
28-
from matplotlib.cbook import Bunch, enumerate, is_string_like, reverse_dict, \
28+
from matplotlib.cbook import Bunch, is_string_like, reverse_dict, \
2929
get_realpath_and_stat, is_writable_file_like, maxdict
3030
from matplotlib.figure import Figure
3131
from matplotlib.font_manager import findfont, is_opentype_cff_font

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def _fn_name(): return sys._getframe(1).f_code.co_name
1414
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
1515
FigureManagerBase, FigureCanvasBase
1616

17-
from matplotlib.cbook import is_string_like, izip, get_realpath_and_stat, \
17+
from matplotlib.cbook import is_string_like, get_realpath_and_stat, \
1818
is_writable_file_like, maxdict
1919
from matplotlib.figure import Figure
2020

lib/matplotlib/backends/backend_qt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import matplotlib
77
from matplotlib import verbose
8-
from matplotlib.cbook import is_string_like, enumerate, onetrue
8+
from matplotlib.cbook import is_string_like, onetrue
99
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
1010
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
1111
from matplotlib._pylab_helpers import Gcf

lib/matplotlib/backends/backend_qt4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import matplotlib
77
from matplotlib import verbose
8-
from matplotlib.cbook import is_string_like, enumerate, onetrue
8+
from matplotlib.cbook import is_string_like, onetrue
99
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
1010
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
1111
from matplotlib._pylab_helpers import Gcf

lib/matplotlib/backends/backend_qtagg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import os, sys
77
import matplotlib
88
from matplotlib import verbose
9-
from matplotlib.cbook import enumerate
109
from matplotlib.figure import Figure
1110

1211
from backend_agg import FigureCanvasAgg

lib/matplotlib/backends/backend_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
from matplotlib._pylab_helpers import Gcf
5050
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
5151
FigureManagerBase, FigureCanvasBase
52-
from matplotlib.cbook import enumerate
5352
from matplotlib.figure import Figure
5453
from matplotlib.transforms import Bbox
5554

lib/matplotlib/backends/backend_tkagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import os.path
1212

1313
import matplotlib
14-
from matplotlib.cbook import is_string_like, enumerate
14+
from matplotlib.cbook import is_string_like
1515
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
1616
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
1717

lib/matplotlib/cbook.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
import time, datetime
88
import numpy as np
99

10-
try:
11-
set = set
12-
except NameError:
13-
from sets import Set as set
14-
1510
major, minor1, minor2, s, tmp = sys.version_info
1611

1712

@@ -462,46 +457,6 @@ def __get_item__(self, i):
462457
return self.data[i % len(self.data)]
463458

464459

465-
# use enumerate builtin if available, else use python version
466-
try:
467-
import __builtin__
468-
enumerate = __builtin__.enumerate
469-
except:
470-
def enumerate(seq):
471-
"""Python equivalent to the enumerate builtin function
472-
enumerate() is new in Python 2.3
473-
"""
474-
for i in range(len(seq)):
475-
yield i, seq[i]
476-
477-
478-
# use reversed builtin if available, else use python version
479-
try:
480-
import __builtin__
481-
reversed = __builtin__.reversed
482-
except:
483-
def reversed(seq):
484-
"""Python equivalent to the enumerate builtin function
485-
enumerate() is new in Python 2.3
486-
"""
487-
for i in range(len(seq)-1,-1,-1):
488-
yield seq[i]
489-
490-
491-
# use itertools.izip if available, else use python version
492-
try:
493-
import itertools
494-
izip = itertools.izip
495-
except:
496-
def izip(*iterables):
497-
"""Python equivalent to itertools.izip
498-
itertools module - new in Python 2.3
499-
"""
500-
iterables = map(iter, iterables)
501-
while iterables:
502-
result = [i.next() for i in iterables]
503-
yield tuple(result)
504-
505460

506461
def get_split_ind(seq, N):
507462
"""seq is a list of words. Return the index into seq such that

lib/matplotlib/figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import artist
88
from artist import Artist
99
from axes import Axes, SubplotBase, subplot_class_factory
10-
from cbook import flatten, allequal, Stack, iterable, dedent, set
10+
from cbook import flatten, allequal, Stack, iterable, dedent
1111
import _image
1212
import colorbar as cbar
1313
from image import FigureImage

lib/matplotlib/pylab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
import sys, warnings
196196

197197
from cbook import flatten, is_string_like, exception_to_str, popd, \
198-
silent_list, iterable, enumerate, dedent
198+
silent_list, iterable, dedent
199199

200200
import numpy as np
201201
from numpy import ma

lib/matplotlib/text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from matplotlib import rcParams
1111
import artist
1212
from artist import Artist
13-
from cbook import enumerate, is_string_like, maxdict
13+
from cbook import is_string_like, maxdict
1414
from font_manager import FontProperties
1515
from patches import bbox_artist, YAArrow
1616
from transforms import Affine2D, Bbox

lib/subprocess/__init__.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)