Skip to content

Make all classes new-style. #3662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/animation/strip_chart_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import matplotlib.animation as animation


class Scope:
class Scope(object)
def __init__(self, ax, maxt=2, dt=0.02):
self.ax = ax
self.dt = dt
Expand Down
2 changes: 1 addition & 1 deletion examples/event_handling/data_browser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np


class PointBrowser:
class PointBrowser(object):
"""
Click on a point to select and highlight it -- the data that
generated the point will be shown in the lower axes. Use the 'n'
Expand Down
2 changes: 1 addition & 1 deletion examples/event_handling/looking_glass.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
line, = ax.plot(x, y, alpha=1.0, clip_path=circ)


class EventHandler:
class EventHandler(object):
def __init__(self):
fig.canvas.mpl_connect('button_press_event', self.onpress)
fig.canvas.mpl_connect('button_release_event', self.onrelease)
Expand Down
2 changes: 1 addition & 1 deletion examples/event_handling/path_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
ax.add_patch(patch)


class PathInteractor:
class PathInteractor(object):
"""
An path editor.

Expand Down
2 changes: 1 addition & 1 deletion examples/event_handling/poly_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from matplotlib.mlab import dist_point_to_segment


class PolygonInteractor:
class PolygonInteractor(object):
"""
An polygon editor.

Expand Down
4 changes: 2 additions & 2 deletions examples/pylab_examples/cursor_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pylab import *


class Cursor:
class Cursor(object):
def __init__(self, ax):
self.ax = ax
self.lx = ax.axhline(color='k') # the horiz line
Expand All @@ -35,7 +35,7 @@ def mouse_move(self, event):
draw()


class SnaptoCursor:
class SnaptoCursor(object):
"""
Like Cursor but the crosshair snaps to the nearest x,y point
For simplicity, I'm assuming x is sorted
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/image_slices_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from matplotlib.pyplot import figure, show


class IndexTracker:
class IndexTracker(object):
def __init__(self, ax, X):
self.ax = ax
ax.set_title('use scroll wheel to navigate images')
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/multi_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# observing it for changes in cmap or norm.


class ImageFollower:
class ImageFollower(object):
'update image in response to changes in clim or cmap on another image'

def __init__(self, follower):
Expand Down
4 changes: 2 additions & 2 deletions examples/units/evans_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import matplotlib.pyplot as plt


class Foo:
class Foo(object):
def __init__(self, val, unit=1.0):
self.unit = unit
self._val = val * unit
Expand All @@ -20,7 +20,7 @@ def value(self, unit):
return self._val / unit


class FooConverter:
class FooConverter(object):
@staticmethod
def axisinfo(unit, axis):
'return the Foo AxisInfo'
Expand Down
4 changes: 2 additions & 2 deletions examples/user_interfaces/fourier_demo_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from matplotlib.pyplot import gcf, setp


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


class Param:
class Param(object):
"""
The idea of the "Param" class is that some parameter in the GUI may have
several knobs that both control it and reflect the parameter's state, e.g.
Expand Down
4 changes: 2 additions & 2 deletions examples/user_interfaces/interactive2.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"""


class Completer:
class Completer(object):
"""
Taken from rlcompleter, with readline references stripped, and a local dictionary to use.
"""
Expand Down Expand Up @@ -112,7 +112,7 @@ def get_class_members(klass):
return ret


class OutputStream:
class OutputStream(object):
"""
A Multiplexing output stream.
It can replace another stream, and tee output to the original stream and too
Expand Down
4 changes: 2 additions & 2 deletions examples/user_interfaces/mpl_with_glade.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ def simple_msg(msg, parent=None, title=None):
return None


class GladeHandlers:
class GladeHandlers(object):
def on_buttonClickMe_clicked(event):
simple_msg('Nothing to say, really',
parent=widgets['windowMain'],
title='Thanks!')


class WidgetsWrapper:
class WidgetsWrapper(object):
def __init__(self):
self.widgets = gtk.glade.XML('mpl_with_glade.glade')
self.widgets.signal_autoconnect(GladeHandlers.__dict__)
Expand Down
2 changes: 1 addition & 1 deletion examples/user_interfaces/mpl_with_glade_316.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCanvas


class Window1Signals:
class Window1Signals(object):
def on_window1_destroy(self, widget):
Gtk.main_quit()

Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
l, = plt.plot(t, s, lw=2)


class Index:
class Index(object):
ind = 0

def next(self, event):
Expand Down
4 changes: 2 additions & 2 deletions examples/widgets/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import matplotlib.image as image


class ItemProperties:
class ItemProperties(object):
def __init__(self, fontsize=14, labelcolor='black', bgcolor='yellow',
alpha=1.0):
self.fontsize = fontsize
Expand Down Expand Up @@ -118,7 +118,7 @@ def set_hover(self, event):
return changed


class Menu:
class Menu(object):
def __init__(self, fig, menuitems):
self.figure = fig
fig.suppressComposite = True
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def _is_writable_dir(p):
return True


class Verbose:
class Verbose(object):
"""
A class to handle reporting. Set the fileo attribute to any file
instance to handle the output. Default is sys.stdout
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def cleanup(self):

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

