diff --git a/bin/CodeChecker.py b/bin/CodeChecker.py index f7413fbf63..9ae4202bc4 100755 --- a/bin/CodeChecker.py +++ b/bin/CodeChecker.py @@ -8,6 +8,8 @@ Main CodeChecker script. """ from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import json diff --git a/config_db_migrate/env.py b/config_db_migrate/env.py index 2df914cb6d..28d898c2ad 100644 --- a/config_db_migrate/env.py +++ b/config_db_migrate/env.py @@ -1,4 +1,7 @@ from __future__ import with_statement +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from alembic import context from sqlalchemy import engine_from_config, pool diff --git a/config_db_migrate/versions/150800b30447_share_sessions_through_the_database.py b/config_db_migrate/versions/150800b30447_share_sessions_through_the_database.py index f363ece0af..89b9288f77 100644 --- a/config_db_migrate/versions/150800b30447_share_sessions_through_the_database.py +++ b/config_db_migrate/versions/150800b30447_share_sessions_through_the_database.py @@ -5,6 +5,9 @@ Create Date: 2017-11-23 15:26:45.594141 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = '150800b30447' diff --git a/config_db_migrate/versions/4964142b58d2_authentication_session_tokens.py b/config_db_migrate/versions/4964142b58d2_authentication_session_tokens.py index bd7a5cd092..1d96ca65c7 100644 --- a/config_db_migrate/versions/4964142b58d2_authentication_session_tokens.py +++ b/config_db_migrate/versions/4964142b58d2_authentication_session_tokens.py @@ -5,6 +5,9 @@ Create Date: 2018-03-28 10:21:38.593302 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = '4964142b58d2' diff --git a/config_db_migrate/versions/6b9f832d0b20_add_user_name_and_group_to_session.py b/config_db_migrate/versions/6b9f832d0b20_add_user_name_and_group_to_session.py index 307d534844..6b3847329e 100644 --- a/config_db_migrate/versions/6b9f832d0b20_add_user_name_and_group_to_session.py +++ b/config_db_migrate/versions/6b9f832d0b20_add_user_name_and_group_to_session.py @@ -5,6 +5,9 @@ Create Date: 2018-03-13 10:44:38.446589 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = '6b9f832d0b20' diff --git a/config_db_migrate/versions/8268fc7ca7f4_initial_schema.py b/config_db_migrate/versions/8268fc7ca7f4_initial_schema.py index f8974c8c7c..6dff5769cb 100644 --- a/config_db_migrate/versions/8268fc7ca7f4_initial_schema.py +++ b/config_db_migrate/versions/8268fc7ca7f4_initial_schema.py @@ -5,6 +5,9 @@ Create Date: 2017-09-18 20:57:11.098460 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = '8268fc7ca7f4' diff --git a/config_db_migrate/versions/bb5278995f41_run_limitation_for_products.py b/config_db_migrate/versions/bb5278995f41_run_limitation_for_products.py index ae51a127f8..9552740a46 100644 --- a/config_db_migrate/versions/bb5278995f41_run_limitation_for_products.py +++ b/config_db_migrate/versions/bb5278995f41_run_limitation_for_products.py @@ -5,6 +5,9 @@ Create Date: 2018-03-01 15:38:41.164141 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = 'bb5278995f41' diff --git a/db_migrate/env.py b/db_migrate/env.py index 6befcd76b2..c77e77b18f 100644 --- a/db_migrate/env.py +++ b/db_migrate/env.py @@ -1,4 +1,7 @@ from __future__ import with_statement +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from alembic import context from sqlalchemy import engine_from_config, pool diff --git a/db_migrate/versions/080349e895d7_add_check_command_to_run_history.py b/db_migrate/versions/080349e895d7_add_check_command_to_run_history.py index b4e3ed3708..69fbb4e1e7 100644 --- a/db_migrate/versions/080349e895d7_add_check_command_to_run_history.py +++ b/db_migrate/versions/080349e895d7_add_check_command_to_run_history.py @@ -5,6 +5,9 @@ Create Date: 2018-03-12 15:10:24.652576 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = '080349e895d7' diff --git a/db_migrate/versions/101a9cb747de_add_bug_event_and_point_report_index.py b/db_migrate/versions/101a9cb747de_add_bug_event_and_point_report_index.py index c86aa5d2d3..1c069090ee 100644 --- a/db_migrate/versions/101a9cb747de_add_bug_event_and_point_report_index.py +++ b/db_migrate/versions/101a9cb747de_add_bug_event_and_point_report_index.py @@ -5,6 +5,9 @@ Create Date: 2018-02-15 15:30:59.966552 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = '101a9cb747de' diff --git a/db_migrate/versions/3793e361a752_source_components.py b/db_migrate/versions/3793e361a752_source_components.py index fca0b89023..c97fc56ff4 100644 --- a/db_migrate/versions/3793e361a752_source_components.py +++ b/db_migrate/versions/3793e361a752_source_components.py @@ -5,6 +5,9 @@ Create Date: 2018-04-20 09:29:24.072720 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = '3793e361a752' diff --git a/db_migrate/versions/4b38fa14c27b_file_id_index_for_reports.py b/db_migrate/versions/4b38fa14c27b_file_id_index_for_reports.py index d45824432e..502091d7fd 100644 --- a/db_migrate/versions/4b38fa14c27b_file_id_index_for_reports.py +++ b/db_migrate/versions/4b38fa14c27b_file_id_index_for_reports.py @@ -8,6 +8,9 @@ Add index for the file ids in the report table to speed up file cleanup. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = '4b38fa14c27b' diff --git a/db_migrate/versions/82ca43f05c10_initial_schema.py b/db_migrate/versions/82ca43f05c10_initial_schema.py index e9baa19390..ef7d2d46a9 100644 --- a/db_migrate/versions/82ca43f05c10_initial_schema.py +++ b/db_migrate/versions/82ca43f05c10_initial_schema.py @@ -5,6 +5,9 @@ Create Date: 2017-09-18 21:00:11.593693 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = '82ca43f05c10' diff --git a/db_migrate/versions/dd9c97ead24_share_the_locking_of_runs.py b/db_migrate/versions/dd9c97ead24_share_the_locking_of_runs.py index 19d7444720..ed67a57027 100644 --- a/db_migrate/versions/dd9c97ead24_share_the_locking_of_runs.py +++ b/db_migrate/versions/dd9c97ead24_share_the_locking_of_runs.py @@ -5,6 +5,9 @@ Create Date: 2017-11-17 15:44:07.810579 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # revision identifiers, used by Alembic. revision = 'dd9c97ead24' diff --git a/libcodechecker/analyze/analysis_manager.py b/libcodechecker/analyze/analysis_manager.py index 389b2b30df..ec7631c2bd 100644 --- a/libcodechecker/analyze/analysis_manager.py +++ b/libcodechecker/analyze/analysis_manager.py @@ -5,6 +5,9 @@ # ------------------------------------------------------------------------- """ """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from collections import defaultdict import codecs diff --git a/libcodechecker/analyze/analyzer.py b/libcodechecker/analyze/analyzer.py index 67d1875cb8..e3d2a93fcd 100644 --- a/libcodechecker/analyze/analyzer.py +++ b/libcodechecker/analyze/analyzer.py @@ -6,6 +6,9 @@ """ Prepare and start different analysis types """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import copy from multiprocessing import Manager @@ -55,7 +58,7 @@ def create_actions_map(actions, manager): if act.source_count > 1: LOG.debug("Multiple sources for one build action: " + str(act.sources)) - source = os.path.join(act.directory, act.sources.next()) + source = os.path.join(act.directory, next(act.sources)) key = source, act.target if key in result: LOG.debug("Multiple entires in compile database " diff --git a/libcodechecker/analyze/analyzer_env.py b/libcodechecker/analyze/analyzer_env.py index 8d11a47a81..f2b5707821 100644 --- a/libcodechecker/analyze/analyzer_env.py +++ b/libcodechecker/analyze/analyzer_env.py @@ -4,6 +4,9 @@ # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- """""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os diff --git a/libcodechecker/analyze/analyzers/analyzer_base.py b/libcodechecker/analyze/analyzers/analyzer_base.py index 6c5fa23c0b..adb554d32c 100644 --- a/libcodechecker/analyze/analyzers/analyzer_base.py +++ b/libcodechecker/analyze/analyzers/analyzer_base.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Base class for various source analyzers. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from abc import ABCMeta, abstractmethod import os diff --git a/libcodechecker/analyze/analyzers/analyzer_clang_tidy.py b/libcodechecker/analyze/analyzers/analyzer_clang_tidy.py index aff4fa480f..75365a227a 100644 --- a/libcodechecker/analyze/analyzers/analyzer_clang_tidy.py +++ b/libcodechecker/analyze/analyzers/analyzer_clang_tidy.py @@ -5,6 +5,9 @@ # ------------------------------------------------------------------------- """ """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import re diff --git a/libcodechecker/analyze/analyzers/analyzer_clangsa.py b/libcodechecker/analyze/analyzers/analyzer_clangsa.py index 49cbbdf9bf..0d25513301 100644 --- a/libcodechecker/analyze/analyzers/analyzer_clangsa.py +++ b/libcodechecker/analyze/analyzers/analyzer_clangsa.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Clang Static Analyzer related functions. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import re diff --git a/libcodechecker/analyze/analyzers/analyzer_types.py b/libcodechecker/analyze/analyzers/analyzer_types.py index babf134551..77b06226d1 100644 --- a/libcodechecker/analyze/analyzers/analyzer_types.py +++ b/libcodechecker/analyze/analyzers/analyzer_types.py @@ -7,6 +7,9 @@ """ Supported analyzer types. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import platform import re diff --git a/libcodechecker/analyze/analyzers/config_handler.py b/libcodechecker/analyze/analyzers/config_handler.py index ddf757d229..9340200581 100644 --- a/libcodechecker/analyze/analyzers/config_handler.py +++ b/libcodechecker/analyze/analyzers/config_handler.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Static analyzer configuration handler. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from abc import ABCMeta, abstractmethod import collections diff --git a/libcodechecker/analyze/analyzers/config_handler_clang_tidy.py b/libcodechecker/analyze/analyzers/config_handler_clang_tidy.py index 6dfd4cd845..e12d77a555 100644 --- a/libcodechecker/analyze/analyzers/config_handler_clang_tidy.py +++ b/libcodechecker/analyze/analyzers/config_handler_clang_tidy.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Config handler for Clang Tidy analyzer. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import json diff --git a/libcodechecker/analyze/analyzers/config_handler_clangsa.py b/libcodechecker/analyze/analyzers/config_handler_clangsa.py index 193854d110..d565076392 100644 --- a/libcodechecker/analyze/analyzers/config_handler_clangsa.py +++ b/libcodechecker/analyze/analyzers/config_handler_clangsa.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Clang Static analyzer configuration handler. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import re diff --git a/libcodechecker/analyze/analyzers/ctu_triple_arch.py b/libcodechecker/analyze/analyzers/ctu_triple_arch.py index c5b1d8c7cc..9c8a45df5b 100644 --- a/libcodechecker/analyze/analyzers/ctu_triple_arch.py +++ b/libcodechecker/analyze/analyzers/ctu_triple_arch.py @@ -6,6 +6,9 @@ """ Helpers for determining triple arch of a compile action """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import shlex diff --git a/libcodechecker/analyze/analyzers/result_handler_base.py b/libcodechecker/analyze/analyzers/result_handler_base.py index f6fd558c82..1283f8d298 100644 --- a/libcodechecker/analyze/analyzers/result_handler_base.py +++ b/libcodechecker/analyze/analyzers/result_handler_base.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Result handlers to manage the output of the static analyzers. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from abc import ABCMeta import hashlib diff --git a/libcodechecker/analyze/analyzers/result_handler_clang_tidy.py b/libcodechecker/analyze/analyzers/result_handler_clang_tidy.py index 58dc3c9212..7d74798f2e 100644 --- a/libcodechecker/analyze/analyzers/result_handler_clang_tidy.py +++ b/libcodechecker/analyze/analyzers/result_handler_clang_tidy.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Result handler for Clang Tidy. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from libcodechecker.analyze import tidy_output_converter from libcodechecker.analyze.analyzers.result_handler_base \ diff --git a/libcodechecker/analyze/ctu_manager.py b/libcodechecker/analyze/ctu_manager.py index 058cac8409..24d21d936e 100644 --- a/libcodechecker/analyze/ctu_manager.py +++ b/libcodechecker/analyze/ctu_manager.py @@ -6,6 +6,9 @@ """ Arranges the 1st phase of 2 phase executions for CTU """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import glob import os diff --git a/libcodechecker/analyze/gcc_toolchain.py b/libcodechecker/analyze/gcc_toolchain.py index ff9f0ba665..372988fcd0 100644 --- a/libcodechecker/analyze/gcc_toolchain.py +++ b/libcodechecker/analyze/gcc_toolchain.py @@ -7,6 +7,9 @@ """ gcc-toolchain compilation option related helper functions. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import re diff --git a/libcodechecker/analyze/host_check.py b/libcodechecker/analyze/host_check.py index b0aed8b6ab..afc8bf374f 100644 --- a/libcodechecker/analyze/host_check.py +++ b/libcodechecker/analyze/host_check.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Check static analyzer and features on the host machine. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import errno import subprocess diff --git a/libcodechecker/analyze/log_parser.py b/libcodechecker/analyze/log_parser.py index c373223efc..71c94eb31b 100644 --- a/libcodechecker/analyze/log_parser.py +++ b/libcodechecker/analyze/log_parser.py @@ -3,6 +3,14 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Parse the compile_commands.json file. +Get compiler specific include paths targets. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json import os diff --git a/libcodechecker/analyze/plist_parser.py b/libcodechecker/analyze/plist_parser.py index fc3dd7c687..8625a25e53 100644 --- a/libcodechecker/analyze/plist_parser.py +++ b/libcodechecker/analyze/plist_parser.py @@ -29,6 +29,9 @@ for Clang versions before v3.7 """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from collections import defaultdict import math diff --git a/libcodechecker/analyze/pre_analysis_manager.py b/libcodechecker/analyze/pre_analysis_manager.py index e4b23e615b..6443b69c57 100644 --- a/libcodechecker/analyze/pre_analysis_manager.py +++ b/libcodechecker/analyze/pre_analysis_manager.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Run pre analysis, collect statistics or CTU data. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import multiprocessing import os diff --git a/libcodechecker/analyze/skiplist_handler.py b/libcodechecker/analyze/skiplist_handler.py index e5fa90ffdc..19f947ef30 100644 --- a/libcodechecker/analyze/skiplist_handler.py +++ b/libcodechecker/analyze/skiplist_handler.py @@ -5,6 +5,9 @@ # ------------------------------------------------------------------------- """ """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import fnmatch import re diff --git a/libcodechecker/analyze/statistics_collector.py b/libcodechecker/analyze/statistics_collector.py index 8c11e441b1..9bc8b64be8 100644 --- a/libcodechecker/analyze/statistics_collector.py +++ b/libcodechecker/analyze/statistics_collector.py @@ -8,6 +8,8 @@ Calculates call statistics from analysis output """ from __future__ import division +from __future__ import print_function +from __future__ import absolute_import from StringIO import StringIO from collections import defaultdict diff --git a/libcodechecker/analyze/tidy_output_converter.py b/libcodechecker/analyze/tidy_output_converter.py index b9863ac604..82d6f34d35 100644 --- a/libcodechecker/analyze/tidy_output_converter.py +++ b/libcodechecker/analyze/tidy_output_converter.py @@ -7,6 +7,9 @@ This module is responsible for parsing clang-tidy output and generating plist for the plist_parser module. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import copy import json @@ -122,7 +125,7 @@ def parse_messages(self, tidy_out): titer = iter(tidy_out) try: - next_line = titer.next() + next_line = next(titer) while True: message, next_line = self._parse_message(titer, next_line) if message is not None: @@ -144,7 +147,7 @@ def _parse_message(self, titer, line): match = OutputParser.message_line_re.match(line) if match is None: - return None, titer.next() + return None, next(titer) message = Message( os.path.abspath(match.group('path')), @@ -154,7 +157,7 @@ def _parse_message(self, titer, line): match.group('checker').strip()) try: - line = titer.next() + line = next(titer) line = self._parse_code(message, titer, line) line = self._parse_fixits(message, titer, line) line = self._parse_notes(message, titer, line) @@ -173,11 +176,11 @@ def _parse_code(message, titer, line): # Eat arrow line. # FIXME: range support? - line = titer.next() + line = next(titer) if '^' not in line: LOG.debug("Unexpected line: %s. Expected an arrow line!" % line) return line - return titer.next() + return next(titer) @staticmethod def _parse_fixits(message, titer, line): @@ -191,7 +194,7 @@ def _parse_fixits(message, titer, line): message.fixits.append(Note(message.path, message.line, line.find(message_text) + 1, message_text)) - line = titer.next() + line = next(titer) return line def _parse_notes(self, message, titer, line): @@ -201,13 +204,13 @@ def _parse_notes(self, message, titer, line): match = OutputParser.note_line_re.match(line) if match is None: LOG.debug("Unexpected line: %s" % line) - return titer.next() + return next(titer) message.notes.append(Note(os.path.abspath(match.group('path')), int(match.group('line')), int(match.group('column')), match.group('message').strip())) - line = titer.next() + line = next(titer) line = self._parse_code(message, titer, line) return line diff --git a/libcodechecker/cmd/cmd_line_client.py b/libcodechecker/cmd/cmd_line_client.py index 9c38c24a29..76ffb4d9b0 100644 --- a/libcodechecker/cmd/cmd_line_client.py +++ b/libcodechecker/cmd/cmd_line_client.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Command line client. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import base64 from collections import defaultdict diff --git a/libcodechecker/cmd/product_client.py b/libcodechecker/cmd/product_client.py index 39f5538a17..bdf228d3d9 100644 --- a/libcodechecker/cmd/product_client.py +++ b/libcodechecker/cmd/product_client.py @@ -6,6 +6,9 @@ """ Argument handlers for the 'CodeChecker cmd product' subcommands. """ +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division import base64 import sys @@ -18,7 +21,7 @@ from libcodechecker.server.database import database_status from libcodechecker.util import split_server_url -from cmd_line_client import CmdLineOutputEncoder +from .cmd_line_client import CmdLineOutputEncoder # Needs to be set in the handler functions. LOG = None diff --git a/libcodechecker/cmd/source_component_client.py b/libcodechecker/cmd/source_component_client.py index 0e2be0697f..5715f45d67 100644 --- a/libcodechecker/cmd/source_component_client.py +++ b/libcodechecker/cmd/source_component_client.py @@ -6,6 +6,9 @@ """ Argument handlers for the 'CodeChecker cmd components' subcommands. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import sys diff --git a/libcodechecker/cmd/token_client.py b/libcodechecker/cmd/token_client.py index 2b94ae58f5..fb1505db1d 100644 --- a/libcodechecker/cmd/token_client.py +++ b/libcodechecker/cmd/token_client.py @@ -6,6 +6,9 @@ """ Argument handlers for the 'CodeChecker cmd token' subcommands. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from libcodechecker import logger from libcodechecker.libclient.client import setup_auth_client diff --git a/libcodechecker/db_version.py b/libcodechecker/db_version.py index 07a92b6b51..45b16e2ba2 100644 --- a/libcodechecker/db_version.py +++ b/libcodechecker/db_version.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +DB version. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import class DBVersionInfo(object): diff --git a/libcodechecker/decorators.py b/libcodechecker/decorators.py index 76ba125a34..f93436aa29 100644 --- a/libcodechecker/decorators.py +++ b/libcodechecker/decorators.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Various decorators. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import sqlalchemy diff --git a/libcodechecker/generic_package_context.py b/libcodechecker/generic_package_context.py index a8599050ef..18902c05d8 100644 --- a/libcodechecker/generic_package_context.py +++ b/libcodechecker/generic_package_context.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Context to store package related information. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json import os diff --git a/libcodechecker/generic_package_suppress_handler.py b/libcodechecker/generic_package_suppress_handler.py index e2126facb6..084064e82c 100644 --- a/libcodechecker/generic_package_suppress_handler.py +++ b/libcodechecker/generic_package_suppress_handler.py @@ -6,6 +6,9 @@ """ Handler for suppressing a bug. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os diff --git a/libcodechecker/host_check.py b/libcodechecker/host_check.py index a7ee3eb3ec..f5f08463fd 100644 --- a/libcodechecker/host_check.py +++ b/libcodechecker/host_check.py @@ -3,6 +3,14 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Functions to check the host machine and the analyzers for various +features, dependecies and configurations. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import re diff --git a/libcodechecker/libauth/cc_ldap.py b/libcodechecker/libauth/cc_ldap.py index b1ab885719..d870e16f9b 100644 --- a/libcodechecker/libauth/cc_ldap.py +++ b/libcodechecker/libauth/cc_ldap.py @@ -85,6 +85,9 @@ """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from contextlib import contextmanager diff --git a/libcodechecker/libauth/cc_pam.py b/libcodechecker/libauth/cc_pam.py index 35c43f2987..b89c6a89a4 100644 --- a/libcodechecker/libauth/cc_pam.py +++ b/libcodechecker/libauth/cc_pam.py @@ -20,6 +20,9 @@ } """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import pam import grp diff --git a/libcodechecker/libclient/authentication_helper.py b/libcodechecker/libclient/authentication_helper.py index d13b7de0b0..9dc475005d 100644 --- a/libcodechecker/libclient/authentication_helper.py +++ b/libcodechecker/libclient/authentication_helper.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Helper for tha authentication api. +""" +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division from thrift.transport import THttpClient from thrift.protocol import TJSONProtocol @@ -15,7 +21,7 @@ from libcodechecker.libclient.thrift_call import ThriftClientCall from libcodechecker.logger import get_logger -from credential_manager import SESSION_COOKIE_NAME +from .credential_manager import SESSION_COOKIE_NAME LOG = get_logger('system') diff --git a/libcodechecker/libclient/client.py b/libcodechecker/libclient/client.py index 454fdfb655..5305eff53d 100644 --- a/libcodechecker/libclient/client.py +++ b/libcodechecker/libclient/client.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Thrift client setup and configuration. +""" +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division import getpass import json @@ -20,7 +26,7 @@ from . import authentication_helper from . import product_helper from . import thrift_helper -from credential_manager import UserCredentials +from .credential_manager import UserCredentials LOG = get_logger('system') diff --git a/libcodechecker/libclient/credential_manager.py b/libcodechecker/libclient/credential_manager.py index f205f2c2ea..be60c4e01c 100644 --- a/libcodechecker/libclient/credential_manager.py +++ b/libcodechecker/libclient/credential_manager.py @@ -7,6 +7,9 @@ Handles the management of stored user credentials and currently known session tokens. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json import os diff --git a/libcodechecker/libclient/product_helper.py b/libcodechecker/libclient/product_helper.py index d5d7cec2c0..a02683a2fb 100644 --- a/libcodechecker/libclient/product_helper.py +++ b/libcodechecker/libclient/product_helper.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Helper for the product thrift api. +""" +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division from thrift.transport import THttpClient from thrift.protocol import TJSONProtocol @@ -13,7 +19,7 @@ from libcodechecker.libclient.thrift_call import ThriftClientCall from libcodechecker.logger import get_logger -from credential_manager import SESSION_COOKIE_NAME +from .credential_manager import SESSION_COOKIE_NAME LOG = get_logger('system') diff --git a/libcodechecker/libclient/thrift_call.py b/libcodechecker/libclient/thrift_call.py index 51c62e8cb9..35c356ba11 100644 --- a/libcodechecker/libclient/thrift_call.py +++ b/libcodechecker/libclient/thrift_call.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Helper for thrift api calls. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import + import os import socket import sys diff --git a/libcodechecker/libclient/thrift_helper.py b/libcodechecker/libclient/thrift_helper.py index c953526799..dcffd829e9 100644 --- a/libcodechecker/libclient/thrift_helper.py +++ b/libcodechecker/libclient/thrift_helper.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Helper functions for Thrift api calls. +""" +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division from thrift.transport import THttpClient from thrift.protocol import TJSONProtocol @@ -13,7 +19,7 @@ from libcodechecker.libclient.thrift_call import ThriftClientCall from libcodechecker.logger import get_logger -from credential_manager import SESSION_COOKIE_NAME +from .credential_manager import SESSION_COOKIE_NAME LOG = get_logger('system') diff --git a/libcodechecker/libhandlers/__init__.py b/libcodechecker/libhandlers/__init__.py index 655a7700e5..ef362c97d0 100644 --- a/libcodechecker/libhandlers/__init__.py +++ b/libcodechecker/libhandlers/__init__.py @@ -10,6 +10,9 @@ This file contains basic methods to handle dynamic subcommand loading. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import imp diff --git a/libcodechecker/libhandlers/analyze.py b/libcodechecker/libhandlers/analyze.py index 847a802192..b9b3be669f 100644 --- a/libcodechecker/libhandlers/analyze.py +++ b/libcodechecker/libhandlers/analyze.py @@ -6,6 +6,9 @@ """ Execute analysis over an already existing build.json compilation database. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import json diff --git a/libcodechecker/libhandlers/analyzers.py b/libcodechecker/libhandlers/analyzers.py index 73c7484cbb..5f3a6b7731 100644 --- a/libcodechecker/libhandlers/analyzers.py +++ b/libcodechecker/libhandlers/analyzers.py @@ -7,6 +7,9 @@ Subcommand module for the 'CodeChecker analyzers' command which lists the analyzers available in CodeChecker. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import subprocess diff --git a/libcodechecker/libhandlers/check.py b/libcodechecker/libhandlers/check.py index a0dfc04fce..fada92d11d 100644 --- a/libcodechecker/libhandlers/check.py +++ b/libcodechecker/libhandlers/check.py @@ -8,6 +8,9 @@ giving an easy way to perform analysis from a log command and print results to stdout. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import os diff --git a/libcodechecker/libhandlers/checkers.py b/libcodechecker/libhandlers/checkers.py index 5eaeae6607..bc5f56a6f2 100644 --- a/libcodechecker/libhandlers/checkers.py +++ b/libcodechecker/libhandlers/checkers.py @@ -6,6 +6,9 @@ """ List the checkers available in the analyzers. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import os diff --git a/libcodechecker/libhandlers/cmd.py b/libcodechecker/libhandlers/cmd.py index acd1cab365..695a02bafe 100644 --- a/libcodechecker/libhandlers/cmd.py +++ b/libcodechecker/libhandlers/cmd.py @@ -7,6 +7,9 @@ The CodeChechecker command-line client can be used to view information about analysis reports found on a running viewer 'server' from a command-line. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import getpass diff --git a/libcodechecker/libhandlers/log.py b/libcodechecker/libhandlers/log.py index a61003a707..e1cd06f895 100644 --- a/libcodechecker/libhandlers/log.py +++ b/libcodechecker/libhandlers/log.py @@ -10,6 +10,9 @@ This module contains the basic definitions for how 'CodeChecker log' is to be invoked and ran. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import os diff --git a/libcodechecker/libhandlers/parse.py b/libcodechecker/libhandlers/parse.py index 674366435c..9eb27d1dcb 100644 --- a/libcodechecker/libhandlers/parse.py +++ b/libcodechecker/libhandlers/parse.py @@ -7,6 +7,9 @@ Defines the CodeChecker action for parsing a set of analysis results into a human-readable format. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from collections import Counter import argparse diff --git a/libcodechecker/libhandlers/server.py b/libcodechecker/libhandlers/server.py index 4720798859..94ce54555b 100644 --- a/libcodechecker/libhandlers/server.py +++ b/libcodechecker/libhandlers/server.py @@ -7,6 +7,9 @@ Handler for the subcommand that is used to start and manage CodeChecker servers, which are used to query analysis report information. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import errno diff --git a/libcodechecker/libhandlers/store.py b/libcodechecker/libhandlers/store.py index 0ebadfd0a5..4e86cc0f9d 100644 --- a/libcodechecker/libhandlers/store.py +++ b/libcodechecker/libhandlers/store.py @@ -7,6 +7,9 @@ 'CodeChecker store' parses a list of analysis results and stores them in the database. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import base64 diff --git a/libcodechecker/libhandlers/version.py b/libcodechecker/libhandlers/version.py index 14350af573..cffa236a96 100644 --- a/libcodechecker/libhandlers/version.py +++ b/libcodechecker/libhandlers/version.py @@ -6,6 +6,9 @@ """ Defines a subcommand for CodeChecker which prints version information. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import json diff --git a/libcodechecker/log/build_action.py b/libcodechecker/log/build_action.py index 5e264bd0ce..f4a270e774 100644 --- a/libcodechecker/log/build_action.py +++ b/libcodechecker/log/build_action.py @@ -4,6 +4,9 @@ # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- """""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import hashlib diff --git a/libcodechecker/log/build_manager.py b/libcodechecker/log/build_manager.py index 3ba9ad6f10..67bbe89a65 100644 --- a/libcodechecker/log/build_manager.py +++ b/libcodechecker/log/build_manager.py @@ -6,6 +6,9 @@ """ Build and log related functionality. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from distutils.spawn import find_executable import os import pickle diff --git a/libcodechecker/log/host_check.py b/libcodechecker/log/host_check.py index 5b8df1b762..adbae7601f 100644 --- a/libcodechecker/log/host_check.py +++ b/libcodechecker/log/host_check.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Check host machine for a compile command logger. +""" + +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import errno import os diff --git a/libcodechecker/log/option_parser.py b/libcodechecker/log/option_parser.py index 6d028c6fd7..cd5456c203 100644 --- a/libcodechecker/log/option_parser.py +++ b/libcodechecker/log/option_parser.py @@ -16,6 +16,9 @@ - modular option handling system configuring possibility from config file. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import re import shlex @@ -383,7 +386,7 @@ def wrapped(value): def append_n(size): target_list.append(it.item) for _ in range(size): - it.next() + next(it) target_list.append(it.item) if regex: @@ -410,7 +413,7 @@ def wrapped(value): if match is not None: tmp = it.item if match.group(1) == '': - it.next() + next(it) tmp = tmp + it.item target_list.append(tmp) return True @@ -423,7 +426,7 @@ def append_to_list_from_file(arg, target_list): def wrapped(value): if value == arg: - it.next() + next(it) with open(it.item) as file: for line in file: target_list.append(line.strip()) @@ -439,7 +442,7 @@ def wrapped(value): def append_replacement(items): for item in items: target_list.append(item) - it.next() + next(it) if regex: for pattern in table: @@ -460,7 +463,7 @@ def wrapped(value): if (regex and regex_match(value, arg)) or value == arg: tmp = attr_value if attr_value is None: - it.next() + next(it) tmp = it.item setattr(obj, attr_name, tmp) return True @@ -474,7 +477,7 @@ def skip(table, regex=False): def wrapped(value): def skip_n(size): for _ in range(size): - it.next() + next(it) if regex: for pattern in table: diff --git a/libcodechecker/logger.py b/libcodechecker/logger.py index 7895a6b8bb..7725bc36fc 100644 --- a/libcodechecker/logger.py +++ b/libcodechecker/logger.py @@ -5,6 +5,9 @@ # ------------------------------------------------------------------------- """ """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import json diff --git a/libcodechecker/output_formatters.py b/libcodechecker/output_formatters.py index 29c3698303..d08e4831ec 100644 --- a/libcodechecker/output_formatters.py +++ b/libcodechecker/output_formatters.py @@ -6,6 +6,9 @@ """ Contains functions to format and pretty-print data from two-dimensional arrays. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json from operator import itemgetter diff --git a/libcodechecker/pgpass.py b/libcodechecker/pgpass.py index eb6dd50453..6650a1e8ee 100644 --- a/libcodechecker/pgpass.py +++ b/libcodechecker/pgpass.py @@ -6,6 +6,9 @@ """ Parser for PostgreSQL libpq password file. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import def _match_field(line, field): diff --git a/libcodechecker/profiler.py b/libcodechecker/profiler.py index 2739237998..2cd22fcfaf 100644 --- a/libcodechecker/profiler.py +++ b/libcodechecker/profiler.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Helpers to profile. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from datetime import datetime import cProfile diff --git a/libcodechecker/report.py b/libcodechecker/report.py index a4773bcf8f..781cc56071 100644 --- a/libcodechecker/report.py +++ b/libcodechecker/report.py @@ -11,6 +11,9 @@ All hash generation algorithms should be documented and implemented here. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import hashlib import json import os diff --git a/libcodechecker/server/api/authentication.py b/libcodechecker/server/api/authentication.py index a2d5694685..f26a583d66 100644 --- a/libcodechecker/server/api/authentication.py +++ b/libcodechecker/server/api/authentication.py @@ -6,6 +6,9 @@ """ Handle Thrift requests for authentication. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json import shared diff --git a/libcodechecker/server/api/bad_api_version.py b/libcodechecker/server/api/bad_api_version.py index ee1b9925e1..f6356b3845 100644 --- a/libcodechecker/server/api/bad_api_version.py +++ b/libcodechecker/server/api/bad_api_version.py @@ -6,6 +6,9 @@ """ Handle Thrift requests for authentication. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import shared diff --git a/libcodechecker/server/api/product_server.py b/libcodechecker/server/api/product_server.py index 35f338a1a7..7a4c27afa1 100644 --- a/libcodechecker/server/api/product_server.py +++ b/libcodechecker/server/api/product_server.py @@ -6,6 +6,9 @@ """ Handle Thrift requests for the product manager service. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import base64 import os diff --git a/libcodechecker/server/api/report_server.py b/libcodechecker/server/api/report_server.py index e72c139dc0..52c94d6684 100644 --- a/libcodechecker/server/api/report_server.py +++ b/libcodechecker/server/api/report_server.py @@ -6,6 +6,9 @@ """ Handle Thrift requests. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import base64 import codecs diff --git a/libcodechecker/server/api/store_handler.py b/libcodechecker/server/api/store_handler.py index 67e6f0ffe2..1306b14dfc 100644 --- a/libcodechecker/server/api/store_handler.py +++ b/libcodechecker/server/api/store_handler.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Helpers to store analysis reports. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import base64 from datetime import datetime diff --git a/libcodechecker/server/database/config_db_model.py b/libcodechecker/server/database/config_db_model.py index 49a87a92ca..ae44759d83 100644 --- a/libcodechecker/server/database/config_db_model.py +++ b/libcodechecker/server/database/config_db_model.py @@ -9,6 +9,8 @@ from __future__ import print_function from __future__ import unicode_literals +from __future__ import division +from __future__ import absolute_import from datetime import datetime import sys diff --git a/libcodechecker/server/database/database.py b/libcodechecker/server/database/database.py index 7d6b511bbe..b3200db671 100644 --- a/libcodechecker/server/database/database.py +++ b/libcodechecker/server/database/database.py @@ -6,6 +6,9 @@ """ Database connection handling to a database backend. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from abc import ABCMeta, abstractmethod import os diff --git a/libcodechecker/server/database/database_status.py b/libcodechecker/server/database/database_status.py index ec29b023f9..463d37529d 100644 --- a/libcodechecker/server/database/database_status.py +++ b/libcodechecker/server/database/database_status.py @@ -8,6 +8,9 @@ """ Map between database statuses and the corresponding messages. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from shared.ttypes import DBStatus db_status_msg = { diff --git a/libcodechecker/server/database/db_cleanup.py b/libcodechecker/server/database/db_cleanup.py index 77d06b9c6d..f47724d535 100644 --- a/libcodechecker/server/database/db_cleanup.py +++ b/libcodechecker/server/database/db_cleanup.py @@ -7,6 +7,9 @@ Contains housekeeping routines that are used to remove expired, obsolete, or dangling records from the database. """ +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division from datetime import datetime, timedelta @@ -14,7 +17,7 @@ from libcodechecker.logger import get_logger -from run_db_model import * +from .run_db_model import * LOG = get_logger('server') RUN_LOCK_TIMEOUT_IN_DATABASE = 30 * 60 # 30 minutes. diff --git a/libcodechecker/server/database/run_db_model.py b/libcodechecker/server/database/run_db_model.py index 5caa4f6ac1..2f1aa8388c 100644 --- a/libcodechecker/server/database/run_db_model.py +++ b/libcodechecker/server/database/run_db_model.py @@ -9,6 +9,8 @@ from __future__ import print_function from __future__ import unicode_literals +from __future__ import division +from __future__ import absolute_import from datetime import datetime, timedelta from math import ceil diff --git a/libcodechecker/server/instance_manager.py b/libcodechecker/server/instance_manager.py index 15f0e9d462..904d834877 100644 --- a/libcodechecker/server/instance_manager.py +++ b/libcodechecker/server/instance_manager.py @@ -7,6 +7,9 @@ Instance manager handles the state keeping of running CodeChecker instances for a particular user on the local machine. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import getpass import json diff --git a/libcodechecker/server/permissions.py b/libcodechecker/server/permissions.py index fd1895fd69..38029dff4c 100644 --- a/libcodechecker/server/permissions.py +++ b/libcodechecker/server/permissions.py @@ -8,6 +8,9 @@ This module defines the list of permissions of a CodeChecker server, and provides the handling of permission matching and databases. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from abc import ABCMeta from abc import abstractmethod diff --git a/libcodechecker/server/routing.py b/libcodechecker/server/routing.py index 2f25893792..a66a76dbdd 100644 --- a/libcodechecker/server/routing.py +++ b/libcodechecker/server/routing.py @@ -6,6 +6,9 @@ """ Defines the routing rules for the CodeChecker server. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import re import urlparse diff --git a/libcodechecker/server/server.py b/libcodechecker/server/server.py index 13a7038814..d7ed954e65 100644 --- a/libcodechecker/server/server.py +++ b/libcodechecker/server/server.py @@ -7,6 +7,9 @@ Main server starts a http server which handles Thrift client and browser requests. """ +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division import atexit import datetime import errno @@ -48,14 +51,14 @@ from . import permissions from . import routing from . import session_manager -from api.authentication import ThriftAuthHandler as AuthHandler_v6 -from api.bad_api_version import ThriftAPIMismatchHandler as BadAPIHandler -from api.product_server import ThriftProductHandler as ProductHandler_v6 -from api.report_server import ThriftRequestHandler as ReportHandler_v6 -from database import database -from database import db_cleanup -from database.config_db_model import Product as ORMProduct -from database.run_db_model import IDENTIFIER as RUN_META +from .api.authentication import ThriftAuthHandler as AuthHandler_v6 +from .api.bad_api_version import ThriftAPIMismatchHandler as BadAPIHandler +from .api.product_server import ThriftProductHandler as ProductHandler_v6 +from .api.report_server import ThriftRequestHandler as ReportHandler_v6 +from .database import database +from .database import db_cleanup +from .database.config_db_model import Product as ORMProduct +from .database.run_db_model import IDENTIFIER as RUN_META LOG = get_logger('server') diff --git a/libcodechecker/server/session_manager.py b/libcodechecker/server/session_manager.py index b3bd3b4800..83f5c65eaf 100644 --- a/libcodechecker/server/session_manager.py +++ b/libcodechecker/server/session_manager.py @@ -6,6 +6,9 @@ """ Handles the management of authentication sessions on the server's side. """ +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division from datetime import datetime, timedelta import hashlib @@ -15,7 +18,8 @@ generate_session_token from libcodechecker.version import SESSION_COOKIE_NAME as _SCN -from database.config_db_model import Session as SessionRecord, SystemPermission +from .database.config_db_model import Session as SessionRecord +from .database.config_db_model import SystemPermission UNSUPPORTED_METHODS = [] diff --git a/libcodechecker/source_code_comment_handler.py b/libcodechecker/source_code_comment_handler.py index 7510e76587..7a2c3118e5 100644 --- a/libcodechecker/source_code_comment_handler.py +++ b/libcodechecker/source_code_comment_handler.py @@ -6,6 +6,9 @@ """ Source code comment handling. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import abc import os diff --git a/libcodechecker/suppress_file_handler.py b/libcodechecker/suppress_file_handler.py index 5cda1b80c4..dd899de376 100644 --- a/libcodechecker/suppress_file_handler.py +++ b/libcodechecker/suppress_file_handler.py @@ -16,6 +16,9 @@ For backward compatibility the hash_value_type is an optional filed. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import codecs import os diff --git a/libcodechecker/util.py b/libcodechecker/util.py index b11f83c4a7..dabe46c3f9 100644 --- a/libcodechecker/util.py +++ b/libcodechecker/util.py @@ -6,6 +6,9 @@ """ Util module. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import datetime import hashlib diff --git a/libcodechecker/version.py b/libcodechecker/version.py index b6c9bc42a4..2e6c1b8c79 100644 --- a/libcodechecker/version.py +++ b/libcodechecker/version.py @@ -7,6 +7,9 @@ This module stores constants that are shared between the CodeChecker server and client, related to API and other version-specific information. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import # The name of the cookie which contains the user's authentication session's # token. diff --git a/scripts/build_package.py b/scripts/build_package.py index d56926817e..7e3dc09e20 100755 --- a/scripts/build_package.py +++ b/scripts/build_package.py @@ -3,6 +3,8 @@ CodeChecker packager script creates a package based on the given layout config. """ from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import errno diff --git a/scripts/create_new_subcommand.py b/scripts/create_new_subcommand.py index ef058c1dd5..dac6a43e56 100755 --- a/scripts/create_new_subcommand.py +++ b/scripts/create_new_subcommand.py @@ -8,6 +8,9 @@ Generate a new CodeChecker subcommand and the structure needed for it in the working directory. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import sys diff --git a/scripts/debug_tools/failure_lib.py b/scripts/debug_tools/failure_lib.py index cac3ec7f7e..da1e98c2ad 100644 --- a/scripts/debug_tools/failure_lib.py +++ b/scripts/debug_tools/failure_lib.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Helpers to manage failure zips. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import + import json import os import subprocess diff --git a/scripts/debug_tools/prepare_all_cmd_for_ctu.py b/scripts/debug_tools/prepare_all_cmd_for_ctu.py index 283b1fb31b..f61a61d05a 100755 --- a/scripts/debug_tools/prepare_all_cmd_for_ctu.py +++ b/scripts/debug_tools/prepare_all_cmd_for_ctu.py @@ -4,6 +4,9 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import json import os diff --git a/scripts/debug_tools/prepare_analyzer_cmd.py b/scripts/debug_tools/prepare_analyzer_cmd.py index 2f45d2d4bb..adcbac0f21 100755 --- a/scripts/debug_tools/prepare_analyzer_cmd.py +++ b/scripts/debug_tools/prepare_analyzer_cmd.py @@ -4,6 +4,9 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import re import failure_lib as lib diff --git a/scripts/debug_tools/prepare_compile_cmd.py b/scripts/debug_tools/prepare_compile_cmd.py index 42dca832c7..9639031fb9 100755 --- a/scripts/debug_tools/prepare_compile_cmd.py +++ b/scripts/debug_tools/prepare_compile_cmd.py @@ -4,6 +4,9 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import json import os diff --git a/scripts/debug_tools/prepare_compiler_includes.py b/scripts/debug_tools/prepare_compiler_includes.py index 3c94ffc1cc..c9a32d26c0 100755 --- a/scripts/debug_tools/prepare_compiler_includes.py +++ b/scripts/debug_tools/prepare_compiler_includes.py @@ -4,6 +4,9 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import json import os diff --git a/scripts/debug_tools/prepare_compiler_target.py b/scripts/debug_tools/prepare_compiler_target.py index a7cc152d51..4cca1c569f 100755 --- a/scripts/debug_tools/prepare_compiler_target.py +++ b/scripts/debug_tools/prepare_compiler_target.py @@ -4,6 +4,9 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import json diff --git a/scripts/resources/command_template.py b/scripts/resources/command_template.py index e9885f23ca..2c0329a823 100644 --- a/scripts/resources/command_template.py +++ b/scripts/resources/command_template.py @@ -8,6 +8,9 @@ the subcommand-specific argparse.ArgumentParser definitions and the method which should be ran as the subcommand's main method. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse diff --git a/scripts/resources/entrypoint_template.py b/scripts/resources/entrypoint_template.py index 1a803aa964..5df96a6ca1 100644 --- a/scripts/resources/entrypoint_template.py +++ b/scripts/resources/entrypoint_template.py @@ -7,6 +7,9 @@ """ Entry point for the $COMMAND$ command. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import imp import os diff --git a/scripts/send_log_config.py b/scripts/send_log_config.py index ebbfc1f90d..1c42628bb4 100755 --- a/scripts/send_log_config.py +++ b/scripts/send_log_config.py @@ -4,6 +4,9 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import json import socket diff --git a/tests/add_new_func_test.py b/tests/add_new_func_test.py index 93be6ba463..d95f137d87 100755 --- a/tests/add_new_func_test.py +++ b/tests/add_new_func_test.py @@ -10,6 +10,9 @@ Generate a new functional test directory and files based on the template """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import sys diff --git a/tests/add_new_unit_test.py b/tests/add_new_unit_test.py index f66287ef15..59d52762c7 100755 --- a/tests/add_new_unit_test.py +++ b/tests/add_new_unit_test.py @@ -10,6 +10,9 @@ """ Generate a new unit test based on the skeleton """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import sys diff --git a/tests/functional/__init__.py b/tests/functional/__init__.py index 168edd315e..eda3991998 100644 --- a/tests/functional/__init__.py +++ b/tests/functional/__init__.py @@ -1,22 +1,29 @@ -# ----------------------------------------------------------------------------- -# The CodeChecker Infrastructure -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# ----------------------------------------------------------------------------- -import os -import sys -import json - -# Setup the required environment variables for the tests. - -REPO_ROOT = os.path.abspath(os.environ['REPO_ROOT']) - -# Add the generated python modules (by thrift) to the PYTHONPATH, needed -# by the tests. -PKG_ROOT = os.path.join(REPO_ROOT, 'build', 'CodeChecker') - -__LAYOUT_FILE_PATH = os.path.join(PKG_ROOT, 'config', 'package_layout.json') -with open(__LAYOUT_FILE_PATH) as layout_file: - __PACKAGE_LAYOUT = json.load(layout_file) -sys.path.append(os.path.join( - PKG_ROOT, __PACKAGE_LAYOUT['static']['gencodechecker'])) +# ----------------------------------------------------------------------------- +# The CodeChecker Infrastructure +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# ----------------------------------------------------------------------------- +""" +Setup module paths and environment variables for the functional tests. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import + +import os +import sys +import json + +# Setup the required environment variables for the tests. + +REPO_ROOT = os.path.abspath(os.environ['REPO_ROOT']) + +# Add the generated python modules (by thrift) to the PYTHONPATH, needed +# by the tests. +PKG_ROOT = os.path.join(REPO_ROOT, 'build', 'CodeChecker') + +__LAYOUT_FILE_PATH = os.path.join(PKG_ROOT, 'config', 'package_layout.json') +with open(__LAYOUT_FILE_PATH) as layout_file: + __PACKAGE_LAYOUT = json.load(layout_file) +sys.path.append(os.path.join( + PKG_ROOT, __PACKAGE_LAYOUT['static']['gencodechecker'])) diff --git a/tests/functional/analyze/__init__.py b/tests/functional/analyze/__init__.py index 41128d849f..7a04918dee 100644 --- a/tests/functional/analyze/__init__.py +++ b/tests/functional/analyze/__init__.py @@ -7,6 +7,9 @@ """Setup for the test package analyze. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/analyze/test_analyze.py b/tests/functional/analyze/test_analyze.py index 7f2907df5c..602f2a9491 100644 --- a/tests/functional/analyze/test_analyze.py +++ b/tests/functional/analyze/test_analyze.py @@ -8,6 +8,9 @@ """ Test case for the CodeChecker analyze command's direct functionality. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json import os diff --git a/tests/functional/analyze_and_parse/__init__.py b/tests/functional/analyze_and_parse/__init__.py index 6d8559f065..63a3304c23 100644 --- a/tests/functional/analyze_and_parse/__init__.py +++ b/tests/functional/analyze_and_parse/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the test package 'analyze' and 'parse'.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/analyze_and_parse/test_analyze_and_parse.py b/tests/functional/analyze_and_parse/test_analyze_and_parse.py index 4d9fe26c4b..5aef7b2823 100644 --- a/tests/functional/analyze_and_parse/test_analyze_and_parse.py +++ b/tests/functional/analyze_and_parse/test_analyze_and_parse.py @@ -5,6 +5,9 @@ # ----------------------------------------------------------------------------- """This module tests the CodeChecker 'analyze' and 'parse' feature.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import glob import os diff --git a/tests/functional/authentication/__init__.py b/tests/functional/authentication/__init__.py index 6036a8b225..035a1489e8 100644 --- a/tests/functional/authentication/__init__.py +++ b/tests/functional/authentication/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the package tests.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import multiprocessing import os diff --git a/tests/functional/authentication/test_authentication.py b/tests/functional/authentication/test_authentication.py index dce3e774cf..cbc823ebb9 100644 --- a/tests/functional/authentication/test_authentication.py +++ b/tests/functional/authentication/test_authentication.py @@ -7,6 +7,9 @@ """ Authentication tests. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import subprocess import unittest diff --git a/tests/functional/cmdline/__init__.py b/tests/functional/cmdline/__init__.py index 66e2d74fc5..4dff868de7 100644 --- a/tests/functional/cmdline/__init__.py +++ b/tests/functional/cmdline/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the package tests.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/cmdline/test_cmdline.py b/tests/functional/cmdline/test_cmdline.py index 10d54557e0..c8852cf031 100644 --- a/tests/functional/cmdline/test_cmdline.py +++ b/tests/functional/cmdline/test_cmdline.py @@ -7,6 +7,9 @@ """ This module tests the CodeChecker command line. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import subprocess diff --git a/tests/functional/comment/__init__.py b/tests/functional/comment/__init__.py index 75afb7148d..6def86212f 100644 --- a/tests/functional/comment/__init__.py +++ b/tests/functional/comment/__init__.py @@ -5,6 +5,9 @@ # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- """Setup for the test package comment.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/comment/test_comment.py b/tests/functional/comment/test_comment.py index 7476d48904..ff24bfc362 100644 --- a/tests/functional/comment/test_comment.py +++ b/tests/functional/comment/test_comment.py @@ -4,6 +4,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Report commenting tests. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import logging import os diff --git a/tests/functional/component/__init__.py b/tests/functional/component/__init__.py index ae7da2570a..58d3b94d47 100644 --- a/tests/functional/component/__init__.py +++ b/tests/functional/component/__init__.py @@ -5,6 +5,9 @@ # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- """Setup for the test package component.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/component/test_component.py b/tests/functional/component/test_component.py index 5e6e98b4bf..ebd1cf032f 100644 --- a/tests/functional/component/test_component.py +++ b/tests/functional/component/test_component.py @@ -4,6 +4,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Component related tests. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import unittest diff --git a/tests/functional/ctu/__init__.py b/tests/functional/ctu/__init__.py index 5daed693e5..209b411c84 100644 --- a/tests/functional/ctu/__init__.py +++ b/tests/functional/ctu/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the test package ctu.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/ctu/test_ctu.py b/tests/functional/ctu/test_ctu.py index 60c2506e70..a03b94a77e 100644 --- a/tests/functional/ctu/test_ctu.py +++ b/tests/functional/ctu/test_ctu.py @@ -5,6 +5,9 @@ # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- """ CTU function test.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import glob import json diff --git a/tests/functional/ctu_failure/__init__.py b/tests/functional/ctu_failure/__init__.py index d15d0cee3a..bc6cf68e70 100644 --- a/tests/functional/ctu_failure/__init__.py +++ b/tests/functional/ctu_failure/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the test package ctu.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/ctu_failure/test_ctu_failure.py b/tests/functional/ctu_failure/test_ctu_failure.py index 05805a38a5..7b8f127449 100644 --- a/tests/functional/ctu_failure/test_ctu_failure.py +++ b/tests/functional/ctu_failure/test_ctu_failure.py @@ -5,6 +5,9 @@ # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- """ CTU function test.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json import os diff --git a/tests/functional/db_cleanup/__init__.py b/tests/functional/db_cleanup/__init__.py index 04918cd74b..60a078235c 100644 --- a/tests/functional/db_cleanup/__init__.py +++ b/tests/functional/db_cleanup/__init__.py @@ -5,6 +5,9 @@ # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/db_cleanup/test_db_cleanup.py b/tests/functional/db_cleanup/test_db_cleanup.py index 8d72625536..1c2e72f77a 100644 --- a/tests/functional/db_cleanup/test_db_cleanup.py +++ b/tests/functional/db_cleanup/test_db_cleanup.py @@ -4,6 +4,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Test database cleanup. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json import multiprocessing diff --git a/tests/functional/delete_runs/__init__.py b/tests/functional/delete_runs/__init__.py index 87a9431317..4d386fae0a 100644 --- a/tests/functional/delete_runs/__init__.py +++ b/tests/functional/delete_runs/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the test package delete_runs.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/delete_runs/test_delete_runs.py b/tests/functional/delete_runs/test_delete_runs.py index 93b67bf477..10ba761831 100644 --- a/tests/functional/delete_runs/test_delete_runs.py +++ b/tests/functional/delete_runs/test_delete_runs.py @@ -8,6 +8,9 @@ """ Testing deletion of multiple runs. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os diff --git a/tests/functional/detection_status/__init__.py b/tests/functional/detection_status/__init__.py index a6dacc03c9..d501d3bf76 100644 --- a/tests/functional/detection_status/__init__.py +++ b/tests/functional/detection_status/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the test package detection_status.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/detection_status/test_detection_status.py b/tests/functional/detection_status/test_detection_status.py index c97e9d2fc8..5dd3336166 100644 --- a/tests/functional/detection_status/test_detection_status.py +++ b/tests/functional/detection_status/test_detection_status.py @@ -5,6 +5,9 @@ # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- """ detection_status function test. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json import os diff --git a/tests/functional/diff/__init__.py b/tests/functional/diff/__init__.py index b8cf776829..e164382508 100644 --- a/tests/functional/diff/__init__.py +++ b/tests/functional/diff/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the package tests.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from distutils import dir_util import os diff --git a/tests/functional/diff/test_diff.py b/tests/functional/diff/test_diff.py index 199fe659da..42dce04b10 100644 --- a/tests/functional/diff/test_diff.py +++ b/tests/functional/diff/test_diff.py @@ -7,6 +7,9 @@ """ Diff feature tests. Comparing results from two runs. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import logging import os diff --git a/tests/functional/func_template/template__init__.py b/tests/functional/func_template/template__init__.py index 726bdc851d..049abe47d9 100644 --- a/tests/functional/func_template/template__init__.py +++ b/tests/functional/func_template/template__init__.py @@ -12,6 +12,9 @@ WARNING!!! """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/func_template/template_test.py b/tests/functional/func_template/template_test.py index 188ecc1c45..9489e4e80e 100644 --- a/tests/functional/func_template/template_test.py +++ b/tests/functional/func_template/template_test.py @@ -12,6 +12,9 @@ WARNING!!! """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import unittest diff --git a/tests/functional/host_check/__init__.py b/tests/functional/host_check/__init__.py index 91db7704ce..0b1263432f 100644 --- a/tests/functional/host_check/__init__.py +++ b/tests/functional/host_check/__init__.py @@ -6,6 +6,11 @@ # ----------------------------------------------------------------------------- +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import + + def setup_package(): pass diff --git a/tests/functional/host_check/test_host_check.py b/tests/functional/host_check/test_host_check.py index ad543f6067..e92d64c280 100644 --- a/tests/functional/host_check/test_host_check.py +++ b/tests/functional/host_check/test_host_check.py @@ -1,3 +1,6 @@ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import unittest import libcodechecker.analyze.host_check as hc diff --git a/tests/functional/instance_manager/__init__.py b/tests/functional/instance_manager/__init__.py index b83081b565..7091c80811 100644 --- a/tests/functional/instance_manager/__init__.py +++ b/tests/functional/instance_manager/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the package tests.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import multiprocessing import os diff --git a/tests/functional/instance_manager/test_instances.py b/tests/functional/instance_manager/test_instances.py index e3fdcb9024..ab64b69d62 100644 --- a/tests/functional/instance_manager/test_instances.py +++ b/tests/functional/instance_manager/test_instances.py @@ -7,6 +7,9 @@ """ Instance manager tests. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import subprocess import time diff --git a/tests/functional/products/__init__.py b/tests/functional/products/__init__.py index e70c765906..879b221736 100644 --- a/tests/functional/products/__init__.py +++ b/tests/functional/products/__init__.py @@ -8,6 +8,9 @@ """ Test suite to test the product management-related features. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/products/test_config_db_share.py b/tests/functional/products/test_config_db_share.py index be85416905..ffd89db8dc 100644 --- a/tests/functional/products/test_config_db_share.py +++ b/tests/functional/products/test_config_db_share.py @@ -9,6 +9,9 @@ Test accessing products that were added in a "Shared configuration database" environment. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import base64 from copy import deepcopy diff --git a/tests/functional/products/test_products.py b/tests/functional/products/test_products.py index bc89ab5257..7eedc0b4a9 100644 --- a/tests/functional/products/test_products.py +++ b/tests/functional/products/test_products.py @@ -8,6 +8,9 @@ """ Test product management related features. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import base64 from copy import deepcopy diff --git a/tests/functional/report_viewer_api/__init__.py b/tests/functional/report_viewer_api/__init__.py index d99b373e02..9427b70c14 100644 --- a/tests/functional/report_viewer_api/__init__.py +++ b/tests/functional/report_viewer_api/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the package tests.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/report_viewer_api/test_get_lines_in_file.py b/tests/functional/report_viewer_api/test_get_lines_in_file.py index 17c20d8778..429049241a 100644 --- a/tests/functional/report_viewer_api/test_get_lines_in_file.py +++ b/tests/functional/report_viewer_api/test_get_lines_in_file.py @@ -4,6 +4,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Test getting lines from source files. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import base64 import logging diff --git a/tests/functional/report_viewer_api/test_get_run_results.py b/tests/functional/report_viewer_api/test_get_run_results.py index 1ac7639882..f12155b889 100644 --- a/tests/functional/report_viewer_api/test_get_run_results.py +++ b/tests/functional/report_viewer_api/test_get_run_results.py @@ -4,6 +4,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Tests for getting the run results. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import base64 import logging diff --git a/tests/functional/report_viewer_api/test_hash_clash.py b/tests/functional/report_viewer_api/test_hash_clash.py index 550050db4d..43dd3e270d 100644 --- a/tests/functional/report_viewer_api/test_hash_clash.py +++ b/tests/functional/report_viewer_api/test_hash_clash.py @@ -8,6 +8,9 @@ """ report_server_api function tests. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from collections import defaultdict import os diff --git a/tests/functional/report_viewer_api/test_report_counting.py b/tests/functional/report_viewer_api/test_report_counting.py index a7f3523a0c..8b35ee266a 100644 --- a/tests/functional/report_viewer_api/test_report_counting.py +++ b/tests/functional/report_viewer_api/test_report_counting.py @@ -4,6 +4,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Test report counting. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from collections import Counter from collections import defaultdict diff --git a/tests/functional/report_viewer_api/test_report_filter.py b/tests/functional/report_viewer_api/test_report_filter.py index da17c24039..ce27af6e3e 100644 --- a/tests/functional/report_viewer_api/test_report_filter.py +++ b/tests/functional/report_viewer_api/test_report_filter.py @@ -4,6 +4,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Test report filtering. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import logging import os diff --git a/tests/functional/report_viewer_api/test_run_data.py b/tests/functional/report_viewer_api/test_run_data.py index 45da9075d9..c073719b1f 100644 --- a/tests/functional/report_viewer_api/test_run_data.py +++ b/tests/functional/report_viewer_api/test_run_data.py @@ -4,6 +4,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Analysis run related tests. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import unittest diff --git a/tests/functional/review_status/__init__.py b/tests/functional/review_status/__init__.py index a29e50037b..71ab0d3bc9 100644 --- a/tests/functional/review_status/__init__.py +++ b/tests/functional/review_status/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the test package review_status.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/review_status/test_review_status.py b/tests/functional/review_status/test_review_status.py index 15e0746273..2ff0658644 100644 --- a/tests/functional/review_status/test_review_status.py +++ b/tests/functional/review_status/test_review_status.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """ Test review status functionality.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import logging import os diff --git a/tests/functional/run_tag/__init__.py b/tests/functional/run_tag/__init__.py index 7b95adfa3d..57bccf1c8b 100644 --- a/tests/functional/run_tag/__init__.py +++ b/tests/functional/run_tag/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the test package detection_status.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/run_tag/test_run_tag.py b/tests/functional/run_tag/test_run_tag.py index 7d984f5839..9663212d24 100644 --- a/tests/functional/run_tag/test_run_tag.py +++ b/tests/functional/run_tag/test_run_tag.py @@ -5,6 +5,9 @@ # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- """ Run tag function test. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json import os diff --git a/tests/functional/skip/__init__.py b/tests/functional/skip/__init__.py index 200d929fda..9d6ddd525e 100644 --- a/tests/functional/skip/__init__.py +++ b/tests/functional/skip/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the package tests.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/skip/test_skip.py b/tests/functional/skip/test_skip.py index 0ba93abbd2..bb478a3bc5 100644 --- a/tests/functional/skip/test_skip.py +++ b/tests/functional/skip/test_skip.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """ skip function test. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import logging diff --git a/tests/functional/source_change/__init__.py b/tests/functional/source_change/__init__.py index c146a9e40c..3565d20a70 100644 --- a/tests/functional/source_change/__init__.py +++ b/tests/functional/source_change/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the package tests.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/source_change/test_source_change.py b/tests/functional/source_change/test_source_change.py index 57d9ba6d90..d9a2ca60c0 100644 --- a/tests/functional/source_change/test_source_change.py +++ b/tests/functional/source_change/test_source_change.py @@ -8,6 +8,9 @@ """ Tests for source file changes """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import time import unittest diff --git a/tests/functional/ssl/__init__.py b/tests/functional/ssl/__init__.py index 48cd14ddad..edfe3a9f0c 100644 --- a/tests/functional/ssl/__init__.py +++ b/tests/functional/ssl/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the package tests.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import multiprocessing import os diff --git a/tests/functional/ssl/test_ssl.py b/tests/functional/ssl/test_ssl.py index 1d37002c97..1896c3779d 100644 --- a/tests/functional/ssl/test_ssl.py +++ b/tests/functional/ssl/test_ssl.py @@ -7,6 +7,9 @@ """ SSL test. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import subprocess import unittest diff --git a/tests/functional/statistics/__init__.py b/tests/functional/statistics/__init__.py index d66aac68c9..5d04312888 100644 --- a/tests/functional/statistics/__init__.py +++ b/tests/functional/statistics/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the test package statistics.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/statistics/test_statistics.py b/tests/functional/statistics/test_statistics.py index b17bccc9a6..eed3871ae0 100644 --- a/tests/functional/statistics/test_statistics.py +++ b/tests/functional/statistics/test_statistics.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """ statistics collector feature test. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import unittest diff --git a/tests/functional/suppress/__init__.py b/tests/functional/suppress/__init__.py index 7ddd9e913c..f29b44d035 100644 --- a/tests/functional/suppress/__init__.py +++ b/tests/functional/suppress/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the package tests.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/suppress/test_suppress_generation.py b/tests/functional/suppress/test_suppress_generation.py index 22970e55b4..a4ce32a434 100644 --- a/tests/functional/suppress/test_suppress_generation.py +++ b/tests/functional/suppress/test_suppress_generation.py @@ -6,6 +6,9 @@ """ Test source-code level suppression data writing to suppress file. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import logging import os diff --git a/tests/functional/update/__init__.py b/tests/functional/update/__init__.py index a97e70ea6d..fd554c7ca3 100644 --- a/tests/functional/update/__init__.py +++ b/tests/functional/update/__init__.py @@ -6,6 +6,9 @@ # ----------------------------------------------------------------------------- """Setup for the package tests.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import shutil diff --git a/tests/functional/update/test_update_mode.py b/tests/functional/update/test_update_mode.py index 7679aed6c1..d576ed74b8 100644 --- a/tests/functional/update/test_update_mode.py +++ b/tests/functional/update/test_update_mode.py @@ -4,6 +4,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Test update mode where multiple analysis results stored in the same run. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import sys diff --git a/tests/libtest/codechecker.py b/tests/libtest/codechecker.py index f4318c4b89..4d0866b263 100644 --- a/tests/libtest/codechecker.py +++ b/tests/libtest/codechecker.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Helper commands to run CodeChecker in the tests easier. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json from libcodechecker import util diff --git a/tests/libtest/debug_printer.py b/tests/libtest/debug_printer.py index 87b3452c5b..3d738172f7 100644 --- a/tests/libtest/debug_printer.py +++ b/tests/libtest/debug_printer.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Helper functions for tests. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import def print_run_results(run_results): diff --git a/tests/libtest/env.py b/tests/libtest/env.py index 6d608fbd5b..aa34ce8f96 100644 --- a/tests/libtest/env.py +++ b/tests/libtest/env.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Test environment setup and configuration helpers. +""" +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division from hashlib import sha256 import os @@ -14,9 +20,9 @@ import subprocess import sys -from thrift_client_to_db import get_auth_client -from thrift_client_to_db import get_product_client -from thrift_client_to_db import get_viewer_client +from .thrift_client_to_db import get_auth_client +from .thrift_client_to_db import get_product_client +from .thrift_client_to_db import get_viewer_client from functional import PKG_ROOT from functional import REPO_ROOT diff --git a/tests/libtest/project.py b/tests/libtest/project.py index 8c1c4df509..0e40751a42 100644 --- a/tests/libtest/project.py +++ b/tests/libtest/project.py @@ -3,6 +3,13 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Test project helpers. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import + import os import json import shlex diff --git a/tests/libtest/result_compare.py b/tests/libtest/result_compare.py index 94f5f65536..765467df97 100644 --- a/tests/libtest/result_compare.py +++ b/tests/libtest/result_compare.py @@ -7,6 +7,9 @@ """ Result comparison helper functions for the tests. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import def compare_res_with_bug(run_res, bug): diff --git a/tests/libtest/thrift_client_to_db.py b/tests/libtest/thrift_client_to_db.py index 2b3b86aa46..350fdc0580 100644 --- a/tests/libtest/thrift_client_to_db.py +++ b/tests/libtest/thrift_client_to_db.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Various Thrift api helpers for the tests. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import from functools import partial import os diff --git a/tests/performance/run_server_performance_test.py b/tests/performance/run_server_performance_test.py index 4ca4af750a..164a2b6cc7 100644 --- a/tests/performance/run_server_performance_test.py +++ b/tests/performance/run_server_performance_test.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +Performance tester for the server. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import csv diff --git a/tests/tools/add_unicode_comment.py b/tests/tools/add_unicode_comment.py index 3c77ff7562..1af0a96581 100644 --- a/tests/tools/add_unicode_comment.py +++ b/tests/tools/add_unicode_comment.py @@ -6,6 +6,9 @@ # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import os import re diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index a5bf699279..124ecd0869 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -1,9 +1,16 @@ -# ----------------------------------------------------------------------------- -# The CodeChecker Infrastructure -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# ----------------------------------------------------------------------------- -import sys - -# Add the generated thrift files for the unit tests. -sys.path.append("build/thrift/v6/gen-py/") +# ----------------------------------------------------------------------------- +# The CodeChecker Infrastructure +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# ----------------------------------------------------------------------------- +""" +Setup python modules for the unit tests. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import + +import sys + +# Add the generated thrift files for the unit tests. +sys.path.append("build/thrift/v6/gen-py/") diff --git a/tests/unit/test_buildcmd_escaping.py b/tests/unit/test_buildcmd_escaping.py index 49c5f76cbc..2e0a957e9f 100644 --- a/tests/unit/test_buildcmd_escaping.py +++ b/tests/unit/test_buildcmd_escaping.py @@ -5,6 +5,9 @@ # ----------------------------------------------------------------------------- """Test the build commands escaping and execution.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import json import os diff --git a/tests/unit/test_ccldap.py b/tests/unit/test_ccldap.py index 74997569ed..15ac2b4021 100644 --- a/tests/unit/test_ccldap.py +++ b/tests/unit/test_ccldap.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +""" +Unit tests for LDAP. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import unittest diff --git a/tests/unit/test_gcc_toolchain.py b/tests/unit/test_gcc_toolchain.py index 8502019f38..7124ff99eb 100644 --- a/tests/unit/test_gcc_toolchain.py +++ b/tests/unit/test_gcc_toolchain.py @@ -6,6 +6,9 @@ """ Clang gcc-toolchain compiler option related tests. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import shlex import unittest diff --git a/tests/unit/test_log_parser.py b/tests/unit/test_log_parser.py index ff91016d79..e7b6394118 100644 --- a/tests/unit/test_log_parser.py +++ b/tests/unit/test_log_parser.py @@ -5,6 +5,9 @@ # ----------------------------------------------------------------------------- """ Test the log parser which builds build actions from JSON CCDBs. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import unittest diff --git a/tests/unit/test_option_parser.py b/tests/unit/test_option_parser.py index 050ee6df79..76424019e8 100644 --- a/tests/unit/test_option_parser.py +++ b/tests/unit/test_option_parser.py @@ -5,6 +5,9 @@ # ----------------------------------------------------------------------------- """ Test the option parsing and filtering form the compilation commands. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import unittest diff --git a/tests/unit/test_plist_parser.py b/tests/unit/test_plist_parser.py index 6ee88b873b..2cca264d89 100644 --- a/tests/unit/test_plist_parser.py +++ b/tests/unit/test_plist_parser.py @@ -22,6 +22,9 @@ - Report hash is available """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import unittest diff --git a/tests/unit/test_report_path_hash.py b/tests/unit/test_report_path_hash.py index 51fc8f39d3..ca4762f621 100644 --- a/tests/unit/test_report_path_hash.py +++ b/tests/unit/test_report_path_hash.py @@ -4,6 +4,9 @@ # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- """ Test Store handler features. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import unittest diff --git a/tests/unit/test_request_routing.py b/tests/unit/test_request_routing.py index 2ea6a58088..3f870cdbf4 100644 --- a/tests/unit/test_request_routing.py +++ b/tests/unit/test_request_routing.py @@ -5,6 +5,9 @@ # ----------------------------------------------------------------------------- """ Unit tests for the request_routing module. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import unittest diff --git a/tests/unit/test_source_code_comment.py b/tests/unit/test_source_code_comment.py index 8e55d096ce..ffa1c5307b 100644 --- a/tests/unit/test_source_code_comment.py +++ b/tests/unit/test_source_code_comment.py @@ -7,6 +7,9 @@ # ----------------------------------------------------------------------------- """Tests for source code comments in source file.""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import unittest diff --git a/tests/unit/test_statistics_collectors.py b/tests/unit/test_statistics_collectors.py index 2b79152548..2bfbff6527 100644 --- a/tests/unit/test_statistics_collectors.py +++ b/tests/unit/test_statistics_collectors.py @@ -5,6 +5,9 @@ # ----------------------------------------------------------------------------- """ Unit tests for the statistics_collectors module. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import unittest diff --git a/tests/unit/test_store_handler.py b/tests/unit/test_store_handler.py index 2abcbcc869..9e151af2e7 100644 --- a/tests/unit/test_store_handler.py +++ b/tests/unit/test_store_handler.py @@ -4,6 +4,9 @@ # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- """ Test Store handler features. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import unittest diff --git a/tests/unit/test_subprocess_timeout.py b/tests/unit/test_subprocess_timeout.py index 17e57cef82..b7c22334ef 100644 --- a/tests/unit/test_subprocess_timeout.py +++ b/tests/unit/test_subprocess_timeout.py @@ -7,6 +7,9 @@ """ Test if the subprocess timeout watcher works properly. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import signal import subprocess diff --git a/tests/unit/test_tidy_output_converter.py b/tests/unit/test_tidy_output_converter.py index aca4d66a6a..2e27abac86 100644 --- a/tests/unit/test_tidy_output_converter.py +++ b/tests/unit/test_tidy_output_converter.py @@ -8,6 +8,9 @@ This module tests the correctness of the OutputParser and PListConverter, which used in sequence transform a Clang Tidy output file to a plist file. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import copy import os diff --git a/tests/unit/test_trim_path_prefix.py b/tests/unit/test_trim_path_prefix.py index f5e4271e4e..6f5c670e5c 100644 --- a/tests/unit/test_trim_path_prefix.py +++ b/tests/unit/test_trim_path_prefix.py @@ -5,6 +5,9 @@ # ----------------------------------------------------------------------------- """ Test cases to trim a path by using prefixes. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import unittest diff --git a/tests/unit/test_url_understanding.py b/tests/unit/test_url_understanding.py index 7b330fd260..6bbd9d3f95 100644 --- a/tests/unit/test_url_understanding.py +++ b/tests/unit/test_url_understanding.py @@ -5,6 +5,9 @@ # ----------------------------------------------------------------------------- """ Unit tests for understanding product URLs. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import unittest diff --git a/tests/unit/test_util_fileread.py b/tests/unit/test_util_fileread.py index 0a24840cdb..9c8fba636d 100644 --- a/tests/unit/test_util_fileread.py +++ b/tests/unit/test_util_fileread.py @@ -3,6 +3,12 @@ # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # ----------------------------------------------------------------------------- +""" +File reading tests. +""" +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import os import unittest diff --git a/tests/unit/unit_template.py b/tests/unit/unit_template.py index f6f4fca038..0aff8b0cf6 100644 --- a/tests/unit/unit_template.py +++ b/tests/unit/unit_template.py @@ -5,6 +5,9 @@ # ----------------------------------------------------------------------------- """ Unit tests for the $MODULE_NAME$ module. """ +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import unittest diff --git a/vendor/plist_to_html/plist_to_html/PlistToHtml.py b/vendor/plist_to_html/plist_to_html/PlistToHtml.py index ee814743af..448a3dc4d4 100755 --- a/vendor/plist_to_html/plist_to_html/PlistToHtml.py +++ b/vendor/plist_to_html/plist_to_html/PlistToHtml.py @@ -5,6 +5,9 @@ # License. See LICENSE.TXT for details. # ------------------------------------------------------------------------- +from __future__ import print_function +from __future__ import division +from __future__ import absolute_import import argparse import codecs import json