Fix warnings in python3

This commit is contained in:
Vladislav Sovrasov
2016-02-24 13:09:42 +03:00
parent e4fed417d2
commit 22b028b64b
4 changed files with 14 additions and 32 deletions
+5 -5
View File
@@ -21,7 +21,7 @@ class TestSceneRender():
self.noise = noise
self.speed = speed
if bgImg != None:
if bgImg is not None:
self.sceneBg = bgImg.copy()
else:
self.sceneBg = np.zeros(defaultSize, defaultSize, np.uint8)
@@ -29,7 +29,7 @@ class TestSceneRender():
self.w = self.sceneBg.shape[0]
self.h = self.sceneBg.shape[1]
if fgImg != None:
if fgImg is not None:
self.foreground = fgImg.copy()
self.center = self.currentCenter = (int(self.w/2 - fgImg.shape[0]/2), int(self.h/2 - fgImg.shape[1]/2))
@@ -53,7 +53,7 @@ class TestSceneRender():
def getRectInTime(self, time):
if self.foreground != None:
if self.foreground is not None:
tmp = np.array(self.center) + np.array((self.getXOffset(time), self.getYOffset(time)))
x0, y0 = tmp
x1, y1 = tmp + self.foreground.shape[0:2]
@@ -65,7 +65,7 @@ class TestSceneRender():
def getCurrentRect(self):
if self.foreground != None:
if self.foreground is not None:
x0 = self.currentCenter[0]
y0 = self.currentCenter[1]
@@ -80,7 +80,7 @@ class TestSceneRender():
def getNextFrame(self):
img = self.sceneBg.copy()
if self.foreground != None:
if self.foreground is not None:
self.currentCenter = (self.center[0] + self.getXOffset(self.time), self.center[1] + self.getYOffset(self.time))
img[self.currentCenter[0]:self.currentCenter[0]+self.foreground.shape[0],
self.currentCenter[1]:self.currentCenter[1]+self.foreground.shape[1]] = self.foreground