def __init__(self, string): match = self._re.match(string) if not match: raise ValueError("%s: not a OSS URI" % string) groups = match.groups() self._bucket = groups[0] self._object = unicodise(groups[1])
def __init__(self, string): match = self._re.match(string) groups = match.groups() if groups[0] not in (None, "file://"): raise ValueError("%s: not a file:// URI" % string) self._path = unicodise(groups[1]).split(os.path.sep)