1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-04 16:07:57 +03:00
Commit Graph

55 Commits

Author SHA1 Message Date
Simon Sapin
972045c63f Accept both unicode and bytes filenames. 2012-06-02 08:04:24 +02:00
Simon Sapin
740160df00 Allow internal links without a base URI
... only for links in HTML attributes: <a href="#foo">

TODO: same for links in CSS: -weasy-link: url(#foo)
2012-05-30 20:06:44 +02:00
Simon Sapin
647b2c965b Warn for relative URI references without a base URI. 2012-05-24 16:06:58 +02:00
Simon Sapin
14dc5e7aff Make urlopen() extensible
There is a global dict mapping URI schemes to opener functions,
and a decorator to add such a function.

Expected usage:

from weasyprint.urls import register_opener
@register_opener('foo')
def git_urlopen(url):
    url = urlparse.urlsplit(url)
    assert url.scheme == 'foo'
    # ...
    return fileobj, mimetype, charset
2012-05-23 15:13:57 +02:00
Simon Sapin
d694a98350 Rename the utils module to 'urls' 2012-05-23 15:13:57 +02:00