从genmsg规范生成的Python占位符生成器
项目描述
从genmsg规范生成的Python占位符生成器
安装
pip install genpyi
使用
catkin
将 genpyi 和 message_generation 添加到 CMakeLists.txt 中的 find_package。当构建 msg/srv 文件时,genmsg 将自动找到 genpyi。
此外,请记住,您的软件包应该在 package.xml 中具有对 genpyi 的构建依赖项,以确保 catkin 在构建您的软件包之前完成 genpyi 的构建。
示例
- CMakeLists.txt
find_package(
catkinREQUIREDCOMPONENTSstd_msgsmessage_generationgenpyi)
- package.xml
<build_depend>genpyi</build_depend>
命令行界面
$ genpyi --help Usage: genpyi [-h] {msg,srv,module} ... positional arguments: {msg,srv,module} msg Generate stub files from .msg files srv Generate stub files from .srv files module Generate __init__.pyi from a msg/srv directory optional arguments: -h, --help show this help message and exit
示例
# Message files
$ genpyi msg custom_msgs custom_msgs/msg/Custom.msg
$ genpyi msg std_msgs --out-dir out /opt/ros/melodic/share/std_msgs/msg/Header.msg
$ genpyi msg sensor_msgs --out-dir out \
-Istd_msgs:/opt/ros/melodic/share/std_msgs/msg \
-Isensor_msgs:/opt/ros/melodic/share/sensor_msgs/msg \
/opt/ros/melodic/share/sensor_msgs/msg/PointCloud2.msg
# Service files
$ genpyi srv custom_msgs custom_msgs/srv/Custom.msg
$ genpyi srv nav_msgs --out-dir out \
-Istd_msgs:/opt/ros/melodic/share/std_msgs/msg \
-Isensor_msgs:/opt/ros/melodic/share/sensor_msgs/msg \
/opt/ros/melodic/share/sensor_msgs/srv/SetCameraInfo.srv
# Module files
$ genpyi module custom_msgs/msg
$ genpyi module --module-finder py --out out \
/opt/ros/melodic/lib/python2.7/dist-packages/std_msgs/msg/
genpyi msg / genpyi srv
Usage: genpyi {msg,srv} [-h] [--out-dir OUT_DIR]
[--include-path INCLUDE_PATH]
package files [files ...]
positional arguments:
package Package name of given files
files Files to generate stubs
optional arguments:
-h, --help show this help message and exit
--out-dir OUT_DIR Output directory. If the option is unset, each stub
file will be generated in the same directory as each
input.
--include-path INCLUDE_PATH, -I INCLUDE_PATH
Include paths for processing given files
genpyi 模块:
Usage: genpyi module [-h] [--out-dir OUT_DIR] package_dir
Positional arguments:
package_dir Package directory to create __init__.pyi
Optional arguments:
-h, --help show this help message and exit
--out-dir OUT_DIR Output directory. If the option is unset, __init__.pyi
will be generated in the same directory as package_dir.
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装软件包 的更多信息。
源分布
genpyi-0.2.0.tar.gz (13.7 kB 查看哈希值)
构建分布
genpyi-0.2.0-py2.py3-none-any.whl (14.6 kB 查看哈希值)