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

Multiple option value support (e.g. --custom-header) #58

Merged
merged 5 commits into from
Sep 6, 2016

Conversation

woodb
Copy link
Contributor

@woodb woodb commented Aug 31, 2016

Adds support for flags requiring multiple values by accepting option value as a tuple and then passing in the double argument to wkhtmltopdf.

Additionally, this adds tox configuration for testing in multiple versions of Python. Also, added a few things to .gitignore that I found were created during testing but not ignored (like .eggs).

Closes #41
Closes #45
Closes #53

@JazzCore JazzCore merged commit aea15ea into JazzCore:master Sep 6, 2016
@JazzCore
Copy link
Owner

JazzCore commented Sep 6, 2016

Thanks!

Small note - there was 2 PRs with multiple option value support - yours and #40. Since #40 also adds support for repeatable comments (which is harder to implement using your PR) I've used most of the code from #40.

There is a small syntax change in how option is specified in current version - you must place custom header tuple in a list (see example below), but now you can specify more than one custom header.

options = {
    'page-size': 'Letter',
    'margin-top': '0.75in',
    'margin-right': '0.75in',
    'margin-bottom': '0.75in',
    'margin-left': '0.75in',
    'encoding': "UTF-8",
    'custom-header' : [
        ('Accept-Encoding', 'gzip')
    ]
    'cookies': [
        ('cookie-name1', 'cookie-value1'),
        ('cookie-name2', 'cookie-value2'),
    ],
    'no-outline': None
}

@woodb woodb deleted the custom-header-support branch September 12, 2016 19:25
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.

2 participants