纯蟒蛇方案的实现
lirconian的Python项目详细描述
这是lirc^{tt1}的一个新的独立实现$ 程序。它提供了一个python api和一个命令行接口。这个 命令行界面与 irsend。相反,它被组织为一个带有子命令的程序。
与irsend还有一些其他的细微差别:
- 子命令已重命名,并且必须是小写,
- send once已重命名为send;只接受一个命令 (irsend需要几个),
- 不带参数的发送停止(重命名为stop)使用远程和 来自上一个send start命令的命令(仅限api;不来自 命令行),
- list已被两个子命令remotes(listing)替换 和commands,列出给定遥控器中的命令,
- 不需要为某些命令提供伪空参数,
- 要发送的--count参数是子命令的参数。
- 命令中的代码(以前为“列出远程”)将被禁止,除非 -c已给出,
- 端口号必须用--port(-p)参数给定; hostip:portnumber无法识别,
- 详细选项--verbose(-v);回送所有与 LIRC服务器,
- 使用--timeout(-t)选项可选择超时,
- 更好的错误消息
它只依赖于标准的python库。
python2和python3都受支持。 这完全取决于标准 python库。 (最小版本分别为2.7和3.2; 但是,这还没有经过测试。)
对于gui-lirc客户机,请查看 IrScrutinizer。 对于Java版本,请查看 JavaLircClient。
用法:
usage: lirconian [-h] [-a host] [-d path] [-p port] [-t s] [-V] [-v] sub-commands ... Program to send IR codes and commands to a Lirc server. positional arguments: sub-commands send Send one command start Start sending one command until stopped stop Stop sending the command from send-start remotes Inquire the list of remotes commands Inquire the list of commands in a remote input-log Set input logging driver-option Set driver option simulate Fake the reception of IR signals transmitters Set transmitters version Inquire version of the Lirc server. (Use "--version" for the version of this program.) optional arguments: -h, --help show this help message and exit -a host, --address host IP name or address of lircd host. Takes preference over --device. -d path, --device path Path name of the lircd socket -p port, --port port Port of lircd, default 8765 -t s, --timeout s Timeout in seconds -V, --version Display version information for this program -v, --verbose Have the communication with the Lirc server echoed
不同于“python bindings for lirc”
当前的lirc版本包含“Python bindings”。 它“需要安装lirc,包括头文件”。它不纯净 python,需要安装一个c模块。因此,它的用途主要是 允许使用python环境中的lirc程序。
相反,这里提供的程序和api是纯python。它运行 在每个支持python的主机上,不管lirc是否存在。 (可能的异常(取决于python实现)是 Unix域套接字版本。)