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
b63f05b6
Commit
b63f05b6
authored
Aug 01, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update clean_xml script to use error trackers properly
parent
82899323
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
lms/djangoapps/courseware/management/commands/clean_xml.py
+10
-10
No files found.
lms/djangoapps/courseware/management/commands/clean_xml.py
View file @
b63f05b6
...
...
@@ -53,14 +53,12 @@ def import_with_checks(course_dir, verbose=True):
data_dir
=
course_dir
.
dirname
()
course_dirs
=
[
course_dir
.
basename
()]
(
error_tracker
,
errors
)
=
make_error_tracker
()
# No default class--want to complain if it doesn't find plugins for any
# module.
modulestore
=
XMLModuleStore
(
data_dir
,
default_class
=
None
,
eager
=
True
,
course_dirs
=
course_dirs
,
error_tracker
=
error_tracker
)
course_dirs
=
course_dirs
)
def
str_of_err
(
tpl
):
(
msg
,
exc_info
)
=
tpl
...
...
@@ -71,6 +69,15 @@ def import_with_checks(course_dir, verbose=True):
return
'{msg}
\n
{exc}'
.
format
(
msg
=
msg
,
exc
=
exc_str
)
courses
=
modulestore
.
get_courses
()
n
=
len
(
courses
)
if
n
!=
1
:
print
'ERROR: Expect exactly 1 course. Loaded {n}: {lst}'
.
format
(
n
=
n
,
lst
=
courses
)
return
(
False
,
None
)
course
=
courses
[
0
]
errors
=
modulestore
.
get_item_errors
(
course
.
location
)
if
len
(
errors
)
!=
0
:
all_ok
=
False
print
'
\n
'
...
...
@@ -80,13 +87,6 @@ def import_with_checks(course_dir, verbose=True):
print
"="
*
40
print
'
\n
'
n
=
len
(
courses
)
if
n
!=
1
:
print
'ERROR: Expect exactly 1 course. Loaded {n}: {lst}'
.
format
(
n
=
n
,
lst
=
courses
)
return
(
False
,
None
)
course
=
courses
[
0
]
#print course
validators
=
(
...
...
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