[Zope3-checkins] CVS: Zope3/src/zope/products/content/interfaces - __init__.py:1.1.2.1 file.py:1.1.2.1 i18nfile.py:1.1.2.1 i18nimage.py:1.1.2.1 image.py:1.1.2.1

Philipp von Weitershausen philikon at philikon.de
Sun Feb 8 09:03:49 EST 2004


Update of /cvs-repository/Zope3/src/zope/products/content/interfaces
In directory cvs.zope.org:/tmp/cvs-serv10229/products/content/interfaces

Added Files:
      Tag: philikon-movecontent-branch
	__init__.py file.py i18nfile.py i18nimage.py image.py 
Log Message:
Move zope.app.content,
     zope.app.interfaces.content,
 and zope.app.browser.content
to zope.products.content and zope.products.codecontent, respectively.


=== Added File Zope3/src/zope/products/content/interfaces/__init__.py ===
#
# This file is necessary to make this directory a package.


=== Added File Zope3/src/zope/products/content/interfaces/file.py ===
##############################################################################
#
# Copyright (c) 2001, 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.
#
##############################################################################
"""Basic File interfaces.

$Id: file.py,v 1.1.2.1 2004/02/08 14:03:47 philikon Exp $
"""
import zope.schema
from zope.interface import Interface
from zope.app.i18n import ZopeMessageIDFactory as _

class IReadFile(Interface):

    contentType = zope.schema.BytesLine(
        title = _(u'Content Type'),
        description=_(u'The content type identifies the type of data.'),
        default = 'text/plain',
        required=False
        )

    data = zope.schema.Bytes(
        title = _(u'Data'),
        description = _(u'The actual content of the object.'),
        default='',
        required=False,
        )

    def getData():
        """Return the contained data of the object."""

    def getContentType():
        """Returns the content type of the file using mime-types syntax."""

    def getSize():
        """Return the byte-size of the data of the object."""


class IWriteFile(Interface):

    def edit(data, contentType=None):
        """Sets the data and the content type for the object.

           Since some implementations will provide their content type
           through the data, it is good to leave the argument optional.
        """

    def setData(data):
        """Rewrite the 'file'."""

    def setContentType(contentType):
        """Sets the content type of the file."""


class IFile(IReadFile, IWriteFile):
    """The basic methods that are required to implement
       a file as a Zope Content object.

    """


class IFileContent(Interface):
    """Marker interface for content that can be managed as files.

    The default view for file content has effective URLs that don't end in
    /.  In particular, if the content included HTML, relative links in
    the HTML are relative to the container the content is in.
    """


=== Added File Zope3/src/zope/products/content/interfaces/i18nfile.py ===
##############################################################################
#
# Copyright (c) 2001, 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.
#
##############################################################################
"""
$Id: i18nfile.py,v 1.1.2.1 2004/02/08 14:03:47 philikon Exp $
"""

from zope.i18n.interfaces import II18nAware

from file import IFile

class II18nFile(IFile, II18nAware):
    """I18n aware file interface."""

    def removeLanguage(language):
        """Remove translated content for a given language.
        """


=== Added File Zope3/src/zope/products/content/interfaces/i18nimage.py ===
##############################################################################
#
# Copyright (c) 2001, 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.
#
##############################################################################
"""
$Id: i18nimage.py,v 1.1.2.1 2004/02/08 14:03:47 philikon Exp $
"""

from image import IImage
from i18nfile import II18nFile

class II18nImage(II18nFile, IImage):
    """I18n aware image interface."""


=== Added File Zope3/src/zope/products/content/interfaces/image.py ===
##############################################################################
#
# Copyright (c) 2001, 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.
#
##############################################################################
"""
$Id: image.py,v 1.1.2.1 2004/02/08 14:03:47 philikon Exp $
"""

from file import IFile

class IImage(IFile):
    """This interface defines an Image that can be displayed.
    """

    def getImageSize():
        """Return a tuple (x, y) that describes the dimensions of
        the object.
        """




More information about the Zope3-Checkins mailing list