diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-24 23:31:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-24 23:36:16 +0400 |
commit | a15be343895d4f3481eb349b4d145ffbe1c10dce (patch) | |
tree | a49eb487e061df8e8378eeb3b2318c4d084babc2 /source | |
parent | 16443b1ae0f79e853ce13f17a3513a12c5cd8883 (diff) |
Code cleanup: unused python vars & imports
Use frosted rather then pyflakes
Diffstat (limited to 'source')
-rwxr-xr-x | source/blender/datatoc/datatoc_icon_split.py | 3 | ||||
-rw-r--r-- | source/tests/bl_rna_wiki_reference.py | 4 | ||||
-rw-r--r-- | source/tests/pep8.py | 13 | ||||
-rw-r--r-- | source/tests/rst_to_doctree_mini.py | 1 |
4 files changed, 10 insertions, 11 deletions
diff --git a/source/blender/datatoc/datatoc_icon_split.py b/source/blender/datatoc/datatoc_icon_split.py index 44d8e5fd0fb..55f0a5c5f6a 100755 --- a/source/blender/datatoc/datatoc_icon_split.py +++ b/source/blender/datatoc/datatoc_icon_split.py @@ -164,7 +164,6 @@ def dice(filepath, output, output_prefix, name_style, minx_icon, miny_icon, maxx_icon, maxy_icon, spacex_icon, spacey_icon, ): - import struct is_simple = (max(minx, miny, maxx, maxy, minx_icon, miny_icon, maxx_icon, maxy_icon, @@ -209,7 +208,7 @@ def dice(filepath, output, output_prefix, name_style, # simple, no margins if is_simple: - sub_x = x * icon_x + sub_x = x * icon_w sub_y = y * icon_h else: sub_x = minx + ((x * (icon_w + spacex_icon)) + minx_icon) diff --git a/source/tests/bl_rna_wiki_reference.py b/source/tests/bl_rna_wiki_reference.py index c394107d8d1..d7ca80a14bd 100644 --- a/source/tests/bl_rna_wiki_reference.py +++ b/source/tests/bl_rna_wiki_reference.py @@ -96,7 +96,7 @@ def test_urls(): import rna_wiki_reference import urllib.error - from urllib.request import urlopen + from urllib.request import urlopen prefix = rna_wiki_reference.url_manual_prefix urls = {suffix for (rna_id, suffix) in rna_wiki_reference.url_manual_mapping} @@ -118,7 +118,7 @@ def test_urls(): print(" %s ... " % url_full, end="") sys.stdout.flush() try: - urllib.request.urlopen(url_full) + urlopen(url_full) print(color_green + "OK" + color_normal) except urllib.error.HTTPError: print(color_red + "FAIL!" + color_normal) diff --git a/source/tests/pep8.py b/source/tests/pep8.py index 235bca48104..cca49d54ac0 100644 --- a/source/tests/pep8.py +++ b/source/tests/pep8.py @@ -20,15 +20,16 @@ import os -# depends on pep8, pyflakes, pylint +# depends on pep8, frosted, pylint # for Ubuntu # -# sudo apt-get install pylint pyflakes +# sudo apt-get install pylint # # sudo apt-get install python-setuptools python-pip # sudo pip install pep8 +# sudo pip install frosted # -# in Debian install pylint pyflakes pep8 with apt-get/aptitude/etc +# in Debian install pylint pep8 with apt-get/aptitude/etc # # on *nix run # python source/tests/pep8.py > test_pep8.log 2>&1 @@ -118,10 +119,10 @@ def main(): os.system("pep8 --repeat --ignore=%s '%s'" % (",".join(ignore_tmp), f)) - # pyflakes - print("\n\n\n# running pyflakes...") + # frosted + print("\n\n\n# running frosted...") for f, pep8_type in files: - os.system("pyflakes '%s'" % f) + os.system("frosted '%s'" % f) print("\n\n\n# running pylint...") for f, pep8_type in files: diff --git a/source/tests/rst_to_doctree_mini.py b/source/tests/rst_to_doctree_mini.py index cb7b0291296..6a885a108f8 100644 --- a/source/tests/rst_to_doctree_mini.py +++ b/source/tests/rst_to_doctree_mini.py @@ -50,7 +50,6 @@ def parse_rst_py(filepath): indent_map = {} indent_prev = 0 f = open(filepath, encoding="utf-8") - indent_lists = [] for i, line in enumerate(f): line_strip = line.lstrip() # ^\.\.\s[a-zA-Z09\-]+::.*$ |