Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
b57a5a60
Commit
b57a5a60
authored
Sep 26, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make xml exports more comparable by sorting and indenting json
parent
8acef4c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
common/lib/xmodule/xmodule/contentstore/mongo.py
+1
-1
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
+3
-3
No files found.
common/lib/xmodule/xmodule/contentstore/mongo.py
View file @
b57a5a60
...
...
@@ -167,7 +167,7 @@ class MongoContentStore(ContentStore):
policy
.
setdefault
(
asset
[
'asset_key'
]
.
name
,
{})[
attr
]
=
value
with
open
(
assets_policy_file
,
'w'
)
as
f
:
json
.
dump
(
policy
,
f
)
json
.
dump
(
policy
,
f
,
sort_keys
=
True
,
indent
=
4
)
def
get_all_content_thumbnails_for_course
(
self
,
course_key
):
return
self
.
_get_all_content_for_course
(
course_key
,
get_thumbnails
=
True
)[
0
]
...
...
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
View file @
b57a5a60
...
...
@@ -97,12 +97,12 @@ def export_to_xml(modulestore, contentstore, course_key, root_dir, course_dir):
# export the grading policy
course_run_policy_dir
=
policies_dir
.
makeopendir
(
course
.
location
.
name
)
with
course_run_policy_dir
.
open
(
'grading_policy.json'
,
'w'
)
as
grading_policy
:
grading_policy
.
write
(
dumps
(
course
.
grading_policy
,
cls
=
EdxJSONEncoder
))
grading_policy
.
write
(
dumps
(
course
.
grading_policy
,
cls
=
EdxJSONEncoder
,
sort_keys
=
True
,
indent
=
4
))
# export all of the course metadata in policy.json
with
course_run_policy_dir
.
open
(
'policy.json'
,
'w'
)
as
course_policy
:
policy
=
{
'course/'
+
course
.
location
.
name
:
own_metadata
(
course
)}
course_policy
.
write
(
dumps
(
policy
,
cls
=
EdxJSONEncoder
))
course_policy
.
write
(
dumps
(
policy
,
cls
=
EdxJSONEncoder
,
sort_keys
=
True
,
indent
=
4
))
#### DRAFTS ####
# xml backed courses don't support drafts!
...
...
@@ -178,7 +178,7 @@ def _export_field_content(xblock_item, item_dir):
# filename format: {dirname}.{field_name}.json
with
item_dir
.
open
(
'{0}.{1}.{2}'
.
format
(
xblock_item
.
location
.
name
,
field_name
,
'json'
),
'w'
)
as
field_content_file
:
field_content_file
.
write
(
dumps
(
module_data
.
get
(
field_name
,
{}),
cls
=
EdxJSONEncoder
))
field_content_file
.
write
(
dumps
(
module_data
.
get
(
field_name
,
{}),
cls
=
EdxJSONEncoder
,
sort_keys
=
True
,
indent
=
4
))
def
export_extra_content
(
export_fs
,
modulestore
,
course_key
,
category_type
,
dirname
,
file_suffix
=
''
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment