'Create an area-relative resource.
"path" is either the full path to the resource, or a
relative path under the given area name. "area" must be
specified for the latter.
"area" (optional) can be given to specify under which area
this resource resides. If not given, the best-fit of the
known path areas will be used.'

def __init__(self, path, area=None):

    if (area is not None):
        if (area not in self._path_areas):
            raise ValueError(("unknown    path    area:    `%s'" % area))
        self.area = area
        if isabs(path):
            area_base = self._path_areas[area]
            if (not path.startswith(area_base)):
                raise ValueError(("cannot    create    AreaResource:    `%s'    is    not    under    `%s'    area    (%s)" % (path, area, area_base)))
            self.subpath = path[(len(area_base) + 1):]
        else:
            self.subpath = path
    elif isinstance(path, tuple):
        (self.area, self.subpath) = path
    else:
        (self.area, self.subpath) = self.area_and_subpath_from_path(path)
