Skip to content

Commit

Permalink
Convert all old-style python classes to new-style.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Dec 22, 2015
1 parent d418a6a commit b391342
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion python/Gaffer/BlockedConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

import Gaffer

class BlockedConnection() :
class BlockedConnection( object ) :

def __init__( self, connectionOrConnections ) :

Expand Down
6 changes: 3 additions & 3 deletions python/Gaffer/OutputRedirection.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

## A threadsafe means of temporarily diverting sys.stdout and/or sys.stderr
# to alternative functions.
class OutputRedirection :
class OutputRedirection( object ) :

def __init__( self, stdOut = None, stdErr = None ) :

Expand Down Expand Up @@ -73,7 +73,7 @@ def __exit__( self, type, value, traceBack ) :
__sysLock = threading.RLock()
_streams = threading.local()

class _StdOut() :
class _StdOut( object ) :

def write( self, text ) :

Expand All @@ -83,7 +83,7 @@ def write( self, text ) :
else :
OutputRedirection._originalStdOut.write( text )

class _StdErr() :
class _StdErr( object ) :

def write( self, text ) :

Expand Down
2 changes: 1 addition & 1 deletion python/Gaffer/UndoContext.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

from _Gaffer import _UndoContext

class UndoContext() :
class UndoContext( object ) :

State = _UndoContext.State

Expand Down
2 changes: 1 addition & 1 deletion python/GafferCortex/OpMatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#
# ["OpMatcher"]["ignore"] - when this BoolData is True, the Parameter is not
# considered by the matcher.
class OpMatcher() :
class OpMatcher( object ) :

def __init__( self, classLoader, classNamesMatchString = "*", reportErrors=True ) :

Expand Down
2 changes: 1 addition & 1 deletion python/GafferDispatch/LocalDispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__( self, name = "LocalDispatcher", jobPool = None ) :

self.__jobPool = jobPool if jobPool else LocalDispatcher.defaultJobPool()

class Job :
class Job( object ) :

Status = IECore.Enum.create( "Waiting", "Running", "Complete", "Failed", "Killed" )

Expand Down
2 changes: 1 addition & 1 deletion python/GafferRenderManUI/RenderManShaderUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def __parameterActivators( parent ) :

node = parent.node()

class ExpressionVariables :
class ExpressionVariables( object ) :

def connected( self, key ) :

Expand Down
5 changes: 1 addition & 4 deletions python/GafferSceneTest/SceneProceduralTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def findMesh( g ):

def testAllRenderedSignal( self ) :

class AllRenderedTest :
class AllRenderedTest( object ) :
allRenderedSignalCalled = False
def allRendered( self ):
self.allRenderedSignalCalled = True
Expand Down Expand Up @@ -240,8 +240,5 @@ def allRendered( self ):

self.assertEqual( t.allRenderedSignalCalled, True )




if __name__ == "__main__":
unittest.main()
2 changes: 1 addition & 1 deletion python/GafferTest/SignalsTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def build( parent, depth=0 ) :
# references to the T instance below were kept until another exception was thrown.
def testExceptionRefCounting( self ) :

class T :
class T( object ) :

def __init__( self, s ) :

Expand Down
2 changes: 1 addition & 1 deletion python/GafferTest/WeakMethodTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class WeakMethodTest( GafferTest.TestCase ) :

def test( self ) :

class A() :
class A( object ) :

def f( self ) :

Expand Down
4 changes: 2 additions & 2 deletions python/GafferTest/pythonScripts/variableScope.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@

# This script is used by PythonApplicationTest.py

class A() :
class A( object ) :

pass

class B() :
class B( object ) :

def __init__( self ) :

Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/Bookmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
## The Bookmarks class provides a registry of named locations for use
# in Path UIs. To allow different gaffer applications to coexist in the
# same process, separate bookmarks are maintained per application.
class Bookmarks :
class Bookmarks( object ) :

## Use acquire() in preference to this constructor.
def __init__( self, applicationRoot, pathType, category ) :
Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/DisplayTransform.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# class allows the registration of a function to perform linear->display
# transforms, and to signal when this is changed. It is expected that
# specific application configurations will set this appropriately.
class DisplayTransform() :
class DisplayTransform( object ) :

# have to store it inside a list so python doesn't
# keep trying to turn it into a method.
Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/ErrorDialogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def displayException( title="Error", messagePrefix=None, withDetails=True, paren
dialogue.waitForButton( parentWindow=parentWindow )

## A simple context manager which calls displayException() if any exceptions are caught.
class ExceptionHandler :
class ExceptionHandler( object ) :

## The keyword arguments will be passed to displayException().
def __init__( self, **kw ) :
Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/EventLoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
QtGui = GafferUI._qtImport( "QtGui" )

## This class provides the event loops used to run GafferUI based applications.
class EventLoop() :
class EventLoop( object ) :

__RunStyle = IECore.Enum.create( "Normal", "PumpThread", "AlreadyRunning", "Houdini" )

Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/Layouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# sets of layouts are maintained on a per-application basis. Access
# to the layouts for a specific application is provided by the
# Layouts.acquire() method.
class Layouts :
class Layouts( object ) :

## Typically acquire() should be used in preference
# to this constructor.
Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/NodeMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# different applications to coexist happily in the same process, separate node
# menus are maintained per application, and NodeMenu.acquire() is used to
# obtain the appropriate menu.
class NodeMenu :
class NodeMenu( object ) :

## Chances are you want to use acquire() to get the NodeMenu for a
# specific application, rather than construct one directly.
Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/Playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# controlling frame ranges and signalling changes in playback state.
# All UI elements requiring such functionality should operate using
# a Playback object to ensure synchronisation between elements.
class Playback :
class Playback( object ) :

State = IECore.Enum.create( "PlayingForwards", "PlayingBackwards", "Scrubbing", "Stopped" )

Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/VectorDataWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ def setData( self, index, value, role ) :

# The _DataAccessor classes are responsible for converting from the Cortex data representation to the
# Qt (QVariant) representation.
class _DataAccessor() :
class _DataAccessor( object ) :

def __init__( self, data ) :

Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/_Variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# the standard python types, whereas PyQt binds and uses the QVariant type.
# This class provides functions to help with writing code which works
# with either set of bindings.
class _Variant() :
class _Variant( object ) :

## Returns value converted to a form which can be passed to a function
# expecting a QVariant.
Expand Down
2 changes: 1 addition & 1 deletion startup/GafferImage/imageWriterCompatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

import GafferImage

class __MultiSetPlug :
class __MultiSetPlug( object ) :
def __init__( self, plugs ) :
self._plugs = plugs

Expand Down

0 comments on commit b391342

Please sign in to comment.