Exemplo n.º 1
0
 def singleBranchTree(self, root=''):
     parent = getParent(self.context)
     while parent is not None:
             if IReadContainer.providedBy(parent):
                 view = zapi.queryMultiAdapter(
                     (parent, self.request), name='singleBranchTree.xml')
                 return view()
             else:
                 parent = getParent(parent)
Exemplo n.º 2
0
 def __init__(self, context):
     self.context = context
     try:
         parent = getParent(self.context)
     except TypeError:
         parent = None
     if parent is not None:
         try:
             pp = getPath(parent)
         except TypeError:
             pp = ""
         if not pp.endswith("/"):
             pp += "/"
         self.pp = pp  # parentpath
     else:
         self.pp = ""
     self.pplen = len(self.pp)
Exemplo n.º 3
0
 def testGetParentFromRoot(self):
     from zope.app.traversing.api import getParent
     self.assertEqual(
         getParent(self.root),
         None
         )
Exemplo n.º 4
0
 def testGetParent(self):
     from zope.app.traversing.api import getParent
     self.assertEqual(
         getParent(self.item),
         self.folder
         )