コード例 #1
0
 class MyConfig(_ConfigBase):
     millisecond = _ConfigValue("MS",
                                type=int,
                                validators=[duration_validator])
     second = _ConfigValue("S", type=int, validators=[duration_validator])
     minute = _ConfigValue("M", type=int, validators=[duration_validator])
     wrong_pattern = _ConfigValue("WRONG_PATTERN",
                                  type=int,
                                  validators=[duration_validator])
コード例 #2
0
ファイル: tests.py プロジェクト: stj/apm-agent-python
 class MyConfig(_ConfigBase):
     foo = _ConfigValue("foo", callbacks=[set_global])
コード例 #3
0
ファイル: tests.py プロジェクト: stj/apm-agent-python
 class MyConfig(_ConfigBase):
     this_one_is_required = _ConfigValue("this_one_is_required",
                                         type=int,
                                         required=True)
     this_one_isnt = _ConfigValue("this_one_isnt", type=int, required=False)
コード例 #4
0
ファイル: tests.py プロジェクト: stj/apm-agent-python
 class MyConfig(_ConfigBase):
     an_int = _ConfigValue("anint", type=int)
コード例 #5
0
ファイル: tests.py プロジェクト: stj/apm-agent-python
 class MyConfig(_ConfigBase):
     chained = _ConfigValue("CHAIN",
                            validators=[
                                lambda val, field: val.upper(),
                                lambda val, field: val * 2
                            ])
コード例 #6
0
ファイル: tests.py プロジェクト: stj/apm-agent-python
 class MyConfig(_ConfigBase):
     sample_rate = _ConfigValue("SR",
                                type=float,
                                validators=[PrecisionValidator(4, 0.0001)])
コード例 #7
0
ファイル: tests.py プロジェクト: stj/apm-agent-python
 class MyConfig(_ConfigBase):
     my_regex = _ConfigValue("MY_REGEX",
                             validators=[RegexValidator(r"\d+")])
コード例 #8
0
ファイル: tests.py プロジェクト: yolcu360/apm-agent-python
 class MyConfig(_ConfigBase):
     foo = _ConfigValue("foo",
                        callbacks=[set_global],
                        callbacks_on_default=False,
                        default="foobar")
コード例 #9
0
 class MyConfig(_ConfigBase):
     foo = _ConfigValue("foo")
     bar = _ConfigValue("bar")
コード例 #10
0
ファイル: tests.py プロジェクト: mdelapenya/apm-agent-python
 class MyConfig(_ConfigBase):
     byte = _ConfigValue("BYTE", type=int, validators=[size_validator])
     kbyte = _ConfigValue("KBYTE", type=int, validators=[size_validator])
     mbyte = _ConfigValue("MBYTE", type=int, validators=[size_validator])
     gbyte = _ConfigValue("GBYTE", type=int, validators=[size_validator])
     wrong_pattern = _ConfigValue("WRONG_PATTERN", type=int, validators=[size_validator])