def __init__(self, prefix, url, path, size=None):

    def ensure_unicode(x):
        return (None if (x is None) else to_unicode(x))
    (prefix, url, path) = map(ensure_unicode, (prefix, url, path))
    self._size = size
    self._url = url
    self._path = path
    self._key = None
    if path:
        self._size = os.stat(self._path).st_size
    if ((prefix is None) or (prefix == url)):
        self._key = url
        self._prefix = None
    else:
        self._key = url[(len(prefix.rstrip('/')) + 1):].rstrip('/')
        self._prefix = prefix
def __init__(self, prefix, url, path, size=None):

    def ensure_unicode(x):
        return (None if (x is None) else to_unicode(x))
    (prefix, url, path) = map(ensure_unicode, (prefix, url, path))
    self._size = size
    self._url = url
    self._path = path
    self._key = None
    if path:
        self._size = os.stat(self._path).st_size
    if ((prefix is None) or (prefix == url)):
        self._key = url
        self._prefix = None
    else:
        self._key = url[(len(prefix.rstrip('/')) + 1):].rstrip('/')
        self._prefix = prefix