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-07 16:06:10 -08:00
parent 435294e004
commit 713cf347da

View file

@ -159,7 +159,7 @@ class Twython(object):
# Go through and replace any mustaches that are in our API url.
fn = api_table[api_call]
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.
base_url + fn['url']
)