Standardize string formatting to use .format instead of concat

This commit is contained in:
labrys 2016-06-06 05:45:42 -04:00 committed by Labrys
commit 2ad9f2e35f
18 changed files with 259 additions and 239 deletions

View file

@ -38,7 +38,7 @@ class MultiPartForm(object):
# Once the list is built, return a string where each
# line is separated by '\r\n'.
parts = []
part_boundary = '--' + self.boundary
part_boundary = '--{boundary}'.format(boundary=self.boundary)
# Add the form fields
parts.extend(
@ -64,6 +64,6 @@ class MultiPartForm(object):
# Flatten the list and add closing boundary marker,
# then return CR+LF separated data
flattened = list(itertools.chain(*parts))
flattened.append('--' + self.boundary + '--')
flattened.append('--{boundary}--'.format(boundary=self.boundary))
flattened.append('')
return '\r\n'.join(flattened)