跳转到主要内容

从运行中的CUPS实例获取打印机的工具

项目描述

cups-printer

从CUPS服务器检索所有打印机。这是一个简单的命令行工具,允许用户输出现有打印机或将它们写入文件。

安装

可能需要安装CUPS的开发包,例如 $ sudo dnf -y install cups-devel

PyPI

该软件包托管在 PyPI。它依赖于 typerpycups

$ pip install cups_printer

手动设置

$ python3 -m venv 
$ source bin/activate
$ python3 setup.py

用法

默认的CUPS实例是 localhost

$ cups-printers --help

                                                                                                                           
 Usage: cups-printers [OPTIONS] COMMAND [ARGS]...                                                                          
                                                                                                                           
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --server                    TEXT  The server URL of CUPS instance [env var: CUPS_SERVER] [default: localhost:631]       │
│ --timeout                   TEXT  Timeout for network operations [env var: TIMEOUT] [default: 5]                        │
│ --install-completion              Install completion for the current shell.                                             │
│ --show-completion                 Show completion for the current shell, to copy it or customize the installation.      │
│ --help                            Show this message and exit.                                                           │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ output                                                                                                                  │
│ queue                                                                                                                   │
│ state                                                                                                                   │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

要从远程CUPS实例获取详细信息,请使用 --server

$ cups-printers --server 192.168.191.1:631 output json

许可证

cups-printers 基于 MIT 许可。

项目详情


下载文件

下载适合您平台文件的文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。

源分布

cups_printers-1.0.0.tar.gz (4.4 kB 查看哈希值)

上传时间:

构建的分发

cups_printers-1.0.0-py3-none-any.whl (7.2 kB 查看哈希值)

上传时间 Python 3

支持