GithubHelp home page GithubHelp logo

pyipptool's People

Contributors

sbellem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyipptool's Issues

create_printer_subscription -- TypeError: unsupported operand type(s) for +: 'float' and 'str'

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'

CUPS-Get-PPDs Operation

  1. Use inheritance from GetDevicesOperationAttributes
  2. Test: check that the limit parameter is indeed there in the request

Example

Can 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..

SyntaxWarning : assertion is always true ...

~/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'

cups_get_printers - requested_attributes='all' does not work

>>> 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.

think of a more convenient way to pass requested attributes

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 ...

Prevent blocking subprocess

ipptool might prompt user for credentials if they are missing. Thus blocking forever the subprocess call.
1 - We need to implement a timeout

get_subscriptions parameters should be as in rfc 3995

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)
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.