[Zope3-checkins] CVS: zopeproducts/pypgsqlda/pgtypes/interface - __init__.py:1.1.2.1 geometric.py:1.1.2.1 network.py:1.1.2.1 null.py:1.1.2.1 numeric.py:1.1.2.1
Christian 'Tiran' Heimes
heimes@faho.rwth-aachen.de
Mon, 7 Apr 2003 12:18:52 -0400
Update of /cvs-repository/zopeproducts/pypgsqlda/pgtypes/interface
In directory cvs.zope.org:/tmp/cvs-serv6910/pgtypes/interface
Added Files:
Tag: tiran-pypgsql_types-branch
__init__.py geometric.py network.py null.py numeric.py
Log Message:
* first test release of pgtypes
=== Added File zopeproducts/pypgsqlda/pgtypes/interface/__init__.py ===
##############################################################################
#
# 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.
#
##############################################################################
"""interfaces to the special types for the pyPgSQL Database Adapter
$Id: __init__.py,v 1.1.2.1 2003/04/07 16:18:51 tiran Exp $
"""
=== Added File zopeproducts/pypgsqlda/pgtypes/interface/geometric.py ===
##############################################################################
#
# 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: geometric.py,v 1.1.2.1 2003/04/07 16:18:51 tiran Exp $
"""
from zope.interface import Interface, Attribute
class IGeometricInfinite(Interface):
"""Represents the infinite size of a geometric object
"""
def __call__():
"""Returns __str__ function
"""
def __repr__():
"""Returns output of __str__ function
"""
def __str__():
"""Prints coordinates
"""
class IGeometric2d(Interface):
"""A 2d geometric object"""
isClosed = Attribute("Is this object closed, e.g. a box or polygon")
isOpen = Attribute("Is this object open, e.g. a path or line")
length = Attribute("Lenght of a line or circumference of a box")
def __call__():
"""Returns __str__ function
"""
def __repr__():
"""Returns output of __str__ function
"""
def __str__():
"""Prints coordinates
"""
def __iter__():
"""iterator support
iterates over all x/y coordinates
"""
def __len__():
"""len() support
number of points
"""
class IShape2d(IGeometric2d):
"""An abstract interface for geometric shapes."""
area = Attribute("area of the shape as float (ro)")
class IPoint2d(IGeometric2d):
"""A 2 dimensional point in cartesian representation."""
x = Attribute("x coordinate as float")
y = Attribute("y coordinate as float")
class ICircle2d(IShape2d):
"""A circle. It is represented as a center point and a radius."""
center = Attribute("center as point coordinate")
radius = Attribute("radius as float")
class IBox2d(IShape2d):
upperRight = Attribute("Upper right point of the box as point coordinate")
lowerLeft = Attribute("Lower left point of the box as point coordinate")
class IPath2d(IGeometric2d):
"""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")
=== Added File zopeproducts/pypgsqlda/pgtypes/interface/network.py ===
##############################################################################
#
# 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.
#
##############################################################################
"""Network object interfaces.
$Id: network.py,v 1.1.2.1 2003/04/07 16:18:51 tiran Exp $
"""
from zope.interface import Interface, Attribute
class IPv4(Interface):
"""
"""
def gethostbyname():
""" """
def gethostbyaddr():
""" """
def getfqdn():
""" """
def gethostname():
""" """
class IPv4Hostaddress(Interface):
"""
"""
class IPv4Netmask(Interface):
"""
"""
class IPv4Address(IPv4, IPv4Hostaddress, IPv4Netmask):
"""
"""
class IPv6(Interface):
"""
"""
class IPv6Address(IPv6):
"""
"""
=== Added File zopeproducts/pypgsqlda/pgtypes/interface/null.py ===
##############################################################################
#
# 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.
#
##############################################################################
"""Numeric object interfaces.
$Id: null.py,v 1.1.2.1 2003/04/07 16:18:51 tiran Exp $
"""
from zope.interface import Interface, Attribute
class INull(Interface):
"""XXX
"""
def __call__():
pass
def __str__():
pass
=== Added File zopeproducts/pypgsqlda/pgtypes/interface/numeric.py ===
##############################################################################
#
# 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.
#
##############################################################################
"""Numeric object interfaces.
$Id: numeric.py,v 1.1.2.1 2003/04/07 16:18:51 tiran Exp $
"""
from zope.interface import Interface, Attribute
class IMoney(Interface):
"""
XXX: i18n integration
"""
currency = Attribute("")
class INumeric(Interface):
"""
"""
scale = Attribute("")
precision = Attribute("")