INCR-256 Run python-modernize on lms/djangoapps/debug (#20564)
* run python modernize * run isort
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""Views for debugging and diagnostics"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import pprint
|
||||
import traceback
|
||||
|
||||
|
||||
Reference in New Issue
Block a user