[Zope3-checkins] CVS: zopeproducts/pypgsqlda - geometric.py:1.2.2.1

Christian 'Tiran' Heimes heimes@faho.rwth-aachen.de
Thu, 20 Mar 2003 05:32:44 -0500


Update of /cvs-repository/zopeproducts/pypgsqlda
In directory cvs.zope.org:/tmp/cvs-serv27779

Modified Files:
      Tag: tiran-pypgsql_types-branch
	geometric.py 
Log Message:
changed from Point to Point2d using interfaces IGeometric2d and IPoint2d

=== zopeproducts/pypgsqlda/geometric.py 1.2 => 1.2.2.1 ===
--- zopeproducts/pypgsqlda/geometric.py:1.2	Wed Mar 19 05:13:34 2003
+++ zopeproducts/pypgsqlda/geometric.py	Thu Mar 20 05:32:43 2003
@@ -16,19 +16,34 @@
 $Id$
 """
 
-from interfaces.geometric import IPoint
+from interfaces.geometric import IPoint2d
 
-class Point(object):
+class Point2d(object):
     """Simple geometric point
     """
 
-    __implements__ = IPoint
-
-    def __init__(self, xOrTuple, y):
+    __implements__ = IPoint2d
+    
+    def __init__(self, x, y = None):
         # XXX
         self._x = float(xOrTuple)
         self._y = float(y)
 
+    def getClosed(self):
+        return False
+    
+    isClosed = property(getClosed, None, None)
+    
+    def getOpen(self):
+        return False
+    
+    isOpen = property(getOpen, None, None)
+    
+    def getLength(self):
+        return 0
+    
+    length = property(getLength, None, None)
+
     def getX(self):
         return self._x
 
@@ -48,8 +63,8 @@
     def getCoord(self):
         return (self._x, self._y)
 
-    def setCoord(self, xOrTuple, y):
-        self._x = float(xOrTuple)
+    def setCoord(self, x, y = None):
+        self._x = float(x)
         self._y = float(y)
     
     coord = property(getCoord, setCoord, None,