Some parameters that need substituting (e.g. addListMember) contain underscores. These weren't matched by the regex, so I've added an underscore to the character group. addListMember now works.

This commit is contained in:
Alexander Dutton 2011-01-08 08:06:10 +08:00 committed by Ryan McGrath
parent 435294e004
commit 90cba31922

View file

@ -159,7 +159,7 @@ class Twython(object):
# Go through and replace any mustaches that are in our API url. # Go through and replace any mustaches that are in our API url.
fn = api_table[api_call] fn = api_table[api_call]
base = re.sub( base = re.sub(
'\{\{(?P<m>[a-zA-Z]+)\}\}', '\{\{(?P<m>[a-zA-Z_]+)\}\}',
lambda m: "%s" % kwargs.get(m.group(1), '1'), # The '1' here catches the API version. Slightly hilarious. lambda m: "%s" % kwargs.get(m.group(1), '1'), # The '1' here catches the API version. Slightly hilarious.
base_url + fn['url'] base_url + fn['url']
) )