コード例 #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
ファイル: recorder.py プロジェクト: Krot2bic/PyTFall
    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)
コード例 #6
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)