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

Skip to content

Commit f4e9c6c

Browse files
committed
class foo: => class foo(object):
1 parent dbeed94 commit f4e9c6c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+80
-80
lines changed

examples/animation/strip_chart_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import matplotlib.animation as animation
99

1010

11-
class Scope:
11+
class Scope(object)
1212
def __init__(self, ax, maxt=2, dt=0.02):
1313
self.ax = ax
1414
self.dt = dt

examples/event_handling/data_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22

33

4-
class PointBrowser:
4+
class PointBrowser(object):
55
"""
66
Click on a point to select and highlight it -- the data that
77
generated the point will be shown in the lower axes. Use the 'n'

examples/event_handling/looking_glass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
line, = ax.plot(x, y, alpha=1.0, clip_path=circ)
1313

1414

15-
class EventHandler:
15+
class EventHandler(object):
1616
def __init__(self):
1717
fig.canvas.mpl_connect('button_press_event', self.onpress)
1818
fig.canvas.mpl_connect('button_release_event', self.onrelease)

examples/event_handling/path_editor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
ax.add_patch(patch)
2626

2727

28-
class PathInteractor:
28+
class PathInteractor(object):
2929
"""
3030
An path editor.
3131

examples/event_handling/poly_editor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from matplotlib.mlab import dist_point_to_segment
1010

1111

12-
class PolygonInteractor:
12+
class PolygonInteractor(object):
1313
"""
1414
An polygon editor.
1515

examples/pylab_examples/cursor_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from pylab import *
1515

1616

17-
class Cursor:
17+
class Cursor(object):
1818
def __init__(self, ax):
1919
self.ax = ax
2020
self.lx = ax.axhline(color='k') # the horiz line
@@ -35,7 +35,7 @@ def mouse_move(self, event):
3535
draw()
3636

3737

38-
class SnaptoCursor:
38+
class SnaptoCursor(object):
3939
"""
4040
Like Cursor but the crosshair snaps to the nearest x,y point
4141
For simplicity, I'm assuming x is sorted

examples/pylab_examples/image_slices_viewer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from matplotlib.pyplot import figure, show
44

55

6-
class IndexTracker:
6+
class IndexTracker(object):
77
def __init__(self, ax, X):
88
self.ax = ax
99
ax.set_title('use scroll wheel to navigate images')

examples/pylab_examples/multi_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# observing it for changes in cmap or norm.
5353

5454

55-
class ImageFollower:
55+
class ImageFollower(object):
5656
'update image in response to changes in clim or cmap on another image'
5757

5858
def __init__(self, follower):

examples/units/evans_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import matplotlib.pyplot as plt
1111

1212

13-
class Foo:
13+
class Foo(object):
1414
def __init__(self, val, unit=1.0):
1515
self.unit = unit
1616
self._val = val * unit
@@ -20,7 +20,7 @@ def value(self, unit):
2020
return self._val / unit
2121

2222

23-
class FooConverter:
23+
class FooConverter(object):
2424
@staticmethod
2525
def axisinfo(unit, axis):
2626
'return the Foo AxisInfo'

examples/user_interfaces/fourier_demo_wx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from matplotlib.pyplot import gcf, setp
1010

1111

12-
class Knob:
12+
class Knob(object):
1313
"""
1414
Knob - simple class with a "setKnob" method.
1515
A Knob instance is attached to a Param instance, e.g., param.attach(knob)
@@ -20,7 +20,7 @@ def setKnob(self, value):
2020
pass
2121

2222

23-
class Param:
23+
class Param(object):
2424
"""
2525
The idea of the "Param" class is that some parameter in the GUI may have
2626
several knobs that both control it and reflect the parameter's state, e.g.

examples/user_interfaces/interactive2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"""
3434

3535

36-
class Completer:
36+
class Completer(object):
3737
"""
3838
Taken from rlcompleter, with readline references stripped, and a local dictionary to use.
3939
"""
@@ -112,7 +112,7 @@ def get_class_members(klass):
112112
return ret
113113

114114

115-
class OutputStream:
115+
class OutputStream(object):
116116
"""
117117
A Multiplexing output stream.
118118
It can replace another stream, and tee output to the original stream and too

