Return the resource for the root directory of this filesystem or None, given a ``resource`` in ``codebase`` with a possible resource root-relative ``path`` (e.g. extending from the root directory we are looking for).
(path, resource, codebase)
| 180 | |
| 181 | |
| 182 | def find_root_resource(path, resource, codebase): |
| 183 | """ |
| 184 | Return the resource for the root directory of this filesystem or None, given |
| 185 | a ``resource`` in ``codebase`` with a possible resource root-relative |
| 186 | ``path`` (e.g. extending from the root directory we are looking for). |
| 187 | """ |
| 188 | if not resource.path.endswith(path): |
| 189 | return |
| 190 | for _seg in path.split('/'): |
| 191 | resource = resource.parent(codebase) |
| 192 | if not resource: |
| 193 | return |
| 194 | return resource |
| 195 | |
| 196 | |
| 197 | def yield_dependencies_from_package_data(package_data, datafile_path, package_uid): |
no test coverage detected