Option Construct Package (opt_construct)
Package for construct options of Messaging Clients or Ansible based on prefix and input data.
Build/Test Status
Description
This package provides an API for create appropriate option for command to execute in your application. API is called by one of several classes, which each of them handle different type of option.
Example
Exmaple of Toggle class:
data = {'help':True}
obj = Toggle('help','--help')
opt = obj.generate(data)
print(opt)
-> ['--help']
In current version there are these classes:
- Toggle - Create option only from prefix.
- Dummy - Only placeholder for specific values.
- Argument - Create option only from value.
- Prefixed - Create option with prefix and input value.
- BasicComposed - Composing multiple value into one option. You must override generate method for your own use.
- KWOption - Parse a dictionary into multiple appearance of one option with prefix and value.
- ListOption - Parse a list into multiple appearance of one option with prefix and value.
Requirements
Python >= 3.5
Install & Run
Not yet uploaded to pypi.
Tests
Requirements
How to run tests
$ python -m pytest tests/
License
Apache 2.0
Author Information
Messaging QE team @ redhat.com