Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def resource_adder(self, link_, base=None):
- link = self.urlnormalize(link_)
- link, frag = self.urldefrag(link)
- link = unquote(link).replace('/', os.sep)
- self.oeb.log.debug('Adding', link)
- if not link.strip():
- return link_
- try:
- if base and not os.path.isabs(link):
- link = os.path.join(base, link)
- link = os.path.abspath(link)
- # PypeBros: how about URLs that have non-ASCII characters ?
- except:
- return link_
- if not os.access(link, os.R_OK):
- return link_
- if os.path.isdir(link):
- self.log.warn(link_, 'is a link to a directory. Ignoring.')
- return link_
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement