From f15bdce90e39686202d1c27143cbcf4be1baacea Mon Sep 17 00:00:00 2001 From: rht Date: Wed, 27 Sep 2017 23:32:06 +0200 Subject: [PATCH] tools: Remove print_function. Tweaked by tabbott to exclude the linter libraries. --- tools/check-capitalization | 1 - tools/check-css | 1 - tools/check-frontend-i18n | 1 - tools/check-issue-labels | 1 - tools/check-provision | 1 - tools/check-templates | 1 - tools/check-urls | 1 - tools/compile-handlebars-templates | 1 - tools/create-test-api-docs | 1 - tools/diagnose | 1 - .../documentation_crawler/spiders/check_documentation.py | 1 - .../documentation_crawler/spiders/check_help_documentation.py | 1 - .../documentation_crawler/spiders/common/spiders.py | 1 - tools/find-add-class | 1 - tools/get-handlebar-vars | 1 - tools/html-grep | 1 - tools/js-dep-visualizer.py | 1 - tools/lib/api_tests.py | 1 - tools/lib/css_parser.py | 1 - tools/lib/find_add_class.py | 1 - tools/lib/graph.py | 1 - tools/lib/html_branches.py | 2 -- tools/lib/html_grep.py | 1 - tools/lib/pretty_print.py | 1 - tools/lib/provision.py | 1 - tools/lib/sanity_check.py | 1 - tools/lib/template_parser.py | 1 - tools/lib/test_script.py | 2 -- tools/lib/test_server.py | 1 - tools/minify-js | 1 - tools/pretty-print-html | 1 - tools/renumber-migrations | 1 - tools/replace-tarball-shebang | 1 - tools/review | 1 - tools/run-dev.py | 1 - tools/run-mypy | 1 - tools/show-profile-results.py | 1 - tools/stop_run_dev | 1 - tools/test-api | 1 - tools/test-backend | 1 - tools/test-help-documentation.py | 1 - tools/test-js-with-node | 1 - tools/test-queue-worker-reload | 1 - tools/test-run-dev | 1 - tools/test-tools | 1 - tools/tests/test_css_parser.py | 1 - tools/tests/test_html_branches.py | 1 - tools/tests/test_pretty_print.py | 2 -- tools/tests/test_template_parser.py | 2 -- tools/update-authors-json | 1 - tools/zulip-export/zulip-export | 1 - 51 files changed, 55 deletions(-) diff --git a/tools/check-capitalization b/tools/check-capitalization index d22e0870f7..504837aa4f 100755 --- a/tools/check-capitalization +++ b/tools/check-capitalization @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function # check for the venv from lib import sanity_check diff --git a/tools/check-css b/tools/check-css index b1126e25f1..b453ca75d1 100755 --- a/tools/check-css +++ b/tools/check-css @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function from lib.css_parser import parse, CssParserException from typing import Iterable, Text import sys diff --git a/tools/check-frontend-i18n b/tools/check-frontend-i18n index b5f548526d..acf3a4d174 100755 --- a/tools/check-frontend-i18n +++ b/tools/check-frontend-i18n @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function from typing import List, Text # check for the venv diff --git a/tools/check-issue-labels b/tools/check-issue-labels index d62f0857f8..488135d933 100755 --- a/tools/check-issue-labels +++ b/tools/check-issue-labels @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import requests import re diff --git a/tools/check-provision b/tools/check-provision index cfce02eee3..7bab196cbd 100755 --- a/tools/check-provision +++ b/tools/check-provision @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import optparse diff --git a/tools/check-templates b/tools/check-templates index de285dd98f..1a5cc78c27 100755 --- a/tools/check-templates +++ b/tools/check-templates @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function from lib.template_parser import validate from lib.html_branches import build_id_dict from lib.pretty_print import validate_indent_html diff --git a/tools/check-urls b/tools/check-urls index c796c63271..9625651e5c 100755 --- a/tools/check-urls +++ b/tools/check-urls @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import re import sys diff --git a/tools/compile-handlebars-templates b/tools/compile-handlebars-templates index 1039d29e39..27ba19d7d0 100755 --- a/tools/compile-handlebars-templates +++ b/tools/compile-handlebars-templates @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import glob diff --git a/tools/create-test-api-docs b/tools/create-test-api-docs index 2e9c72dd4c..b37827812f 100755 --- a/tools/create-test-api-docs +++ b/tools/create-test-api-docs @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function # check for the venv from lib import sanity_check diff --git a/tools/diagnose b/tools/diagnose index 6b01e692df..520c9461c1 100755 --- a/tools/diagnose +++ b/tools/diagnose @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import platform import sys diff --git a/tools/documentation_crawler/documentation_crawler/spiders/check_documentation.py b/tools/documentation_crawler/documentation_crawler/spiders/check_documentation.py index 20040150d2..9f35beda96 100755 --- a/tools/documentation_crawler/documentation_crawler/spiders/check_documentation.py +++ b/tools/documentation_crawler/documentation_crawler/spiders/check_documentation.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import pathlib diff --git a/tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py b/tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py index 4e7cc32033..733732de37 100644 --- a/tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py +++ b/tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import os diff --git a/tools/documentation_crawler/documentation_crawler/spiders/common/spiders.py b/tools/documentation_crawler/documentation_crawler/spiders/common/spiders.py index 5e67433c6f..0b6390be31 100644 --- a/tools/documentation_crawler/documentation_crawler/spiders/common/spiders.py +++ b/tools/documentation_crawler/documentation_crawler/spiders/common/spiders.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import logging import re diff --git a/tools/find-add-class b/tools/find-add-class index dda68c76e4..b3943fd81c 100755 --- a/tools/find-add-class +++ b/tools/find-add-class @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function from lib.find_add_class import display, find import glob diff --git a/tools/get-handlebar-vars b/tools/get-handlebar-vars index c233d4a042..f7faefb236 100755 --- a/tools/get-handlebar-vars +++ b/tools/get-handlebar-vars @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import sys import re import json diff --git a/tools/html-grep b/tools/html-grep index a71180626a..e354c79eb3 100755 --- a/tools/html-grep +++ b/tools/html-grep @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function from lib.html_grep import grep import optparse import sys diff --git a/tools/js-dep-visualizer.py b/tools/js-dep-visualizer.py index 223be091fd..3fa477f5ad 100755 --- a/tools/js-dep-visualizer.py +++ b/tools/js-dep-visualizer.py @@ -4,7 +4,6 @@ $ ./tools/js-dep-visualizer.py $ dot -Tpng var/zulip-deps.dot -o var/zulip-deps.png """ -from __future__ import print_function import os import re diff --git a/tools/lib/api_tests.py b/tools/lib/api_tests.py index 94d075ae05..055af0d71f 100644 --- a/tools/lib/api_tests.py +++ b/tools/lib/api_tests.py @@ -1,4 +1,3 @@ -from __future__ import print_function if False: from typing import Any diff --git a/tools/lib/css_parser.py b/tools/lib/css_parser.py index e227f48c44..0d45d660ba 100644 --- a/tools/lib/css_parser.py +++ b/tools/lib/css_parser.py @@ -1,4 +1,3 @@ -from __future__ import print_function from six.moves import range from typing import Callable, List, Tuple, Union diff --git a/tools/lib/find_add_class.py b/tools/lib/find_add_class.py index 6160f9a591..34c6c8f2cb 100644 --- a/tools/lib/find_add_class.py +++ b/tools/lib/find_add_class.py @@ -1,4 +1,3 @@ -from __future__ import print_function from typing import List, Set, Tuple diff --git a/tools/lib/graph.py b/tools/lib/graph.py index 4589ffcee5..14eda523a6 100644 --- a/tools/lib/graph.py +++ b/tools/lib/graph.py @@ -1,4 +1,3 @@ -from __future__ import print_function from collections import defaultdict diff --git a/tools/lib/html_branches.py b/tools/lib/html_branches.py index f2e5e27030..9bc453e2c1 100644 --- a/tools/lib/html_branches.py +++ b/tools/lib/html_branches.py @@ -1,5 +1,3 @@ -from __future__ import print_function - from typing import Dict, List, Optional, Set import re diff --git a/tools/lib/html_grep.py b/tools/lib/html_grep.py index 89b228cc49..24314d8d15 100644 --- a/tools/lib/html_grep.py +++ b/tools/lib/html_grep.py @@ -1,4 +1,3 @@ -from __future__ import print_function from collections import defaultdict from six.moves import range from typing import Dict, List, Set diff --git a/tools/lib/pretty_print.py b/tools/lib/pretty_print.py index 8754a414b5..5e6837c416 100644 --- a/tools/lib/pretty_print.py +++ b/tools/lib/pretty_print.py @@ -1,4 +1,3 @@ -from __future__ import print_function from typing import Any, Dict, List diff --git a/tools/lib/provision.py b/tools/lib/provision.py index 56493f1a71..5fdfcdcf23 100755 --- a/tools/lib/provision.py +++ b/tools/lib/provision.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import sys import logging diff --git a/tools/lib/sanity_check.py b/tools/lib/sanity_check.py index 1d29251cf5..44054c8552 100644 --- a/tools/lib/sanity_check.py +++ b/tools/lib/sanity_check.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import pwd diff --git a/tools/lib/template_parser.py b/tools/lib/template_parser.py index f9bd6af83a..0705db812b 100644 --- a/tools/lib/template_parser.py +++ b/tools/lib/template_parser.py @@ -1,4 +1,3 @@ -from __future__ import print_function from typing import Callable, List, Optional from six.moves import range import re diff --git a/tools/lib/test_script.py b/tools/lib/test_script.py index 2c10225946..93fe308421 100644 --- a/tools/lib/test_script.py +++ b/tools/lib/test_script.py @@ -1,5 +1,3 @@ -from __future__ import print_function - from typing import Optional, Tuple import os diff --git a/tools/lib/test_server.py b/tools/lib/test_server.py index 2ec55e726d..ef630994d1 100644 --- a/tools/lib/test_server.py +++ b/tools/lib/test_server.py @@ -1,4 +1,3 @@ -from __future__ import print_function import os import subprocess diff --git a/tools/minify-js b/tools/minify-js index a7c1a30dbd..fba4da495a 100755 --- a/tools/minify-js +++ b/tools/minify-js @@ -2,7 +2,6 @@ # Minifies JavaScripts, creating source maps -from __future__ import print_function import os import subprocess diff --git a/tools/pretty-print-html b/tools/pretty-print-html index d5e03dacc6..cec35a5cde 100755 --- a/tools/pretty-print-html +++ b/tools/pretty-print-html @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function from typing import List from lib.pretty_print import pretty_print_html import sys diff --git a/tools/renumber-migrations b/tools/renumber-migrations index 656e691091..07fa27794c 100755 --- a/tools/renumber-migrations +++ b/tools/renumber-migrations @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function from six.moves import input, map, range import glob import os diff --git a/tools/replace-tarball-shebang b/tools/replace-tarball-shebang index ea6b77151e..bb450dfb78 100755 --- a/tools/replace-tarball-shebang +++ b/tools/replace-tarball-shebang @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import io import sys diff --git a/tools/review b/tools/review index d90ef3fabe..8201945647 100755 --- a/tools/review +++ b/tools/review @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import subprocess import sys diff --git a/tools/run-dev.py b/tools/run-dev.py index 202c3119f1..3ea0a43af9 100755 --- a/tools/run-dev.py +++ b/tools/run-dev.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import optparse import os diff --git a/tools/run-mypy b/tools/run-mypy index f0f69a3f26..cc09dd1bf2 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import sys diff --git a/tools/show-profile-results.py b/tools/show-profile-results.py index 39c9b5574d..ee07cbe678 100755 --- a/tools/show-profile-results.py +++ b/tools/show-profile-results.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import sys import pstats diff --git a/tools/stop_run_dev b/tools/stop_run_dev index 04b611f346..d218045df6 100755 --- a/tools/stop_run_dev +++ b/tools/stop_run_dev @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import signal diff --git a/tools/test-api b/tools/test-api index d0a6f02d53..251429afcc 100755 --- a/tools/test-api +++ b/tools/test-api @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import sys diff --git a/tools/test-backend b/tools/test-backend index d74ff73827..5b25df8dad 100755 --- a/tools/test-backend +++ b/tools/test-backend @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function from typing import List, Any import glob import optparse diff --git a/tools/test-help-documentation.py b/tools/test-help-documentation.py index d0774c5e2a..ec2299234c 100755 --- a/tools/test-help-documentation.py +++ b/tools/test-help-documentation.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import optparse import os import sys diff --git a/tools/test-js-with-node b/tools/test-js-with-node index daad0072da..e29dcd1311 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -from __future__ import print_function import optparse import os import subprocess diff --git a/tools/test-queue-worker-reload b/tools/test-queue-worker-reload index c34f994240..4109cb14f4 100755 --- a/tools/test-queue-worker-reload +++ b/tools/test-queue-worker-reload @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import sys diff --git a/tools/test-run-dev b/tools/test-run-dev index 9be9231901..34607f2148 100755 --- a/tools/test-run-dev +++ b/tools/test-run-dev @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import os import sys diff --git a/tools/test-tools b/tools/test-tools index 5fee5aad69..e7e3187ca8 100755 --- a/tools/test-tools +++ b/tools/test-tools @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from __future__ import print_function import argparse import os diff --git a/tools/tests/test_css_parser.py b/tools/tests/test_css_parser.py index 733940879a..c969b9b4f7 100644 --- a/tools/tests/test_css_parser.py +++ b/tools/tests/test_css_parser.py @@ -1,4 +1,3 @@ -from __future__ import print_function from typing import cast, Any diff --git a/tools/tests/test_html_branches.py b/tools/tests/test_html_branches.py index 8f4ec99139..069072de58 100644 --- a/tools/tests/test_html_branches.py +++ b/tools/tests/test_html_branches.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import os diff --git a/tools/tests/test_pretty_print.py b/tools/tests/test_pretty_print.py index 6217a55317..e69ef4dac1 100644 --- a/tools/tests/test_pretty_print.py +++ b/tools/tests/test_pretty_print.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import unittest from tools.lib.pretty_print import pretty_print_html diff --git a/tools/tests/test_template_parser.py b/tools/tests/test_template_parser.py index 34faeebfc9..a16fc387e8 100644 --- a/tools/tests/test_template_parser.py +++ b/tools/tests/test_template_parser.py @@ -1,5 +1,3 @@ -from __future__ import print_function - from typing import Optional, Any import sys diff --git a/tools/update-authors-json b/tools/update-authors-json index 12c656b41e..ee401dce42 100755 --- a/tools/update-authors-json +++ b/tools/update-authors-json @@ -4,7 +4,6 @@ Fetch contributors data from Github using their API, convert it to structured JSON data for the /about page authors section. """ - # check for the venv from lib import sanity_check sanity_check.check_venv(__file__) diff --git a/tools/zulip-export/zulip-export b/tools/zulip-export/zulip-export index dc1ab24246..5249ec16d1 100755 --- a/tools/zulip-export/zulip-export +++ b/tools/zulip-export/zulip-export @@ -21,7 +21,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -from __future__ import print_function import sys import os import optparse