String formatting positional argument fix.

pull/7/head
Ferry Boender 9 years ago
parent 8be0dfa2bb
commit d12282c860
  1. 4
      src/formdefinition.py
  2. 2
      src/formrender.py
  3. 2
      src/scriptform.py
  4. 2
      src/webserver.py

@ -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,7 +104,7 @@ 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,
self.wfile.write("Error {0}: {1}".format(err.status_code,
err.msg))
self.wfile.flush()
return False

Loading…
Cancel
Save