Пример #1
0
    def from_url(cls, url):
        from six.moves.urllib.request import urlopen

        json_data = urlopen(url).read()
        generator = SchemaGenerator.from_json(json_data)

        return cls(generator)
Пример #2
0
    def from_url(cls, url, auth=None):

        json_data = Recorder.open_with_basic_auth(
            url).read() if auth else request.urlopen(url).read()
        generator = SchemaGenerator.from_json(json_data.decode('utf-8'))

        return cls(generator)
Пример #3
0
    def from_url(cls, url):
        from urllib.request import urlopen

        json_data = urlopen(url).read()
        generator = SchemaGenerator.from_json(json_data)

        return cls(generator)
Пример #4
0
    def from_url(cls, url):
        from urllib2 import urlopen

        json_data = urlopen(url).read()
        generator = SchemaGenerator.from_json(json_data)

        return cls(generator)
Пример #5
0
    def from_file(cls, path):
        with open(path, 'rb') as f:
            json_data = f.read()
        generator = SchemaGenerator.from_json(json_data)

        return cls(generator)
    def from_file(cls, path):
        with open(path, 'rb') as f:
            json_data = f.read()
        generator = SchemaGenerator.from_json(json_data)

        return cls(generator)