tango系统命令行管理器
项目描述
tangoctl
为Tango系统管理员构建的命令行界面。
tangoctl的目标是成为Tango的systemctl。
行动胜于言语。以下是一个视频
目的
特性
- 服务器操作
- 服务器信息
- 服务器树
- 服务器列表
- 注册/注销服务器
- 设备操作
- 设备信息
- 设备树
- 设备列表
- 注册/注销设备
- 执行命令
- 命令信息
- 读写属性
- 属性信息
- 读写属性
安装
在您喜欢的Python环境中安装它
$ pip install tangoctl
就是这样!
示例
# Display tree of servers:
tangoctl server tree
# Display list of devices:
tangoctl device list
# Read 'state' attribute from a device
tangoctl device attribute read -d sys/tg_test/1 -a state
# Execute command Init() on a device
tangoctl device command exec -d sys/tg_test/1 -c init
# Display 'double_spectrum' attribute information
tangoctl device attribute info -d sys/tg_test/1 -a double_spectrum
# Display list of device attributes:
tangoctl device attribute list -d sys/tg_test/1
编写您的服务器自定义bash完成
假设您有一个名为Tango的服务器LimaCCDs,并在数据库中注册了两个实例,也许使用了tangoctl
tangoctl server add LimaCCDs/basler1 -d id00/limaccds/basler1
tangoctl server add LimaCCDs/pilatus1 -d id00/limaccds/pilatus1
要在命令行中每次键入 LimaCCDs [tab]
时自动完成,请将以下行放入一个bash脚本中
# naive tango server autocomplete using tangoctl server ilist
_tango_server_complete()
{
stype="${COMP_WORDS[0]}"
sname="${COMP_WORDS[COMP_CWORD]}"
echo $stype
COMPREPLY=( $(tangoctl server ilist -t "${stype}" --instance="${sname}*") )
return 0
}
complete -F _tango_server_complete Demo
并运行它。下次您在bash命令行中键入 LimaCCDs [tab]]
时,它将提供现有的LimaCCDs实例作为完成选项
$ LimaCCDs [tab]
basler1 pilatus1
$ LimaCCDs pil[tab]
pilatus1
有关如何将其永久添加到您环境的说明,请参阅bash完成文档。
特别感谢
项目详情
关闭
tangoctl-0.10.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0fd9f586aaad39f482e165ed9a8f2bad66bec1decefc48eac93801e6693bf414 |
|
MD5 | ee5c75fef84a0369fdc9788b4d3a1577 |
|
BLAKE2b-256 | 33e3e80e7c2cb0cb346605ad69c51584669f4d4e9ed17700a3153c152e792c42 |