INCR-393: Updates on Python 3.x (#21054)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.8 on 2018-01-30 17:38
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"""
|
||||
Custom migration script to add slug field to all ProviderConfig models.
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.utils.text import slugify
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
paver commands
|
||||
"""
|
||||
from . import (
|
||||
assets, servers, docs, prereqs, quality, tests, js_test, i18n, bok_choy, database
|
||||
)
|
||||
from __future__ import absolute_import
|
||||
|
||||
from . import assets, bok_choy, database, docs, i18n, js_test, prereqs, quality, servers, tests
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
"""
|
||||
Tasks for controlling the databases used in tests
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from paver.easy import cmdopts, needs, task
|
||||
|
||||
from pavelib.utils.db_utils import (
|
||||
remove_files_from_folder, reset_test_db, compute_fingerprint_and_write_to_disk,
|
||||
fingerprint_bokchoy_db_files, does_fingerprint_on_disk_match, is_fingerprint_in_bucket,
|
||||
refresh_bokchoy_db_cache_from_s3, upload_db_cache_to_s3
|
||||
compute_fingerprint_and_write_to_disk,
|
||||
does_fingerprint_on_disk_match,
|
||||
fingerprint_bokchoy_db_files,
|
||||
is_fingerprint_in_bucket,
|
||||
refresh_bokchoy_db_cache_from_s3,
|
||||
remove_files_from_folder,
|
||||
reset_test_db,
|
||||
upload_db_cache_to_s3
|
||||
)
|
||||
from pavelib.utils.timer import timed
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Open edX Documentation Builder
|
||||
Ties into Sphinx to generate files at the specified location(s)
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import sys
|
||||
|
||||
@@ -22,7 +22,7 @@ def valid_doc_types():
|
||||
"""
|
||||
Return a comma-separated string of valid doc types.
|
||||
"""
|
||||
return ", ".join(DOC_PATHS.keys())
|
||||
return ", ".join(list(DOC_PATHS.keys()))
|
||||
|
||||
|
||||
def doc_path(options, allow_default=True):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Internationalization tasks
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import re
|
||||
import subprocess
|
||||
@@ -9,6 +9,7 @@ import sys
|
||||
|
||||
from path import Path as path
|
||||
from paver.easy import cmdopts, needs, sh, task
|
||||
from six.moves import input
|
||||
|
||||
from .utils.cmd import django_cmd
|
||||
from .utils.envs import Env
|
||||
@@ -220,7 +221,7 @@ def i18n_robot_pull():
|
||||
print("\n\nValidating translations with `i18n_tool validate`...")
|
||||
sh("i18n_tool validate")
|
||||
|
||||
con = raw_input("Continue with committing these translations (y/n)? ")
|
||||
con = input("Continue with committing these translations (y/n)? ")
|
||||
|
||||
if con.lower() == 'y':
|
||||
sh('git add conf/locale')
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
"""
|
||||
Check code quality using pycodestyle, pylint, and diff_quality.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
@@ -535,7 +536,7 @@ def run_xsslint(options):
|
||||
error_message = ""
|
||||
|
||||
# Test total violations against threshold.
|
||||
if 'total' in violation_thresholds.keys():
|
||||
if 'total' in list(violation_thresholds.keys()):
|
||||
if violation_thresholds['total'] < xsslint_counts['total']:
|
||||
error_message = u"Too many violations total ({count}).\nThe limit is {violations_limit}.".format(
|
||||
count=xsslint_counts['total'], violations_limit=violation_thresholds['total']
|
||||
|
||||
Reference in New Issue
Block a user