click_types package¶
Python package that provides custom click types.
Submodules¶
click_types.ansible module¶
click_types.coding module¶
Module for custom click types regarding to development.
- class click_types.coding.SemVerParamType[source]¶
Bases:
click.types.ParamType
Provide a custom click type for semantic versions.
This custom click type provides validity checks for semantic versions.
- convert(value, param, ctx)[source]¶
Converts the value from string into semver type.
This method takes a string and check if this string belongs to semantic verstion definition. If the test is passed the value will be returned. If not a error message will be prompted.
- Parameters
value (str) – the value passed
param (str) – the parameter that we declared
ctx (str) – context of the command
- Returns
the passed value as a checked semver
- Return type
str
- name: str = 'semver'¶
the descriptive name of this type
click_types.net module¶
Module for custom click types regarding to network.
- class click_types.net.CIDRParamType[source]¶
Bases:
click.types.ParamType
Provide a custom click type for network cidr handling.
This custom click type provides validity check for network cidrs. Both ip version (v4 and v6) are supported.
- convert(value, param, ctx)[source]¶
Converts the value from string into cidr type.
This method takes a string and check if this string belongs to ipv4 or ipv6 cidr definition. If the test is passed the value will be returned. If not a error message will be prompted.
- Parameters
value (str) – the value passed
param (str) – the parameter that we declared
ctx (str) – context of the command
- Returns
the passed value as a checked cidr
- Return type
int
- name: str = 'cidr'¶
the descriptive name of this type
- class click_types.net.VlanIDParamType[source]¶
Bases:
click.types.ParamType
Provide a custom click type for vlan id handling.
This custom click type provides validity checks for vlan ids according to IEEE 802.1Q standard.
- convert(value, param, ctx)[source]¶
Converts the value from string into semver type.
This method tages a string and check if this string belongs to semantic verstion definition. If the test is passed the value will be returned. If not a error message will be prompted.
- Parameters
value (str) – the value passed
param (str) – the parameter that we declared
ctx (str) – context of the command
- Returns
the passed value as a checked vlan id
- Return type
int
- name: str = 'vlanid'¶
the descriptive name of this type