'Process downloadable file paths.'

def process_downloads(self, docname, doctree):

    docdir = path.dirname(self.doc2path(docname, base=None))
    for node in doctree.traverse(addnodes.download_reference):
        targetname = node['reftarget']
        if (targetname.startswith('/') or targetname.startswith(os.sep)):
            filepath = targetname[1:]
        else:
            filepath = path.normpath(path.join(docdir, node['reftarget']))
        self.dependencies.setdefault(docname, set()).add(filepath)
        if (not os.access(path.join(self.srcdir, filepath), os.R_OK)):
            self.warn(docname, ('download    file    not    readable:    %s' % filepath), getattr(node, 'line', None))
            continue
        uniquename = self.dlfiles.add_file(docname, filepath)
        node['filename'] = uniquename
