Notification system for the pycups libarary.
Project description
The pycups-notify library is an extension to the pycups one. It enables subscription to CUPS RSS notifications.
This library implements the Event notify pattern to match with the design description of the CUPS server.
Install
$> pip install pycups-notify
Usage
import time
import cups
from cups_notify import Subscriber
def on_event(event):
print(event)
# Create a CUPS connection
conn = cups.Connection()
# Create a new subscriber
sub = Subscriber(conn)
# Subscribe the callback to all CUPS events
sub.subscribe(on_event)
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
sub.stop()
A simple listener can be started by typing the following command line:
$> pycups-notify
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for pycups_notify-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf422e9895ef49256e3dcaf556a4297230eab76b9c74bcf552e12446d43c6f68 |
|
MD5 | 05b248fe4b0d00fb9724735ea3458881 |
|
BLAKE2b-256 | a9715939e62853318b09f955fa817b967dade4c1bacb701a1ae20a20b838f062 |