examples/user_interfaces/mpl_with_glade.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ def simple_msg(msg, parent=None, title=None):
3131
return None
3232

3333

34-
class GladeHandlers:
34+
class GladeHandlers(object):
3535
def on_buttonClickMe_clicked(event):
3636
simple_msg('Nothing to say, really',
3737
parent=widgets['windowMain'],
3838
title='Thanks!')
3939

4040

41-
class WidgetsWrapper:
41+
class WidgetsWrapper(object):
4242
def __init__(self):
4343
self.widgets = gtk.glade.XML('mpl_with_glade.glade')
4444
self.widgets.signal_autoconnect(GladeHandlers.__dict__)

examples/user_interfaces/mpl_with_glade_316.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCanvas
99

1010

11-
class Window1Signals:
11+
class Window1Signals(object):
1212
def on_window1_destroy(self, widget):
1313
Gtk.main_quit()
1414

examples/widgets/buttons.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
l, = plt.plot(t, s, lw=2)
1313

1414

15-
class Index:
15+
class Index(object):
1616
ind = 0
1717

1818
def next(self, event):

examples/widgets/menu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import matplotlib.image as image
1010

1111

12-
class ItemProperties:
12+
class ItemProperties(object):
1313
def __init__(self, fontsize=14, labelcolor='black', bgcolor='yellow',
1414
alpha=1.0):
1515
self.fontsize = fontsize
@@ -118,7 +118,7 @@ def set_hover(self, event):
118118
return changed
119119

120120

121-
class Menu:
121+
class Menu(object):
122122
def __init__(self, fig, menuitems):
123123
self.figure = fig
124124
fig.suppressComposite = True

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def _is_writable_dir(p):
244244
return True
245245

246246

247-
class Verbose:
247+
class Verbose(object):
248248
"""
249249
A class to handle reporting. Set the fileo attribute to any file
250250
instance to handle the output. Default is sys.stdout

lib/matplotlib/animation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def cleanup(self):
380380

381381
# Base class of ffmpeg information. Has the config keys and the common set
382382
# of arguments that controls the *output* side of things.
383-
class FFMpegBase:
383+
class FFMpegBase(object):
384384
exec_key = 'animation.ffmpeg_path'
385385
args_key = 'animation.ffmpeg_args'
386386

@@ -450,7 +450,7 @@ class AVConvFileWriter(AVConvBase, FFMpegFileWriter):
450450

451451
# Base class of mencoder information. Contains configuration key information
452452
# as well as arguments for controlling *output*
453-
class MencoderBase:
453+
class MencoderBase(object):
454454
exec_key = 'animation.mencoder_path'
455455
args_key = 'animation.mencoder_args'
456456

@@ -509,7 +509,7 @@ def _args(self):
509509

510510

511511
# Base class for animated GIFs with convert utility
512-
class ImageMagickBase:
512+
class ImageMagickBase(object):
513513
exec_key = 'animation.convert_path'
514514
args_key = 'animation.convert_args'
515515

lib/matplotlib/artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ def matchfunc(x):
873873
return artists
874874

875875

876-
class ArtistInspector:
876+
class ArtistInspector(object):
877877
"""
878878
A helper class to inspect an :class:`~matplotlib.artist.Artist`
879879
and return information about it's settable properties and their

lib/matplotlib/axis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ def get_view_interval(self):
590590
return self.axes.viewLim.intervaly
591591

592592

593-
class Ticker:
593+
class Ticker(object):
594594
locator = None
595595
formatter = None
596596

lib/matplotlib/backend_bases.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ def stop_filter(self, filter_func):
741741
pass
742742

743743

744-
class GraphicsContextBase:
744+
class GraphicsContextBase(object):
745745
"""
746746
An abstract base class that provides color, line styles, etc...
747747
"""
@@ -1280,7 +1280,7 @@ def _on_timer(self):
12801280
self.stop()
12811281

12821282

1283-
class Event:
1283+
class Event(object):
12841284
"""
12851285
A matplotlib event. Attach additional attributes as defined in
12861286
:meth:`FigureCanvasBase.mpl_connect`. The following attributes
@@ -2595,7 +2595,7 @@ def set_window_title(self, title):
25952595
pass
25962596

25972597

2598-
class Cursors:
2598+
class Cursors(object):
25992599
# this class is only used as a simple namespace
26002600
HAND, POINTER, SELECT_REGION, MOVE = list(range(4))
26012601
cursors = Cursors()

lib/matplotlib/backends/backend_gtk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ def get_filename_from_user (self):
873873

874874
return filename, self.ext
875875

876-
class DialogLineprops:
876+
class DialogLineprops(object):
877877
"""
878878
A GUI dialog for controlling lineprops
879879
"""

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ def get_filename_from_user (self):
699699

700700
return filename, self.ext
701701

702-
class DialogLineprops:
702+
class DialogLineprops(object):
703703
"""
704704
A GUI dialog for controlling lineprops
705705
"""

lib/matplotlib/backends/backend_pgf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def __init__(self, message, latex_output=""):
212212
self.latex_output = latex_output
213213

214214

215-
class LatexManagerFactory:
215+
class LatexManagerFactory(object):
216216
previous_instance = None
217217

218218
@staticmethod
@@ -233,7 +233,7 @@ def get_latex_manager():
233233
LatexManagerFactory.previous_instance = new_inst
234234
return new_inst
235235

236-
class WeakSet:
236+
class WeakSet(object):
237237
# TODO: Poor man's weakref.WeakSet.
238238
# Remove this once python 2.6 support is dropped from matplotlib.
239239

@@ -251,7 +251,7 @@ def __iter__(self):
251251
return six.iterkeys(self.weak_key_dict)
252252

253253

254-
class LatexManager:
254+
class LatexManager(object):
255255
"""
256256
The LatexManager opens an instance of the LaTeX application for
257257
determining the metrics of text elements. The LaTeX environment can be
@@ -737,7 +737,7 @@ def new_figure_manager_given_figure(num, figure):
737737
return manager
738738

739739

740-
class TmpDirCleaner:
740+
class TmpDirCleaner(object):
741741
remaining_tmpdirs = set()
742742

743743
@staticmethod

lib/matplotlib/backends/backend_svg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def escape_attrib(s):
9292
# @param file A file or file-like object. This object must implement
9393
# a <b>write</b> method that takes an 8-bit string.
9494

95-
class XMLWriter:
95+
class XMLWriter(object):
9696
def __init__(self, file):
9797
self.__write = file.write
9898
if hasattr(file, "flush"):

lib/matplotlib/backends/backend_tkagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def full_screen_toggle(self):
604604
self.window.attributes('-fullscreen', not is_fullscreen)
605605

606606

607-
class AxisMenu:
607+
class AxisMenu(object):
608608
def __init__(self, master, naxes):
609609
self._master = master
610610
self._naxes = naxes

lib/matplotlib/backends/backend_wx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def debug_on_error(type, value, tb):
102102
print()
103103
pdb.pm() # jdh uncomment
104104

105-
class fake_stderr:
105+
class fake_stderr(object):
106106
"""Wx does strange things with stderr, as it makes the assumption that there
107107
is probably no console. This redirects stderr to the console, since we know
108108
that there is one!"""

lib/matplotlib/backends/windowing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def GetForegroundWindow():
2323
def SetForegroundWindow(hwnd):
2424
pass
2525

26-
class FocusManager:
26+
class FocusManager(object):
2727
def __init__(self):
2828
self._shellWindow = GetForegroundWindow()
2929

0 commit comments

Comments
 (0)