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
fff37828
Commit
fff37828
authored
Nov 26, 2012
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleave xlint entry point in xml_importer.py to be separate from the import method
parent
d2109536
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
cms/djangoapps/contentstore/management/commands/xlint.py
+2
-2
common/lib/xmodule/xmodule/modulestore/xml_importer.py
+11
-6
No files found.
cms/djangoapps/contentstore/management/commands/xlint.py
View file @
fff37828
from
django.core.management.base
import
BaseCommand
,
CommandError
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.modulestore.xml_importer
import
perform_xlint
from
xmodule.modulestore.django
import
modulestore
from
xmodule.contentstore.django
import
contentstore
...
...
@@ -25,4 +25,4 @@ class Command(BaseCommand):
print
"Importing. Data_dir={data}, course_dirs={courses}"
.
format
(
data
=
data_dir
,
courses
=
course_dirs
)
import_from_xml
(
None
,
data_dir
,
course_dirs
,
load_error_modules
=
False
,
validate_only
=
Tru
e
)
perform_xlint
(
data_dir
,
course_dirs
,
load_error_modules
=
Fals
e
)
common/lib/xmodule/xmodule/modulestore/xml_importer.py
View file @
fff37828
...
...
@@ -88,7 +88,7 @@ def verify_content_links(module, base_dir, static_content_store, link, remap_dic
def
import_from_xml
(
store
,
data_dir
,
course_dirs
=
None
,
default_class
=
'xmodule.raw_module.RawDescriptor'
,
load_error_modules
=
True
,
static_content_store
=
None
,
target_location_namespace
=
None
,
validate_only
=
False
):
load_error_modules
=
True
,
static_content_store
=
None
,
target_location_namespace
=
None
):
"""
Import the specified xml data_dir into the "store" modulestore,
using org and course as the location org and course.
...
...
@@ -110,10 +110,6 @@ def import_from_xml(store, data_dir, course_dirs=None,
load_error_modules
=
load_error_modules
)
if
validate_only
:
perform_xlint
(
data_dir
,
course_dirs
,
module_store
)
return
module_store
,
[]
# NOTE: the XmlModuleStore does not implement get_items() which would be a preferable means
# to enumerate the entire collection of course modules. It will be left as a TBD to implement that
# method on XmlModuleStore.
...
...
@@ -243,10 +239,19 @@ def validate_data_source_paths(data_dir, course_dir):
return
err_cnt
,
warn_cnt
def
perform_xlint
(
data_dir
,
course_dirs
,
module_store
):
def
perform_xlint
(
data_dir
,
course_dirs
,
default_class
=
'xmodule.raw_module.RawDescriptor'
,
load_error_modules
=
True
):
err_cnt
=
0
warn_cnt
=
0
module_store
=
XMLModuleStore
(
data_dir
,
default_class
=
default_class
,
course_dirs
=
course_dirs
,
load_error_modules
=
load_error_modules
)
# check all data source path information
for
course_dir
in
course_dirs
:
_err_cnt
,
_warn_cnt
=
validate_data_source_paths
(
path
(
data_dir
),
course_dir
)
...
...
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