# -*- encoding: utf-8 -*-
from __future__ import (unicode_literals, absolute_import,
                        division, print_function)
from oparlvalidator import validator

class Loader(object):
    def __init__(self, url, depth=None):
        self.visited = set()
        self.to_visit = set([url])

    def _load(self, source):
        return '{}'

    def validate(self, num_docs=None):
        while len(self.to_visit) > 0:
            url = self.to_visit.pop()
            if url not in self.visited:
                self.visited.add(url)
                content = self._load(url)
                doc = validator.OParlDocument(content)
                doc.validate()
        return True

add simple OParlDocument loader