コード例 #1
0
def show_resource_spec(resource_name):
    for subclass in Resource.__subclasses__():
        if resource_name == subclass.resource_name:
            print(json.dumps(subclass.spec, default=dumper, indent=4))
            return subclass.spec

    print("Resource {} not found. This is the list of available resources:".
          format(resource_name))
    list_spec_resources()
コード例 #2
0
ファイル: engine.py プロジェクト: tlovett/vvp-test-engine
def list_spec_resources():
    for subclass in Resource.__subclasses__():
        print(subclass.resource_name)
コード例 #3
0
ファイル: engine.py プロジェクト: tlovett/vvp-test-engine
def get_resource_subclass(subclass_name):
    for subclass in Resource.__subclasses__():
        if subclass.resource_name == subclass_name:
            return subclass

    return None