Beispiel #1
0
 def __init__(self,
              name: str,
              include: list = None,
              exclude: list = None,
              file: str = None,
              values: dict = None,
              allow_unknown: bool = True):
     self.name = name
     self.file = file
     self.values = from_file(file, {}, silent=True) if file else na(
         values, {})
     self.definitions = OrganizedList(__flags__.default_var_definitions(),
                                      _key="name").filter(
                                          None, include,
                                          exclude)  # type: OrganizedList
Beispiel #2
0
 def reset(cls):
     cls.definitions = OrganizedList(__flags__.default_var_definitions(),
                                     _key="name").as_dict
     cls.layers = OrganizedList([
         CfgLayer(
             name="user_advaced",
             exclude=["clusters-in-local", "image-list", "resource-specs"]),
         CfgLayer(
             name="user_basic",
             exclude=["clusters-in-local", "image-list", "resource-specs"]),
         CfgLayer(name="local_default",
                  exclude=[],
                  file=__flags__.get_default_file(is_global=False)),
         CfgLayer(name="global_default",
                  exclude=[],
                  file=__flags__.get_default_file(is_global=True))
     ],
                                _key="name",
                                _getter=getattr)
Beispiel #3
0
 def print_supported_items(cls):
     headers = ['name', 'default', 'help']
     return to_screen([[x.get(k, None) for k in headers]
                       for x in __flags__.default_var_definitions()],
                      _type="table",
                      headers=headers)