From 3a0c35372db43674146dd82ad0f4cc70932a6c03 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 6 Sep 2012 13:25:57 +0200 Subject: [PATCH] convert some left over readUrls to read_url --- ox/cache.py | 2 +- ox/net.py | 2 +- ox/oembed.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ox/cache.py b/ox/cache.py index 7431fd3..677568c 100644 --- a/ox/cache.py +++ b/ox/cache.py @@ -112,7 +112,7 @@ def save_url(url, filename, overwrite=False): dirname = os.path.dirname(filename) if not os.path.exists(dirname): os.makedirs(dirname) - data = readUrl(url) + data = read_url(url) f = open(filename, 'w') f.write(data) f.close() diff --git a/ox/net.py b/ox/net.py index 940350f..51b5318 100644 --- a/ox/net.py +++ b/ox/net.py @@ -87,7 +87,7 @@ def save_url(url, filename, overwrite=False): dirname = os.path.dirname(filename) if not os.path.exists(dirname): os.makedirs(dirname) - data = readUrl(url) + data = read_url(url) f = open(filename, 'w') f.write(data) f.close() diff --git a/ox/oembed.py b/ox/oembed.py index be0eba0..5bdcbd9 100644 --- a/ox/oembed.py +++ b/ox/oembed.py @@ -9,7 +9,7 @@ def get_embed_code(url, maxwidth=None, maxheight=None): embed = {} header = cache.get_headers(url) if header.get('content-type', '').startswith('text/html'): - html = cache.readUrl(url) + html = cache.read_url(url) json_oembed = filter(lambda l: 'json+oembed' in l, re.compile('').findall(html)) xml_oembed = filter(lambda l: 'xml+oembed' in l, re.compile('').findall(html)) if json_oembed: @@ -18,14 +18,14 @@ def get_embed_code(url, maxwidth=None, maxheight=None): oembed_url += '&maxwidth=%d' % maxwidth if maxheight: oembed_url += '&maxheight=%d' % maxheight - embed = json.loads(cache.readUrl(oembed_url)) + embed = json.loads(cache.read_url(oembed_url)) elif xml_oembed: oembed_url = find_re(json_oembed[0], 'href="(.*?)"') if maxwidth: oembed_url += '&maxwidth=%d' % maxwidth if maxheight: oembed_url += '&maxheight=%d' % maxheight - data = cache.readUrl(oembed_url) + data = cache.read_url(oembed_url) for e in ET.fromstring(data): embed[e.tag] = e.text return embed