# HG changeset patch # User Bernhard Herzog # Date 1493399016 -7200 # Node ID 2200ae1e7bdbf3f735b7e78fcccdbaaa81cf9349 # Parent 607694092e2e43c27179a98822c67feb3817abb9 Rename html_error_code to http_error_code The new name is obviously what the parameter actually specifies. Not least because there is no such thing as an HTML error code. diff -r 607694092e2e -r 2200ae1e7bdb odfcast/convert.py --- a/odfcast/convert.py Thu May 26 21:21:18 2016 +0200 +++ b/odfcast/convert.py Fri Apr 28 19:03:36 2017 +0200 @@ -37,10 +37,10 @@ BAD_REQUEST_ERROR_CODE = 400 def __init__(self, title, error_code, details, - html_error_code=BAD_REQUEST_ERROR_CODE): + http_error_code=BAD_REQUEST_ERROR_CODE): data, mime_type = self.get_response_data(title, error_code, details) super(ErrorResponse, self).__init__(response=data, mimetype=mime_type, - status=html_error_code) + status=http_error_code) def json(self, title, error_code, details): return json.dumps({ @@ -82,7 +82,7 @@ def __init__(self, details, error_code=TEMPLATE_ERROR_CODE): super(TemplateErrorResponse, self).__init__( title="TemplateError", error_code=error_code, details=details, - html_error_code=500) + http_error_code=500) class ConversionErrorResponse(ErrorResponse): @@ -92,7 +92,7 @@ def __init__(self, details, error_code=CONVERSION_ERROR_CODE): super(ConversionErrorResponse, self).__init__( title="ConversionError", error_code=error_code, details=details, - html_error_code=500) + http_error_code=500) class MergeErrorResponse(ErrorResponse): @@ -102,7 +102,7 @@ def __init__(self, details, error_code=MERGE_ERROR_CODE): super(MergeErrorResponse, self).__init__( title="MergeError", error_code=error_code, details=details, - html_error_code=500) + http_error_code=500) class ConvertView(MethodView): @@ -125,14 +125,14 @@ return ErrorResponse( "Upload file missing", error_code=101, details="Please upload a file for conversion", - html_error_code=400) + http_error_code=400) fformat = request.form['format'] if not self.is_format_supported(fformat): return ErrorResponse( "Invalid format", error_code=102, details="Format %s not allowed" % fformat, - html_error_code=400) + http_error_code=400) datadict = self.get_datadict() @@ -252,7 +252,7 @@ return ErrorResponse( "Upload file missing", error_code=101, details="Please upload a file for conversion", - html_error_code=400) + http_error_code=400) with tempfile.TemporaryFile() as outfile: merger = PdfFileMerger(strict=False)