Simon Sapin
43d1e73e65
Fix code formatting. (Clean flake8!)
2014-04-27 12:29:55 +01:00
Simon Sapin
09b2a4def0
Correctly close StreamingGzipFile, and log this kind of error
...
… rather than silence them. Logs make tests fail.
2014-04-27 11:00:02 +01:00
Simon Sapin
9404375d3e
Fix #86 : Support gzip and deflate encoding in HTTP responses
2014-04-21 23:52:58 +01:00
Simon Sapin
c34221d215
2014.
2014-01-10 14:27:02 +00:00
Florian Mounier
e3d7bad55b
Be careful logging.warn is deprecated
2013-08-19 14:38:09 +02:00
Simon Sapin
52c06894b7
Docs: add an example combining documents into one PDF file.
2013-07-14 09:22:04 +01:00
Simon Sapin
d8014d28ad
Image loading: only swallow exception related to fetching or decoding.
2013-06-20 22:06:47 +01:00
Simon Sapin
05e1cb22b2
URL fetching: enforce closing sockets/files with a context manager.
2013-06-20 15:16:47 +01:00
Simon Sapin
9c9fc1ae2d
Do not get MIME types base on URLs.
2013-06-20 12:40:11 +01:00
Simon Sapin
9d5cebb5ce
URL fetching: use an intermediate function rather than a wrapper
2013-06-20 12:17:03 +01:00
Simon Sapin
0d9f867491
Fix the URL scheme regexp.
...
Not sure why I had [0-1] there.
2013-04-12 10:32:25 +03:00
Simon Sapin
171438f48e
2013
2013-04-03 16:23:48 +02:00
Simon Sapin
c854feece9
Fix #21 : Check for 'data' URL scheme case-insensitively.
2013-03-28 13:33:28 +01:00
Simon Sapin
89bd068990
Allow absolute URLs without a base URL. Fix #42 .
2013-03-13 12:12:12 +01:00
Simon Sapin
6f56613441
Do not require HtmlElement.
...
* Do not use element.base_url which only exists in lxml.html.HtmlElement
* Use lxml.etree.HtmlParser instead of lxml.html
This is one step toward using the html5lib parser, but see
https://github.com/Kozea/WeasyPrint/pull/12
2012-11-06 13:55:39 +01:00
Simon Sapin
3072fff2e5
Docs docs docs.
...
But no ducks.
2012-10-08 19:51:18 +02:00
Simon Sapin
c2b2b8c2ea
Escape non-ASCII characters in hyperlinks.
2012-10-04 19:12:34 +02:00
Simon Sapin
7984fbd3bc
Warn (not crash) on missing base_url for @import
2012-09-25 16:01:12 +02:00
Simon Sapin
87d5741376
Integrate the sphinx docs with docstrings.
2012-09-19 17:37:52 +02:00
Simon Sapin
2614821fa9
Add support for <base href="..."> element in HTML.
2012-08-03 15:22:26 +02:00
Simon Sapin
d1971b6e63
Remove unused imports.
2012-08-03 13:32:42 +02:00
Simon Sapin
eab2646dcc
Fix base_url set to a directory name.
...
With base_url='/a/b', a relative URL 'c' was resolved to '/a/c'.
Now it is resolved to '/a/b/c' if /a/b is a directory, '/a/c'
otherwise. This is most likely the expected behavior.
2012-08-02 17:19:34 +02:00
Simon Sapin
fb01c4c839
Work around getfilesystemencoding stupidity on Linux.
2012-07-30 12:01:20 +02:00
Simon Sapin
a34fd1a616
Remove a deprecation warning.
2012-07-29 18:38:59 +02:00
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