Commit 482bdda9 authored by Michel Pelletier's avatar Michel Pelletier

*** empty log message ***

parent 9c890930
from Zope.Interfaces.Interface import Interface
from ItemInterface import ItemInterface
from PropertyManagerInterface import PropertyManagerInterface
class File:
"""
Description of the Image interface
"""
__extends__ = (ItemInterface,
PropertyManagerInterface,
)
def id(self):
"""
Returns the id of the file.
"""
def update_data(self, data, content_type=None, size=None):
"""
Updates the File with 'data'.
"""
def getSize(self):
"""
Returns the size of the file.
"""
get_size = getSize
def getContentType(self):
"""
Returns the content type of the file.
"""
FileInterface=Interface(File) # create the interface object
from Zope.Interfaces.Interface import Interface
class FindSupport:
"""
Description of the FindSupport interface
"""
def ZopeFind(self, obj, obj_ids=None, obj_metatypes=None,
obj_searchterm=None, obj_expr=None,
obj_mtime=None, obj_mspec=None,
obj_permission=None, obj_roles=None,
search_sub=0,
REQUEST=None, result=None, pre=''):
"""
Finds stuff.
"""
def ZopeFindAndApply(self, obj, obj_ids=None, obj_metatypes=None,
obj_searchterm=None, obj_expr=None,
obj_mtime=None, obj_mspec=None,
obj_permission=None, obj_roles=None,
search_sub=0,
REQUEST=None, result=None, pre='',
apply_func=None, apply_path=''):
"""
Finds stuff and applies each found object to 'apply_func'.
"""
FindSupportInterface=Interface(FindSupport) # create the interface object
from Zope.Interfaces.Interface import Interface
from ObjectManagerInterface import ObjectManagerInterface
from PropertyManagerInterface import PropertyManagerInterface
from AccessControl.RoleManagerInterface import RoleManagerInterface
from ItemInterface import ItemInterface
from FindSupportInterface import FindSupportInterface
class Folder:
"""
A Folder object can contain other Zope objects, including other
Folders. It is the generic 'container' object for Zope managment.
It is analogous to a UNIX 'directory' or a Windows 'Folder'.
"""
__extends__ = (ObjectManagerInterface,
PropertyManagerInterface,
RoleManagerInterface,
ItemInterface,
FindSupportInterface,
)
FolderInterface=Interface(Folder) # create the interface object
from Zope.Interfaces.Interface import Interface
from FileInterface import FileInterface
class Image:
"""
Description of the Image interface
"""
__extends__ = (FileInterface,)
def update_data(self, data, content_type=None, size=None):
"""
Replaces the Image with 'data'.
"""
def tag(self, height=None, width=None, alt=None,
scale=0, xscale=0, yscale=0, **args):
"""
Generate an HTML IMG tag for this image, with customization.
Arguments to self.tag() can be any valid attributes of an IMG
tag. 'src' will always be an absolute pathname, to prevent
redundant downloading of images. Defaults are applied
intelligently for 'height', 'width', and 'alt'. If specified,
the 'scale', 'xscale', and 'yscale' keyword arguments will be
used to automatically adjust the output height and width
values of the image tag.
"""
ImageInterface=Interface(Image) # create the interface object
from Zope.Interfaces.Interface import Interface
from ZDOMInterface import ElementInterface
class Item:
"""
Description of the Item interface
"""
__extends__ = (ElementInterface,)
def title_or_id(self):
"""
Descripotion
"""
def title_and_id(self):
"""
Description
"""
def this(self):
"""
description
"""
def absolute_url(self, relative=1):
"""
description
"""
ItemInterface=Interface(Item) # create the interface object
from Zope.Interfaces.Interface import Interface
class ObjectManager:
"""
Description of the ObjectManager interface
"""
def objectIds(self, spec=None):
"""
'objectIds' returns the ids of objects in this ObjectManager.
If the optional argument 'spec' is provided, then only ids of
objects of meta_type 'spec' will be returned. 'spec' can be
either a string or a list of strings.
"""
def objectValues(self, spec=None):
"""
'objectValues' returns the actuall subobjects in this
ObjectManager. If the optional argument 'spec' is provided,
then only objects of meta_type 'spec' will be returned.
'spec' can be either a string or a list of strings.
"""
def objectItems(self, spec=None):
"""
'objectItems' returns a list of (id, subobject) tuples in this
ObjectManager. if the optional argument 'spec' is provided,
then only objects of meta_type 'spec' will be returned.
'spec' can be either a string or a list of strings.
"""
def objectMap(self):
"""
Returns a tuple of mappings containing subobject meta-data.
"""
def superValues(self, t):
"""
'superValues' returns a list of objects of the given meta_type
't'. This search is performed in the current ObjectManager
and all ObjectManagers above it.
"""
ObjectManagerInterface=Interface(ObjectManager) # create the interface object
from Zope.Interfaces.Interface import Interface
class PropertyManager:
"""
Description of the PropertyManager interface
"""
def valid_property_id(self, id):
"""
Returns a true result if 'id' is a valid property name and is
not allready an attribute of 'self'.
"""
def getProperty(self, id, d=None):
"""
Get the property 'id', returning the optional second
argument or None if no such property is found.
"""
def getPropertyType(self, id):
"""
Get the type of property 'id'. returns None if no such
property exists.
"""
def hasProperty(self, id):
"""
Returns a true value if 'self' has the property 'id'.
Otherwise returns a false value.
"""
def propertyIds(self):
"""
Returns a list of property ids.
"""
def propertyValues(self):
"""
Returns a list of actual property objects.
"""
def propertyIds(self):
"""
Return a list of (id, property) tuples.
"""
def propertyMap(self):
"""
Returns a tuple of mappings, giving meta-data for properties.
"""
def propertyLable(self, id):
"""
Returns a label for the given property 'id'. This just
returns 'id'.
"""
def propdict(self):
"""
Returns a mapping from property id to property object.
"""
PropertyManagerInterface=Interface(PropertyManager) # create the interface object
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment