Simon Sapin
c39d4119c8
Fix MIME type registering: always use native strings.
2012-07-29 15:13:45 +02:00
Simon Sapin
50c175a5dc
Force the MIME types for the file extensions we care about.
2012-07-28 22:38:44 +02:00
Simon Sapin
b1f0959df5
Use the filesystem encoding for file:// URLs. This might help with #891
2012-07-27 18:55:19 +02:00
Simon Sapin
96748be086
Gotta learn to run *all* tests before pushing.
2012-07-27 18:08:05 +02:00
Simon Sapin
501f690d49
Require at least 2 characters in URL schemes.
...
This makes sure that Windows filenames like C:\foo\bar.html
are not considered as URLs.
2012-07-27 17:19:17 +02:00
Simon Sapin
4a6fff4384
Make mime_type optional in custom URL fetchers
2012-07-18 14:34:43 +02:00
Simon Sapin
2768dea548
Add `url_fetcher
` to the public API
2012-07-13 12:24:55 +02:00
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