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

Example for IPPRequest with IPPAttribute ('hold-new-jobs') #24

Open
LarsBeugelaar opened this issue Jul 6, 2020 · 0 comments
Open

Example for IPPRequest with IPPAttribute ('hold-new-jobs') #24

LarsBeugelaar opened this issue Jul 6, 2020 · 0 comments

Comments

@LarsBeugelaar
Copy link

Hi, I am trying to get my cups printer to 'hold-new-jobs', but its not cear to me how I should do an IPPRequest with the necessary IPPAttribue(s) and handle the response. The callback response is a set of bytes and the repsonse of writeIO is -1. Maybe an example can be added to the repo? I have tried the following:

# Response is a set of bytes. Not clear (to me) what it means and if its parsed or can be parsed somewhere.
def ipp_hold_new_jobs_request_handler(response):
    print("Hold_all_jobs handler called. Response: {}".format(response))


ipp_request = cups.IPPRequest(cups.IPP_OP_HOLD_NEW_JOBS)
ipp_attribute = cups.IPPAttribute(cups.IPP_TAG_OPERATION, cups.IPP_TAG_URI, "printer-uri",
                                  "ipp://cups.beugelaar.hq/printers/prt0")
ipp_request.add(ipp_attribute)
response = ipp_request.writeIO(ipp_hold_new_jobs_request_handler)
print('repsonse: {}'.format(response))

I have also posted a question about what I want to accomplish on stackoverflow: https://stackoverflow.com/questions/62741730/pycups-create-and-send-ipprequest-with-ippattribute-and-parse-response-enable

Thanks in advance.

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

No branches or pull requests

1 participant