From e5dbebe5eb9de752560e67275b77543740edcaae Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Mon, 3 Jul 2017 14:55:54 +0200 Subject: [PATCH] fix some of the issues reported by codacity --- tools/build-addon-index.py | 6 +++--- tools/font-add-border.py | 2 +- tools/font-generator.py | 2 +- tools/levelconverter-0.0.6_0.0.7.py | 6 +++--- tools/upload_supertux_wiki.sh | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/build-addon-index.py b/tools/build-addon-index.py index 58620fcba32..f33d1ae791d 100755 --- a/tools/build-addon-index.py +++ b/tools/build-addon-index.py @@ -27,11 +27,11 @@ import sexpr -def escape_str(str): - return "\"%s\"" % str.replace("\"", "\\\"") +def escape_str(string): + return "\"%s\"" % string.replace("\"", "\\\"") -class Addon: +class Addon(object): def __init__(self, filename): lst = sexpr.parse(filename) if lst[0][0] != "supertux-addoninfo": diff --git a/tools/font-add-border.py b/tools/font-add-border.py index 1d0da0e73f2..a9e0b449651 100755 --- a/tools/font-add-border.py +++ b/tools/font-add-border.py @@ -25,7 +25,7 @@ def fix_font_file(filename, glyph_width, glyph_height): print("Processing %s %dx%d" % (filename, glyph_width, glyph_height)) img = Image.open(filename) w, h = img.size - + assert w % glyph_width == 0, "image not multiple of glyph width" assert h % glyph_height == 0, "image not multiple of glyph height" diff --git a/tools/font-generator.py b/tools/font-generator.py index ea95e38868e..789a9a725f8 100755 --- a/tools/font-generator.py +++ b/tools/font-generator.py @@ -24,7 +24,7 @@ import math import re -class FontGenerator: +class FontGenerator(object): def __init__(self): self.font_size = 24 diff --git a/tools/levelconverter-0.0.6_0.0.7.py b/tools/levelconverter-0.0.6_0.0.7.py index c130298ecad..dceb99bd46a 100755 --- a/tools/levelconverter-0.0.6_0.0.7.py +++ b/tools/levelconverter-0.0.6_0.0.7.py @@ -23,17 +23,17 @@ ['d', "cloud-00.png", 90], ['e', "cloud-00.png", 91], ['f', "cloud-00.png", 92], - + ['G', "bkgd-00.png", 93], ['H', "bkgd-01.png", 94], ['I', "bkgd-02.png", 95], ['J', "bkgd-03.png", 96], - + ['g', "bkgd-10.png", 97], ['h', "bkgd-11.png", 98], ['i', "bkgd-12.png", 99], ['j', "bkgd-13.png", 100], - + ['#', "solid0.png", 11], ['[', "solid1.png", 13], ['=', "solid2.png", 14], diff --git a/tools/upload_supertux_wiki.sh b/tools/upload_supertux_wiki.sh index b7e5f38f75e..26c3c0ad2b3 100755 --- a/tools/upload_supertux_wiki.sh +++ b/tools/upload_supertux_wiki.sh @@ -66,9 +66,9 @@ fi # MD5SUM=`md5sum "$1" | cut -c "1-32"` # echo "MD5Sum: $MD5SUM" -STEP1_FILE="`tempfile`" -STEP2_FILE="`tempfile`" -COOKIES_FILE="`tempfile`" +STEP1_FILE="$(tempfile)" +STEP2_FILE="$(tempfile)" +COOKIES_FILE="$(tempfile)" curl \ -c "$COOKIES_FILE" \