No project description provided
Project description
robotpy-cli
New for 2024, this package is used to execute subcommands on a RobotPy project. This does not actually implement any subcommands itself, but provides a mechanism to execute those subcommands.
Usage
On Windows:
py -m robotpy
On Linux/macOS:
python -m robotpy
See the RobotPy documentation for more information.
How RobotPy subcommands are implemented
When a user runs robotpy
or python -m robotpy
, they are presented with
several subcommands. Each of these subcommands is implemented as a class
that is registered using python's entry point mechanism in the "robotpy"
group. The registered class must meet the following requirements:
- The docstring of the class is used when the user does --help. The first line is treated as the summary, and all other lines are displayed when the subcommand specific help is queried.
If the subcommand is a group of commands:
- The class must have a
subcommands
attribute, which is a list of (name, subcommand_class) tuples. The subcommand_class must meet the requirements for a subcommand.
If it is a subcommand that is executed:
- The constructor must take a single argument, an argparse.ArgumentParser. The object may register any arguments or subparsers that it needs.
- The
run
function is called when the subcommand is used by the user. The arguments to this function are passed in by name, and the names can be any of the options that the subcommand registered. There are two other special argument names:options
- if specified, this is the Namespace returned by parse_argsrobot_class
- if specified, the user's robot.py will be loaded and it will be inspected for their robot class, which will be passed in as this optionmain_file
- if specified, the name of the user's robot.py file. This is not guaranteed to exist unless robot_class is also an option.project_path
- if specified, the name of the directory that contains the user's robot.py file. This is not guaranteed to exist unless robot_class is also an option.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file robotpy-cli-2024.0.0.tar.gz
.
File metadata
- Download URL: robotpy-cli-2024.0.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6519f06856eb0a7ef5f25a57bfc8dcb20635cef84706fb37c0b602d59e33f39 |
|
MD5 | 7c27ea30bffd37cc2d396a011cfb0984 |
|
BLAKE2b-256 | 055bc4a0fa243bdf1ea4ab617cdbd396c4505d99c2a686328b99174146fba356 |
File details
Details for the file robotpy_cli-2024.0.0-py3-none-any.whl
.
File metadata
- Download URL: robotpy_cli-2024.0.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9284035fa67058b33593b1846e13501eda0861fb9d9adce4bd01b101c9f1f26e |
|
MD5 | db4cac230b491265486eb7e1c204ad3e |
|
BLAKE2b-256 | 261ff9111df56aabd0a262983c7b1f9b60ec5dbbe2a755ec786c264279e2ee92 |