Did I find the right examples for you? yes no

All Samples(16)  |  Call(16)  |  Derive(0)  |  Import(0)
Return True, if childUri is a child of parentUri or maps to the same resource.

Similar to <util.isChildUri>_ ,  but this method also returns True, if parent
equals child. ('/a/b' is considered identical with '/a/b/').

        def isEqualOrChildUri(parentUri, childUri):
    """Return True, if childUri is a child of parentUri or maps to the same resource.
    
    Similar to _ ,  but this method also returns True, if parent
    equals child. ('/a/b' is considered identical with '/a/b/').
    """
    return parentUri and childUri and (childUri.rstrip("/")+"/").startswith(parentUri.rstrip("/")+"/")
        


src/w/s/WsgiDAV-1.1.0/wsgidav/request_server.py   WsgiDAV(Download)
        if srcPath == destPath:
            self._fail(HTTP_FORBIDDEN, "Cannot copy/move source onto itself")
        elif util.isEqualOrChildUri(srcPath, destPath):
            self._fail(HTTP_FORBIDDEN, "Cannot copy/move source below itself")
 
            parentError = False
            for ignorePath in ignoreDict.keys():
                if util.isEqualOrChildUri(ignorePath, sRes.path):
                    parentError = True
                    break
                childError = False
                for ignorePath in ignoreDict.keys():
                    if util.isEqualOrChildUri(sRes.path, ignorePath):
                        childError = True
                        break

src/w/s/wsgidav-HEAD/wsgidav/request_server.py   wsgidav(Download)
        if srcPath == destPath:
            self._fail(HTTP_FORBIDDEN, "Cannot copy/move source onto itself")
        elif util.isEqualOrChildUri(srcPath, destPath):
            self._fail(HTTP_FORBIDDEN, "Cannot copy/move source below itself")
 
            parentError = False
            for ignorePath in ignoreDict.keys():
                if util.isEqualOrChildUri(ignorePath, sRes.path):
                    parentError = True
                    break
                childError = False
                for ignorePath in ignoreDict.keys():
                    if util.isEqualOrChildUri(sRes.path, ignorePath):
                        childError = True
                        break

src/w/s/WsgiDAV-1.1.0/wsgidav/lock_manager.py   WsgiDAV(Download)
    def isUrlLockedByToken(self, url, locktoken):
        """Check, if url (or any of it's parents) is locked by locktoken."""
        lockUrl = self.getLock(locktoken, "root")
        return lockUrl and util.isEqualOrChildUri(lockUrl, url) 
 

src/w/s/wsgidav-HEAD/wsgidav/lock_manager.py   wsgidav(Download)
    def isUrlLockedByToken(self, url, locktoken):
        """Check, if url (or any of it's parents) is locked by locktoken."""
        lockUrl = self.getLock(locktoken, "root")
        return lockUrl and util.isEqualOrChildUri(lockUrl, url) 
 

src/w/s/WsgiDAV-1.1.0/wsgidav/fs_dav_provider.py   WsgiDAV(Download)
            raise DAVError(HTTP_FORBIDDEN)
        fpDest = self.provider._locToFilePath(destPath)
        assert not util.isEqualOrChildUri(self.path, destPath)
        # Copy file (overwrite, if exists)
        shutil.copy2(self._filePath, fpDest)
            raise DAVError(HTTP_FORBIDDEN)
        fpDest = self.provider._locToFilePath(destPath)
        assert not util.isEqualOrChildUri(self.path, destPath)
        assert not os.path.exists(fpDest)
        _logger.debug("moveRecursive(%s, %s)" % (self._filePath, fpDest))
            raise DAVError(HTTP_FORBIDDEN)
        fpDest = self.provider._locToFilePath(destPath)
        assert not util.isEqualOrChildUri(self.path, destPath)
        # Create destination collection, if not exists
        if not os.path.exists(fpDest):
            raise DAVError(HTTP_FORBIDDEN)
        fpDest = self.provider._locToFilePath(destPath)
        assert not util.isEqualOrChildUri(self.path, destPath)
        assert not os.path.exists(fpDest)
        _logger.debug("moveRecursive(%s, %s)" % (self._filePath, fpDest))

src/w/s/wsgidav-HEAD/wsgidav/fs_dav_provider.py   wsgidav(Download)
            raise DAVError(HTTP_FORBIDDEN)
        fpDest = self.provider._locToFilePath(destPath)
        assert not util.isEqualOrChildUri(self.path, destPath)
        # Copy file (overwrite, if exists)
        shutil.copy2(self._filePath, fpDest)
            raise DAVError(HTTP_FORBIDDEN)
        fpDest = self.provider._locToFilePath(destPath)
        assert not util.isEqualOrChildUri(self.path, destPath)
        assert not os.path.exists(fpDest)
        _logger.debug("moveRecursive(%s, %s)" % (self._filePath, fpDest))
            raise DAVError(HTTP_FORBIDDEN)
        fpDest = self.provider._locToFilePath(destPath)
        assert not util.isEqualOrChildUri(self.path, destPath)
        # Create destination collection, if not exists
        if not os.path.exists(fpDest):
            raise DAVError(HTTP_FORBIDDEN)
        fpDest = self.provider._locToFilePath(destPath)
        assert not util.isEqualOrChildUri(self.path, destPath)
        assert not os.path.exists(fpDest)
        _logger.debug("moveRecursive(%s, %s)" % (self._filePath, fpDest))