ezeep / pyipptool Goto Github PK
View Code? Open in Web Editor NEWIPP request generator to interact with CUPS or IPP devices.
License: Other
IPP request generator to interact with CUPS or IPP devices.
License: Other
~/pyipptool/tests/test_form.py:218: SyntaxWarning: assertion is always true, perhaps remove parentheses?
assert ('ATTR keyword requested-attributes'
~/pyipptool/tests/test_form.py:292: SyntaxWarning: assertion is always true, perhaps remove parentheses?
assert ('ATTR keyword requested-attributes'
member-uris
argumentCan you please write an example of a script for printing a job, or holding a document then resume the action? Like how do I call the fuction what do I need to import...
Thank you..
>>> uri = 'https://localhost:49631/'
>>> # implicit
>>> cups_get_printers(uri)
[{}]
>>> # explicit
>>> cups_get_printers(uri, requested_attributes='all')
[{}]
Performing the request repeatedly will eventually bring the sought results. Perhaps the problem is with the ipptool
. Needs further investigations.
Any chance for a release that updates the package on pypi to include support for py3?
see specs at http://tools.ietf.org/html/rfc3995#section-11.2.5
11.2.5.1. Get-Subscriptions Request
The following groups of attributes are part of the Get-Subscriptions
request:Group 1: Operation Attributes
Natural Language and Character Set:
...
Target:
The "printer-uri" attribute which defines the target for this
operation as described in [RFC2911] section 3.1.5.Requesting User Name:
The "requesting-user-name" attribute SHOULD be supplied by the
client as described in [RFC2911] section 8.3.11.2.5.1.1. "notify-job-id" (integer(1:MAX))
...
11.2.5.1.2. "limit" (integer(1:MAX))
...
11.2.5.1.3. "requested-attributes" (1setOf type2 keyword)
...
11.2.5.1.4. "my-subscriptions" (boolean)
...
Configuration values which are expected to be integers or floats can be fetched using the getint and getfloat methods, respectively.
>>> create_printer_subscription('https://localhost:49631/', printer_uri='https://localhost:49631/printers/gluino', requesting_user_name='ecp_admin', notify_recipient_uri='ezpnotifier://')
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 808, in __bootstrap_inner
self.run()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 1078, in run
self.finished.wait(self.interval)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 618, in wait
self.__cond.wait(timeout)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 348, in wait
endtime = _time() + timeout
TypeError: unsupported operand type(s) for +: 'float' and 'str'
see specs at http://tools.ietf.org/html/rfc3995#section-11.2.7
cups_add_modify_printer
printer_state
3
has to be passed - passing the string 'idle' won't workSee specifications at http://www.cups.org/documentation.php/doc-1.7/spec-ipp.html#CUPS_GET_PPD
For instance:
when requesting the attributes of a printer, if one wishes to only retrieve the name and state, the current way will be:
requested_attributes = 'printer-name,printer-state'
get_printer_attributes(uri, printer_uri=printer_uri, requested_attributes=requested_attributes)
one approach that would perhaps be more convenient would be the possibility to pass the requested attributes as a tuple, or list ...
requested_attributes = ('printer-name' , 'printer-state')
get_printer_attributes(uri, printer_uri=printer_uri, requested_attributes=requested_attributes)
we would then internally convert the list/tuple into a string ...
def get_printer_attributes(uri,
printer_uri=None,
requesting_user_name=colander.null,
requested_attributes=colander.null):
if requested_attributes:
requested_attributes = ','.join(requested_attributes)
# ...
thus allowing users of the function to simply pass a list/tuple for the attributes they wish to retrieve
this obviously requires the user to properly use the function, meaning that passing a string won't work, for instance ...
see section 4.1.10 in http://tools.ietf.org/search/rfc2911#section-4
it is used in create subscription operations for the field notify-user-data
NOTE: the test is already written, but the addition of the printer does not work. So it is in a "troubleshooting" phase.
There doesn't seem to be any way to pass the cups fitplot / fit-to-page / scaling option in the print_job function
GetDevicesOperationAttributes
limit
parameter is indeed there in the requestdef create_printer_subscription(uri, ...):
# ...
return response['Tests'][0]['notify-subscription-id']
the return value should be changed to
return response['Tests'][0]['ResponseAttributes'][1]['notify-subscription-id']
Small details need to be reviewed. See Create-Printer-Subscriptions Request and more particularly Subscription Template Attributes.
Add tornado support for non-blocking subprocess calls
ipptool might prompt user for credentials if they are missing. Thus blocking forever the subprocess call.
1 - We need to implement a timeout
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.