From: yan11.meng Date: Wed, 11 Dec 2019 03:15:56 +0000 (+0800) Subject: Fix pylint error for python-snapdiff X-Git-Tag: accepted/tizen/devbase/services/20191223.073040^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d570f04876ce343682176f07c97bee08978626cc;p=services%2Fpython-snapdiff.git Fix pylint error for python-snapdiff Change-Id: I2e2c2f6254f8a5cf7997a356c7ad39e0312b1f23 Signed-off-by: yan11.meng --- diff --git a/snapdiff/__init__.py b/snapdiff/__init__.py index 6501d2e..f0b28e7 100644 --- a/snapdiff/__init__.py +++ b/snapdiff/__init__.py @@ -40,15 +40,15 @@ from .render import output_html from .repo import Repo def escape_html(s): - s = s.replace("&", "&"); - s = s.replace("<", "<"); - s = s.replace(">", ">"); - s = s.replace("'", "'"); - s = s.replace('"', """); + s = s.replace("&", "&") + s = s.replace("<", "<") + s = s.replace(">", ">") + s = s.replace("'", "'") + s = s.replace('"', """) return s def escape_html_newline(s): - s = s.replace('\n', "
"); + s = s.replace('\n', "
") return s def diff_to_json(old_url, new_url, **kwargs): @@ -488,9 +488,9 @@ def diff_to_csv(old_url, new_url, **kwargs): 'gitweb': data['gitweb'] } if style == 'repo': - return output_html('diff.csv', **context) # pylint: disable=W0142 + return output_html('diff.csv', **context) elif style == 'image': - return output_html('image_diff.csv', **context) # pylint: disable=W0142 + return output_html('image_diff.csv', **context) def diff_to_html(old_url, new_url, **kwargs): """Output diffs' html format. @@ -520,9 +520,9 @@ def diff_to_html(old_url, new_url, **kwargs): 'gitweb': data['gitweb'] } if style == 'repo': - return output_html('diff.html', **context) # pylint: disable=W0142 + return output_html('diff.html', **context) elif style == 'image': - return output_html('image_diff.html', **context) # pylint: disable=W0142 + return output_html('image_diff.html', **context) def diff_to_dist(old_url, new_url, dist_path, **kwargs): """Create a dist-dir of diffs, contains html and css. diff --git a/snapdiff/image.py b/snapdiff/image.py index e8ce79a..0219e75 100644 --- a/snapdiff/image.py +++ b/snapdiff/image.py @@ -32,8 +32,8 @@ def _get_file(url, suffix='.ks'): try: with open(only, 'rb') as _only: return only, _only.readlines() - except IOError, err: - print err + except IOError as err: + print( err) return '', '' diff --git a/snapdiff/utils.py b/snapdiff/utils.py index 1131925..33025e9 100644 --- a/snapdiff/utils.py +++ b/snapdiff/utils.py @@ -6,7 +6,7 @@ import xml.sax.handler def xml2obj(src): - # pylint: disable=C0301, C0111, R0903, R0912, W0212, C0103, W0231 + # pylint: disable=C0301, C0111, R0903, R0912, C0103 """ A simple function to converts XML data into native Python object, from http://goo.gl/Ymc6Nl, Licensed under the PSF License.