def config_path(self): import os cls = self.__class__ configfile_names = list( generate_configfile_names(cls.config_files, cls.config_searchpath)) config_param = Param(type=click.File("r")) config_file = config_param.parse(configfile_names[0]) return os.path.realpath(config_file.name)
class VCenterCategory(SectionSchema): type = Param(type=str) name = Param(type=str) name_format = Param(type=str) hostname_format = Param(type=str) datastore = Param(type=str) datastore_cluster = Param(type=str) network = Param(type=str) compute = Param(type=str) template = Param(type=str) folder = Param(type=str)
class Vcenter(SectionSchema): host = Param(type=str) port = Param(type=int) user = Param(type=str) pwd = Param(type=str) ssl = Param(type=bool) datacenter = Param(type=str) log = Param(type=click.Path()) log_format = Param(type=str) zfill = Param(type=bool)
def config_path(self): import os cls = self.__class__ config_param = Param(type=click.File('r')) configfile_names = list( generate_configfile_names(cls.config_files, cls.config_searchpath)) if configfile_names: for name in configfile_names: config_file = config_param.parse(name) path = os.path.realpath(config_file.name) else: path = os.getcwd() return path
class Memote(SectionSchema): """Describes the memote configuration keys and values.""" collect = Param(type=bool, default=True) git = Param(type=bool, default=True) addargs = Param(type=str, default="") model = Param(type=click.Path(exists=True, dir_okay=False)) directory = Param( type=click.Path(exists=True, file_okay=False, writable=True)) github_repository = Param(type=str) github_username = Param(type=str) exclusive = Param(type=str, multiple=True) skip = Param(type=str, multiple=True) solver = Param(type=click.Choice(["cplex", "glpk", "gurobi"]), default="glpk")
class Options(SectionSchema): interval = Param(type=click.IntRange(1, 300)) iterations = Param(type=int) retries = Param(type=bool) channel = Param(type=bool) ap_name = Param(type=bool) rx_packets = Param(type=bool) tx_packets = Param(type=bool) ping = Param(type=bool)
class Database(SectionSchema): db_name = Param(type=str) db_table = Param(type=str) db_address = Param(type=str) db_port = Param(type=str) db_user = Param(type=str) db_pass = Param(type=str) silent = Param(type=bool)
class General(SectionSchema): rsync_args = Param(type=str, default='-rlptDv') ignore_directories = Param(type=str, multiple=True, default=[]) fail_if_parse_error = Param(type=bool, default=False) check_mountpoints = Param(type=bool, default=True) threads = Param(type=int, default=4) log_to_es = Param(type=bool, default=False)
class Memote(SectionSchema): """Describes the memote configuration keys and values.""" collect = Param(type=bool, default=True) git = Param(type=bool, default=True) addargs = Param(type=str, default="") model = Param(type=click.Path(exists=True, dir_okay=False)) directory = Param( type=click.Path(exists=True, file_okay=False, writable=True)) github_repository = Param(type=str) github_username = Param(type=str)
def test_ctor__without_help_attribute(self): param = Param() assert param.help is None
def test_ctor__with_help_attribute(self): param = Param(help="Hello") assert param.help == "Hello"
def test_ctor__without_type_attribute_has_string_type(self): param = Param() assert isinstance(param.type, click.types.StringParamType)
class DNSZoneAvailable(SectionSchema): available = Param(type=str, multiple=True)
class Ubus(SectionSchema): host = Param(type=str) username = Param(type=str) password = Param(type=str)
class PygglCF(SectionSchema): period_per_day = Param(type=str)
class DevProperties(SectionSchema): vsdk_root = Param(type=str)
class General(SectionSchema): wlc_address = Param(type=str) client_address = Param(type=str)
class Hello(SectionSchema): name = Param(type=str)
class HelloMore(SectionSchema): numbers = Param(type=int, multiple=True)
class Hello(SectionSchema): name = Param(type=str) number = Param(type=int)
class Defaults(SectionSchema): config_version = Param(type=str)
class DNSZoneItems(SectionSchema): name = Param(type=str) server = Param(type=str) keyring_name = Param(type=str) keyring_value = Param(type=str)
class Default(SectionSchema): """Default configuration schema.""" api_key = Param(type=str)
class SNMP(SectionSchema): snmp_version = Param(type=click.Choice(['2c', '3']), default="2c") snmp_community = Param(type=str) snmp_user = Param(type=str) snmp_password = Param(type=str) snmp_encryption = Param(type=str)
class Default(SectionSchema): """Default configuration schema.""" api_host = Param(type=str) api_proxy = Param(type=str) api_user_agent = Param(type=str)
class SwarmCluster(SectionSchema): managers = Param(type=int) workers = Param(type=int)
class TogglCF(SectionSchema): User = Param(type=str) Email = Param(type=str) Project = Param(type=str) Tags = Param(type=str) Description = Param(type=str)
class Default(SectionSchema): rssi_off = Param(type=bool) snr_off = Param(type=bool) data_rate_off = Param(type=bool)
class DvpProperties(SectionSchema): engine = Param(type=str) user = Param(type=str) password = Param(type=str)
class DNS(SectionSchema): rtype = Param(type=str) ttl = Param(type=str)