@ -42,8 +42,8 @@ class FormDefinition(object):
for field in fields:
for prop_name in required:
if not prop_name in field:
raise KeyError("Missing required property '{}' for field "
"'{}'".format(prop_name, str(field)))
raise KeyError("Missing required property '{0}' for field "
"'{1}'".format(prop_name, str(field)))
def get_field_def(self, field_name):
"""
@ -24,7 +24,7 @@ HTML_FIELD_CHECKBOX = u'''
</li>
'''
HTML_REQUIRED = u'{} <abbr title="This field is required" \
HTML_REQUIRED = u'{0} <abbr title="This field is required" \
u"class="required">•</span>'
@ -237,7 +237,7 @@ def main(): # pragma: no cover
sys.exit(0)
except socket.error as err:
log.exception(err)
sys.stderr.write("Cannot bind to port {}: {}\n".format(
sys.stderr.write("Cannot bind to port {0}: {1}\n".format(
options.port,
str(err)
))
@ -104,8 +104,8 @@ class RequestHandler(BaseHTTPRequestHandler):
for header_k, header_v in err.headers.items():
self.send_header(header_k, header_v)
self.end_headers()
self.wfile.write("Error {}: {}".format(err.status_code,
err.msg))
self.wfile.write("Error {0}: {1}".format(err.status_code,
self.wfile.flush()
return False
except Exception as err: