'get specified parts of the path.  \'arg\' is a string
with comma separated path parts. The parts are returned
in exactly the order of the specification.
you may specify the following parts:
http://host.com/repo/path/file.ext
|-----------------------|          dirname
|------| basename
|--|     purebasename
|--| ext'

def _getbyspec(self, spec):

    res = []
    parts = self.strpath.split(self.sep)
    for name in spec.split(','):
        name = name.strip()
        if (name == 'dirname'):
            res.append(self.sep.join(parts[:(-1)]))
        elif (name == 'basename'):
            res.append(parts[(-1)])
        else:
            basename = parts[(-1)]
            i = basename.rfind('.')
            if (i == (-1)):
                (purebasename, ext) = (basename, '')
            else:
                (purebasename, ext) = (basename[:i], basename[i:])
            if (name == 'purebasename'):
                res.append(purebasename)
            elif (name == 'ext'):
                res.append(ext)
            else:
                raise NameError(("Don't    know    part    %r" % name))
    return res