Expand Down Expand Up @@ -450,7 +450,7 @@ class AVConvFileWriter(AVConvBase, FFMpegFileWriter):

# Base class of mencoder information. Contains configuration key information
# as well as arguments for controlling *output*
class MencoderBase:
class MencoderBase(object):
exec_key = 'animation.mencoder_path'
args_key = 'animation.mencoder_args'

Expand Down Expand Up @@ -509,7 +509,7 @@ def _args(self):


# Base class for animated GIFs with convert utility
class ImageMagickBase:
class ImageMagickBase(object):
exec_key = 'animation.convert_path'
args_key = 'animation.convert_args'

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ def matchfunc(x):
return artists


class ArtistInspector:
class ArtistInspector(object):
"""
A helper class to inspect an :class:`~matplotlib.artist.Artist`
and return information about it's settable properties and their
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def get_view_interval(self):
return self.axes.viewLim.intervaly


class Ticker:
class Ticker(object):
locator = None
formatter = None

Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ def stop_filter(self, filter_func):
pass


class GraphicsContextBase:
class GraphicsContextBase(object):
"""
An abstract base class that provides color, line styles, etc...
"""
Expand Down Expand Up @@ -1280,7 +1280,7 @@ def _on_timer(self):
self.stop()


class Event:
class Event(object):
"""
A matplotlib event. Attach additional attributes as defined in
:meth:`FigureCanvasBase.mpl_connect`. The following attributes
Expand Down Expand Up @@ -2595,7 +2595,7 @@ def set_window_title(self, title):
pass


class Cursors:
class Cursors(object):
# this class is only used as a simple namespace
HAND, POINTER, SELECT_REGION, MOVE = list(range(4))
cursors = Cursors()
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ def get_filename_from_user (self):

return filename, self.ext

class DialogLineprops:
class DialogLineprops(object):
"""
A GUI dialog for controlling lineprops
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_gtk3.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def get_filename_from_user (self):

return filename, self.ext

class DialogLineprops:
class DialogLineprops(object):
"""
A GUI dialog for controlling lineprops
"""
Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/backends/backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def __init__(self, message, latex_output=""):
self.latex_output = latex_output


class LatexManagerFactory:
class LatexManagerFactory(object):
previous_instance = None

@staticmethod
Expand All @@ -233,7 +233,7 @@ def get_latex_manager():
LatexManagerFactory.previous_instance = new_inst
return new_inst

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

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


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


class TmpDirCleaner:
class TmpDirCleaner(object):
remaining_tmpdirs = set()

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def escape_attrib(s):
# @param file A file or file-like object. This object must implement
# a <b>write</b> method that takes an 8-bit string.

class XMLWriter:
class XMLWriter(object):
def __init__(self, file):
self.__write = file.write
if hasattr(file, "flush"):
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_tkagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def full_screen_toggle(self):
self.window.attributes('-fullscreen', not is_fullscreen)


class AxisMenu:
class AxisMenu(object):
def __init__(self, master, naxes):
self._master = master
self._naxes = naxes
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def debug_on_error(type, value, tb):
print()
pdb.pm() # jdh uncomment

class fake_stderr:
class fake_stderr(object):
"""Wx does strange things with stderr, as it makes the assumption that there
is probably no console. This redirects stderr to the console, since we know
that there is one!"""
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/windowing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def GetForegroundWindow():
def SetForegroundWindow(hwnd):
pass

class FocusManager:
class FocusManager(object):
def __init__(self):
self._shellWindow = GetForegroundWindow()

Expand Down
Loading