Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to support remote URIs #13

Merged
merged 1 commit into from
Feb 28, 2014
Merged

Conversation

boralyl
Copy link
Contributor

@boralyl boralyl commented Dec 18, 2012

Including images in a template that are remote (we use amazon S3 for our static content) is supported in pisa by passing a uri. As mentioned in the commit comment, this could also be done with a regex, not sure what would be most efficient.

@maestrofjp
Copy link

+1 for getting this merged in as we use S3 as well. The startsWith is just fine because its very readable whereas regex not so much. I suspect that loading up a regex might be slightly slower, but it's probably not worth investigating. FYI, since Python 2.5 you can pass a tuple into startsWith:

elif uri.startswith(("http://", "https://", )):

@taplister
Copy link

@maestrofjp Thanks for the tip, wasn't aware of the string.startswith(tuple, ...)

@maestrofjp
Copy link

@taplister you're welcome! I only came across it myself a few weeks ago...

@chrisglass
Copy link
Collaborator

Merging, hope this helps.

chrisglass added a commit that referenced this pull request Feb 28, 2014
Added ability to support remote URIs
@chrisglass chrisglass merged commit 94c0d1e into xhtml2pdf:master Feb 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants