示例#1
0
def createKupuEditor(parent, filepath, id=None):
    """Adds either a DirectoryView or a derivative object.
    """
    info = _dirreg.getDirectoryInfo(filepath)
    if info is None:
        raise ValueError('Not a registered directory: %s' % filepath)
    if not id:
        id = path.split(filepath)[-1]
    else:
        id = str(id)
    ob = KupuEditor(id, filepath)
    parent._setObject(id, ob)
示例#2
0
文件: __init__.py 项目: mmbase/kupu
def createKupuEditor(parent, filepath, id=None):
    """Adds either a DirectoryView or a derivative object.
    """
    info = _dirreg.getDirectoryInfo(filepath)
    if info is None:
        raise ValueError('Not a registered directory: %s' % filepath)
    if not id:
        id = path.split(filepath)[-1]
    else:
        id = str(id)
    ob = KupuEditor(id, filepath)
    parent._setObject(id, ob)
示例#3
0
 def __of__(self, parent):
     info = _dirreg.getDirectoryInfo(self._dirpath)
     if info is not None:
         info = info.getContents(_dirreg)
     if info is None:
         data = {}
         objects = ()
     else:
         data, objects = info
     s = KupuEditorSurrogate(self, data, objects)
     res = s.__of__(parent)
     return res
示例#4
0
文件: __init__.py 项目: mmbase/kupu
 def __of__(self, parent):
     info = _dirreg.getDirectoryInfo(self._dirpath)
     if info is not None:
         info = info.getContents(_dirreg)
     if info is None:
         data = {}
         objects = ()
     else:
         data, objects = info
     s = KupuEditorSurrogate(self, data, objects)
     res = s.__of__(parent)
     return res