Explorar el Código

Whitespace changes

Michael Pitidis hace 13 años
padre
commit
0f90bf13f9
Se han modificado 1 ficheros con 26 adiciones y 27 borrados
  1. 26 27
      shape.py

+ 26 - 27
shape.py

@@ -1,40 +1,39 @@
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 
-
-
-import sys, random
 from PyQt4.QtGui import *
 from PyQt4.QtCore import *
 
 class shape(object):
-    
+
     def __init__(self ,label,color):
-    	self.label=label
-    	self.points=[]
-    	self.color=color
-    	self.fill=False
+        self.label=label
+        self.points=[]
+        self.color=color
+        self.fill=False
+
     def getLabel(self):
-    	return label
-    	
+        return label
+
     def setLabel(self,label):
-    	self.label=label
-    
+        self.label=label
+
     def setFill(self,fillB):
-    	self.fill=fillB
+        self.fill=fillB
+
     def addPoint(self,point):
-    	self.points.append(point)
-    	
+        self.points.append(point)
+
     def drawShape(self,painter):
-    	
-    	if len(self.points) >0 :
-    		pen=QPen(self.color)
-    		painter.setPen(pen)
-    		prePoint=self.points[0]
-    		path=QPainterPath()
-    		path.moveTo(prePoint.x(),prePoint.y())
-    		for point in self.points:
-    			path.lineTo(point.x(),point.y())
-    		painter.drawPath(path)
-    	if self.fill:
-    		painter.fillPath(path,Qt.red)
+
+        if len(self.points) >0 :
+            pen=QPen(self.color)
+            painter.setPen(pen)
+            prePoint=self.points[0]
+            path=QPainterPath()
+            path.moveTo(prePoint.x(),prePoint.y())
+            for point in self.points:
+                path.lineTo(point.x(),point.y())
+            painter.drawPath(path)
+        if self.fill:
+            painter.fillPath(path,Qt.red)