From 3abd194cf9ce1603c9c0bb89674b805cc47dc8ce Mon Sep 17 00:00:00 2001 From: Hassan Date: Mon, 11 Mar 2024 10:41:52 -0500 Subject: [PATCH] chore: Fix imports. --- tubular/scripts/get_learners_to_retire.py | 3 +-- tubular/scripts/replace_usernames.py | 3 +-- tubular/scripts/retire_one_learner.py | 3 +-- tubular/scripts/retirement_archive_and_cleanup.py | 3 +-- tubular/scripts/retirement_bulk_status_update.py | 3 +-- tubular/scripts/retirement_partner_report.py | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tubular/scripts/get_learners_to_retire.py b/tubular/scripts/get_learners_to_retire.py index bc4d5fed..f88a4085 100755 --- a/tubular/scripts/get_learners_to_retire.py +++ b/tubular/scripts/get_learners_to_retire.py @@ -12,13 +12,12 @@ import click import yaml -from tubular.utils.deprecation import deprecated_script - # Add top-level module path to sys.path before importing tubular code. sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) from tubular.edx_api import LmsApi # pylint: disable=wrong-import-position from tubular.jenkins import export_learner_job_properties # pylint: disable=wrong-import-position +from tubular.utils.deprecation import deprecated_script logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) LOG = logging.getLogger(__name__) diff --git a/tubular/scripts/replace_usernames.py b/tubular/scripts/replace_usernames.py index 27827dc4..37d4fb95 100644 --- a/tubular/scripts/replace_usernames.py +++ b/tubular/scripts/replace_usernames.py @@ -17,12 +17,11 @@ import click import yaml -from tubular.utils.deprecation import deprecated_script - # Add top-level module path to sys.path before importing tubular code. sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) from tubular.edx_api import CredentialsApi, DiscoveryApi, EcommerceApi, LmsApi # pylint: disable=wrong-import-position +from tubular.utils.deprecation import deprecated_script logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) LOG = logging.getLogger(__name__) diff --git a/tubular/scripts/retire_one_learner.py b/tubular/scripts/retire_one_learner.py index 586f1a8f..f4811733 100755 --- a/tubular/scripts/retire_one_learner.py +++ b/tubular/scripts/retire_one_learner.py @@ -30,8 +30,6 @@ import click -from tubular.utils.deprecation import deprecated_script - # Add top-level module path to sys.path before importing tubular code. sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) @@ -45,6 +43,7 @@ _log, _setup_all_apis_or_exit ) +from tubular.utils.deprecation import deprecated_script # Return codes for various fail cases ERR_SETUP_FAILED = -1 diff --git a/tubular/scripts/retirement_archive_and_cleanup.py b/tubular/scripts/retirement_archive_and_cleanup.py index 5c868c69..d38fc980 100644 --- a/tubular/scripts/retirement_archive_and_cleanup.py +++ b/tubular/scripts/retirement_archive_and_cleanup.py @@ -19,8 +19,6 @@ from botocore.exceptions import BotoCoreError, ClientError from six import text_type -from tubular.utils.deprecation import deprecated_script - # Add top-level module path to sys.path before importing tubular code. sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) @@ -28,6 +26,7 @@ from tubular.scripts.helpers import ( _config_or_exit, _fail, _fail_exception, _log, _setup_lms_api_or_exit ) +from tubular.utils.deprecation import deprecated_script SCRIPT_SHORTNAME = 'Archive and Cleanup' diff --git a/tubular/scripts/retirement_bulk_status_update.py b/tubular/scripts/retirement_bulk_status_update.py index 4c512fe0..ed993e73 100755 --- a/tubular/scripts/retirement_bulk_status_update.py +++ b/tubular/scripts/retirement_bulk_status_update.py @@ -13,8 +13,6 @@ import click from six import text_type -from tubular.utils.deprecation import deprecated_script - # Add top-level module path to sys.path before importing tubular code. sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) @@ -26,6 +24,7 @@ _log, _setup_lms_api_or_exit ) +from tubular.utils.deprecation import deprecated_script SCRIPT_SHORTNAME = 'Bulk Status' diff --git a/tubular/scripts/retirement_partner_report.py b/tubular/scripts/retirement_partner_report.py index 3c2dd0dc..404b5d97 100755 --- a/tubular/scripts/retirement_partner_report.py +++ b/tubular/scripts/retirement_partner_report.py @@ -17,8 +17,6 @@ import click from six import text_type -from tubular.utils.deprecation import deprecated_script - # Add top-level module path to sys.path before importing tubular code. sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) @@ -31,6 +29,7 @@ _log, _setup_lms_api_or_exit ) +from tubular.utils.deprecation import deprecated_script # Return codes for various fail cases ERR_SETUP_FAILED = -1