diff --git a/README.rst b/README.rst index e78b583..a9bd7c7 100644 --- a/README.rst +++ b/README.rst @@ -29,8 +29,8 @@ Usage import cups from cups_notify import Subscriber - def on_event(event): - print(event) + def on_event(evt): + print(evt) # Create a CUPS connection conn = cups.Connection() @@ -54,10 +54,10 @@ It is possible to define a list of events on which the callback is binded: .. code-block:: python import cups - from cups_notify import Subscriber, events + from cups_notify import Subscriber, event - def my_callback(event): - print(event) + def my_callback(evt): + print(evt.title, evt.description) # Create a new subscriber sub = Subscriber(cups.Connection()) @@ -67,9 +67,9 @@ It is possible to define a list of events on which the callback is binded: event.CUPS_EVT_JOB_COMPLETED, event.CUPS_EVT_JOB_STOPPED]) -If the CUPS server is not running on the same computer as the subscriber application, -the local IP address (same network than the CUPS server) have to be provided to the -subscriber class: +If the CUPS server is not running on the same computer as the subscriber application +one, the local IP address (same network than the CUPS server) have to be provided to +the subscriber class: .. code-block:: python diff --git a/cups_notify/__init__.py b/cups_notify/__init__.py index 172a604..2140f01 100644 --- a/cups_notify/__init__.py +++ b/cups_notify/__init__.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -"""Notification system for the pycups libarary.""" +"""Notification system for the pycups library.""" import logging LOGGER = logging.getLogger(__name__) -__version__ = "0.0.1" +__version__ = "0.0.2" diff --git a/cups_notify/subscriber.py b/cups_notify/subscriber.py index d05e80b..2e8f488 100644 --- a/cups_notify/subscriber.py +++ b/cups_notify/subscriber.py @@ -52,9 +52,7 @@ def main(): def on_event(evt): print(evt) - conn = cups.Connection() - - sub = Subscriber(conn) + sub = Subscriber(cups.Connection()) sub.subscribe(on_event) try: