INCR-256 Run python-modernize on lms/djangoapps/debug (#20564)

* run python modernize

* run isort
This commit is contained in:
Stu Young
2019-05-21 11:37:47 -04:00
committed by Christie Rice
parent 367736614d
commit ea98e08362
2 changed files with 7 additions and 4 deletions

View File

@@ -7,10 +7,11 @@ each as a separate output file containing the json representation
of each of its fields (including those fields that are set as default values).
"""
from __future__ import print_function
from __future__ import absolute_import, print_function
import json
import six
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from path import Path as path
@@ -40,12 +41,12 @@ class Command(BaseCommand):
export_dir = path(args[0])
for course_id, course_modules in xml_module_store.modules.iteritems():
for course_id, course_modules in six.iteritems(xml_module_store.modules):
course_path = course_id.replace('/', '_')
for location, descriptor in course_modules.iteritems():
for location, descriptor in six.iteritems(course_modules):
location_path = text_type(location).replace('/', '_')
data = {}
for field_name, field in descriptor.fields.iteritems():
for field_name, field in six.iteritems(descriptor.fields):
try:
data[field_name] = field.read_json(descriptor)
except Exception as exc: # pylint: disable=broad-except

View File

@@ -1,5 +1,7 @@
"""Views for debugging and diagnostics"""
from __future__ import absolute_import
import pprint
import traceback