Back to index

plone3  3.1.7
Functions
CMFCore.tests.base.utils Namespace Reference

Functions

def has_path
 Copyright (c) 2002 Zope Corporation and Contributors.
def _setUpDefaultTraversable

Function Documentation

Definition at line 30 of file utils.py.

00030 
00031 def _setUpDefaultTraversable():
00032     from zope.interface import Interface
00033     from zope.component import provideAdapter
00034     from zope.traversing.interfaces import ITraversable
00035     from zope.traversing.adapters import DefaultTraversable
00036 
00037     provideAdapter(DefaultTraversable, (Interface,), ITraversable)

Here is the caller graph for this function:

def CMFCore.tests.base.utils.has_path (   catalog,
  path 
)

Copyright (c) 2002 Zope Corporation and Contributors.

All Rights Reserved.

This software is subject to the provisions of the Zope Public License, Version 2.1 (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.

    Verify that catalog has an object at path.

Definition at line 18 of file utils.py.

00018 
00019 def has_path( catalog, path ):
00020     """
00021         Verify that catalog has an object at path.
00022     """
00023     if type( path ) is type( () ):
00024         path = '/'.join(path)
00025     rids = map( lambda x: x.data_record_id_, catalog.searchResults() )
00026     for rid in rids:
00027         if catalog.getpath( rid ) == path:
00028             return 1
00029     return 0

Here is the caller graph for this function: