8000 Replace format() with old-style % operator to support 2.5 · Twilio-api/twilio-python@72143b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 72143b4

Browse files
committed
Replace format() with old-style % operator to support 2.5
1 parent d2a0504 commit 72143b4

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

twilio/rest/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ def participants(self, conference_sid):
113113
Return a :class:`~twilio.rest.resources.Participants` instance for the
114114
:class:`~twilio.rest.resources.Conference` with the given conference_sid
115115
"""
116-
base_uri = "{}/Conferences/{}".format(self.account_uri, conference_sid)
116+
base_uri = "%s/Conferences/%s" % (self.account_uri, conference_sid)
117117
return Participants(base_uri, self.auth, self.timeout)
118118

119119
def members(self, queue_sid):
120120
"""
121121
Return a :class:`Members <twilio.rest.resources.Members>` instance for
122122
the :class:`Queue <twilio.rest.resources.Queue>` with the given queue_sid
123123
"""
124-
base_uri = "{}/Queues/{}".format(self.account_uri, queue_sid)
124+
base_uri = "%s/Queues/%s" % (self.account_uri, queue_sid)
125125
return Members(base_uri, self.auth, self.timeout)
126126

127127

twilio/rest/resources/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def delete_instance(self):
244244
return self.parent.delete(self.name)
245245

246246
def __str__(self):
247-
return "<{0} {1}>".format(self.__class__.__name__, self.name[0:5])
247+
return "<%s %s>" % (self.__class__.__name__, self.name[0:5])
248248

249249

250250
class ListResource(Resource):
@@ -401,8 +401,8 @@ def load_instance(self, data):
401401
return instance
402402

403403
def __str__(self):
404-
return '<{} ({})>'.format(self.__class__.__name__, self.count())
405-
return '<{0} ({1})>'.format(self.__class__.__name__, self.count())
404+
return '<%s (%s)>' % (self.__class__.__name__, self.count())
405+
return '<%s (%s)>' % (self.__class__.__name__, self.count())
406406

407407
def list(self, **kw):
408408
"""Query the list resource for a list of InstanceResources.

twilio/rest/resources/sip/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ def ip_access_control_list_mappings(self, domain_sid):
2929
Return a :class:`IpAccessControlListMappings` instance for the :class:`Domain`
3030
with the given domain_sid
3131
"""
32-
base_uri = "{}/Domains/{}".format(self.uri, domain_sid)
32+
base_uri = "%s/Domains/%s" % (self.uri, domain_sid)
3333
return IpAccessControlListMappings(base_uri, self.auth, self.timeout)
3434

3535
def credential_list_mappings(self, domain_sid):
3636
"""
3737
Return a :class:`CredentialListMappings` instance for the :class:`Domain`
3838
with the given domain_sid
3939
"""
40-
base_uri = "{}/Domains/{}".format(self.uri, domain_sid)
40+
base_uri = "%s/Domains/%s" % (self.uri, domain_sid)
4141
return CredentialListMappings(base_uri, self.auth, self.timeout)
4242

4343
def ip_addresses(self, ip_access_control_list_sid):
4444
"""
4545
Return a :class:`IpAddresses` instance for the
4646
:class:`IpAccessControlList` with the given ip_access_control_list_sid
4747
"""
48-
base_uri = "{}/IpAccessControlLists/{}".format(
48+
base_uri = "%s/IpAccessControlLists/%s" % (
4949
self.uri,
5050
ip_access_control_list_sid,
5151
)
@@ -56,7 +56,7 @@ def credentials(self, credential_list_sid):
5656
Return a :class:`Credentials` instance for the
5757
:class:`CredentialList` with the given credential_list_sid
5858
"""
59-
base_uri = "{}/CredentialLists/{}".format(
59+
base_uri = "%s/CredentialLists/%s" % (
6060
self.uri,
6161
credential_list_sid,
6262
)

0 commit comments

Comments
 (0)
0