Fixing python-modernize issues.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
Asset compilation and collection.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
@@ -12,11 +12,12 @@ from datetime import datetime
|
||||
from functools import wraps
|
||||
from threading import Timer
|
||||
|
||||
import six
|
||||
from paver import tasks
|
||||
from paver.easy import call_task, cmdopts, consume_args, needs, no_help, path, sh, task
|
||||
from watchdog.events import PatternMatchingEventHandler
|
||||
from watchdog.observers.api import DEFAULT_OBSERVER_TIMEOUT
|
||||
from watchdog.observers import Observer
|
||||
from watchdog.observers.api import DEFAULT_OBSERVER_TIMEOUT
|
||||
|
||||
from openedx.core.djangoapps.theming.paver_helpers import get_theme_paths
|
||||
|
||||
@@ -110,7 +111,9 @@ def get_sass_directories(system, theme_dir=None):
|
||||
:param theme_dir: absolute path of theme for which to compile sass files.
|
||||
"""
|
||||
if system not in SYSTEMS:
|
||||
raise ValueError(u"'system' must be one of ({allowed_values})".format(allowed_values=', '.join(SYSTEMS.keys())))
|
||||
raise ValueError(u"'system' must be one of ({allowed_values})".format(
|
||||
allowed_values=', '.join(list(SYSTEMS.keys())))
|
||||
)
|
||||
system = SYSTEMS[system]
|
||||
|
||||
applicable_directories = list()
|
||||
@@ -822,7 +825,7 @@ def listfy(data):
|
||||
data: data structure to be converted.
|
||||
"""
|
||||
|
||||
if isinstance(data, basestring):
|
||||
if isinstance(data, six.string_types):
|
||||
data = data.split(',')
|
||||
elif not isinstance(data, list):
|
||||
data = [data]
|
||||
@@ -852,7 +855,7 @@ def watch_assets(options):
|
||||
themes = get_parsed_option(options, 'themes')
|
||||
theme_dirs = get_parsed_option(options, 'theme_dirs', [])
|
||||
|
||||
default_wait = [unicode(DEFAULT_OBSERVER_TIMEOUT)]
|
||||
default_wait = [six.text_type(DEFAULT_OBSERVER_TIMEOUT)]
|
||||
wait = float(get_parsed_option(options, 'wait', default_wait)[0])
|
||||
|
||||
if not theme_dirs and themes:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Run acceptance tests that use the bok-choy framework
|
||||
https://bok-choy.readthedocs.org/en/latest/
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import os
|
||||
|
||||
@@ -10,9 +10,7 @@ from paver.easy import cmdopts, needs, sh, task
|
||||
|
||||
from pavelib.utils.envs import Env
|
||||
from pavelib.utils.passthrough_opts import PassthroughTask
|
||||
from pavelib.utils.test.bokchoy_options import (
|
||||
BOKCHOY_OPTS,
|
||||
)
|
||||
from pavelib.utils.test.bokchoy_options import BOKCHOY_OPTS
|
||||
from pavelib.utils.test.suites.bokchoy_suite import BokChoyTestSuite
|
||||
from pavelib.utils.test.utils import check_firefox_version
|
||||
from pavelib.utils.timer import timed
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
"""
|
||||
Javascript test tasks
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import sys
|
||||
|
||||
from paver.easy import cmdopts, needs, task
|
||||
|
||||
from pavelib.utils.envs import Env
|
||||
from pavelib.utils.test.suites import JsTestSuite, JestSnapshotTestSuite
|
||||
from pavelib.utils.test.suites import JestSnapshotTestSuite, JsTestSuite
|
||||
from pavelib.utils.timer import timed
|
||||
|
||||
__test__ = False # do not collect
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
"""
|
||||
Tests for the Paver commands for updating test databases and its utility methods
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import tarfile
|
||||
from tempfile import mkdtemp
|
||||
import os
|
||||
from unittest import TestCase
|
||||
|
||||
import boto
|
||||
from mock import patch, call
|
||||
from mock import call, patch
|
||||
|
||||
from common.test.utils import MockS3Mixin
|
||||
from pavelib.utils.envs import Env
|
||||
from pavelib.utils.db_utils import (
|
||||
is_fingerprint_in_bucket, extract_files_from_zip,
|
||||
)
|
||||
from pavelib.utils import db_utils
|
||||
from pavelib import database
|
||||
from pavelib.utils import db_utils
|
||||
from pavelib.utils.db_utils import extract_files_from_zip, is_fingerprint_in_bucket
|
||||
from pavelib.utils.envs import Env
|
||||
|
||||
from .utils import PaverTestCase
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Tests for Paver's Stylelint tasks.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
|
||||
from mock import patch
|
||||
|
||||
@@ -2,14 +2,16 @@
|
||||
Tests covering the Open edX Paver prequisites installation workflow
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from mock import patch
|
||||
from paver.easy import BuildFailure
|
||||
|
||||
from pavelib.paver_tests.utils import PaverTestCase, fail_on_npm_install, unexpected_fail_on_npm_install
|
||||
import pavelib.prereqs
|
||||
from pavelib.paver_tests.utils import PaverTestCase, fail_on_npm_install, unexpected_fail_on_npm_install
|
||||
|
||||
|
||||
class TestPaverPrereqInstall(unittest.TestCase):
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Tests of the pavelib.utils.timer module.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from unittest import TestCase
|
||||
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
"""
|
||||
Install Python and Node prerequisites.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import hashlib
|
||||
import io
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import subprocess
|
||||
import io
|
||||
import sys
|
||||
from distutils import sysconfig
|
||||
|
||||
from paver.easy import BuildFailure, sh, task
|
||||
from six.moves import range
|
||||
|
||||
from .utils.envs import Env
|
||||
from .utils.timer import timed
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Run and manage servers for local development.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
"""
|
||||
Unit test tasks
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
Reference in New Issue
Block a user