[Zope3-checkins] CVS: zopeproducts/pypgsqlda/interfaces - __init__.py:1.1 geometric.py:1.2

Christian 'Tiran' Heimes heimes@faho.rwth-aachen.de
Tue, 18 Mar 2003 17:56:46 -0500


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

Modified Files:
	geometric.py 
Added Files:
	__init__.py 
Log Message:
added __init__.py to make this directory a package
some work on Point


=== Added File zopeproducts/pypgsqlda/interfaces/__init__.py ===
# make this a python package



=== zopeproducts/pypgsqlda/interfaces/geometric.py 1.1 => 1.2 ===
--- zopeproducts/pypgsqlda/interfaces/geometric.py:1.1	Tue Mar 18 17:19:07 2003
+++ zopeproducts/pypgsqlda/interfaces/geometric.py	Tue Mar 18 17:56:46 2003
@@ -1,55 +1,77 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Geometric object interfaces.
-
-$Id$
-"""
-
-from zope.interface import Interface, Attribute
-
-class Point:
-    """A 2 dimensional point in cartesian representation."""
-
-    x = Attribute("x coordinate as float")
-    y = Attribute("y coordinate as float")
-
-class Shape:
-    """An abstract interface for geometric shapes."""
-
-    def area():
-        pass
-        
-    def circumference():
-        pass
-    
-
-class Circle(Shape):
-    """A circle. It is represented as a center point and a radius."""
-
-    center = Attribute("center as point coordinate")
-    radius = Attribute("radius as float")
-
-class Box(Shape):
-
-    upperRight = Attribute("Upper right point of the box as point coordinate")
-    lowerLeft = Attribute("Lower left point of the box as point coordinate")
-
-class Path:
-    """A path is an ordered set of points. A path can be closed, which means
-       that the end point is connected to the start point. A special kind of
-       path is the line, which only has to points and is open."""
-    
-    points = Attribute("List of coordinate points")
-    open = Attribute("Is the last point connected to the first?")
-    
+##############################################################################
+#
+# Copyright (c) 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Geometric object interfaces.
+
+$Id$
+"""
+
+from zope.interface import Interface, Attribute
+
+class Point(Interface):
+    """A 2 dimensional point in cartesian representation."""
+
+    x = Attribute("x coordinate as float")
+    y = Attribute("y coordinate as float")
+    
+    def getX():
+        """Gets x coordinate
+        """
+
+    def setX(value):
+        """Sets x coordinate
+        """
+
+    def getY():
+        """Gets y coordinate
+        """
+
+    def setY(value):
+        """Sets y coordinate
+        """
+
+    def setCoord(xOrTuple, y):
+        """Sets x/y coordinate
+        
+        The first argument maybe a tuple with two elemets
+        """
+
+class Shape(Interface):
+    """An abstract interface for geometric shapes."""
+
+    def area():
+        pass
+        
+    def circumference():
+        pass
+    
+
+class Circle(Shape):
+    """A circle. It is represented as a center point and a radius."""
+
+    center = Attribute("center as point coordinate")
+    radius = Attribute("radius as float")
+
+class Box(Shape):
+
+    upperRight = Attribute("Upper right point of the box as point coordinate")
+    lowerLeft = Attribute("Lower left point of the box as point coordinate")
+
+class Path(Interface):
+    """A path is an ordered set of points. A path can be closed, which means
+       that the end point is connected to the start point. A special kind of
+       path is the line, which only has to points and is open."""
+    
+    points = Attribute("List of coordinate points")
+    open = Attribute("Is the last point connected to the first?")
+