How to use the lookatme.schemas.MetaSchema function in lookatme

To help you get started, we’ve selected a few lookatme examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github d0c-s4vage / lookatme / lookatme / parser.py View on Github external
yaml_data.append(line)
                continue

            # there was no ----* marker
            if not found_first and stripped_line != "":
                break

        if not found_first:
            return input_data, MetaSchema().load({})
        
        new_input = input_data[skipped_chars:]
        if len(yaml_data) == 0:
            return new_input, MetaSchema().load({})

        yaml_data = "\n".join(yaml_data)
        data = MetaSchema().loads(yaml_data)
        return new_input, data
github d0c-s4vage / lookatme / lookatme / parser.py View on Github external
if not found_first:
                    found_first = True
                # found the second one
                else:
                    break

            if found_first and not is_marker:
                yaml_data.append(line)
                continue

            # there was no ----* marker
            if not found_first and stripped_line != "":
                break

        if not found_first:
            return input_data, MetaSchema().load({})
        
        new_input = input_data[skipped_chars:]
        if len(yaml_data) == 0:
            return new_input, MetaSchema().load({})

        yaml_data = "\n".join(yaml_data)
        data = MetaSchema().loads(yaml_data)
        return new_input, data