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
54dc17bf
Commit
54dc17bf
authored
Aug 03, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start on lms migration path: view for loaded modules, and reload method
parent
9f4df44b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
0 deletions
+24
-0
common/lib/xmodule/xmodule/modulestore/xml.py
+11
-0
common/lib/xmodule/xmodule/x_module.py
+2
-0
lms/envs/dev.py
+5
-0
lms/urls.py
+6
-0
No files found.
common/lib/xmodule/xmodule/modulestore/xml.py
View file @
54dc17bf
...
...
@@ -146,6 +146,12 @@ class XMLModuleStore(ModuleStoreBase):
os
.
path
.
exists
(
self
.
data_dir
/
d
/
"course.xml"
)]
for
course_dir
in
course_dirs
:
self
.
try_load_course
(
course_dir
)
def
try_load_course
(
self
,
course_dir
):
'''
Load a course, keeping track of errors as we go along.
'''
try
:
# Special-case code here, since we don't have a location for the
# course before it loads.
...
...
@@ -159,6 +165,11 @@ class XMLModuleStore(ModuleStoreBase):
msg
=
"Failed to load course '
%
s'"
%
course_dir
log
.
exception
(
msg
)
def
__unicode__
(
self
):
'''
String representation - for debugging
'''
return
'<XMLModuleStore>data_dir=
%
s,
%
d courses,
%
d modules'
%
(
self
.
data_dir
,
len
(
self
.
courses
),
len
(
self
.
modules
))
def
load_course
(
self
,
course_dir
,
tracker
):
"""
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
54dc17bf
...
...
@@ -204,6 +204,8 @@ class XModule(HTMLSnippet):
'''
return
self
.
metadata
.
get
(
'display_name'
,
self
.
url_name
.
replace
(
'_'
,
' '
))
def
__unicode__
(
self
):
return
'<x_module(name=
%
s, category=
%
s, id=
%
s)>'
%
(
self
.
name
,
self
.
category
,
self
.
id
)
def
get_children
(
self
):
'''
...
...
lms/envs/dev.py
View file @
54dc17bf
...
...
@@ -58,6 +58,11 @@ CACHE_TIMEOUT = 0
# Dummy secret key for dev
SECRET_KEY
=
'85920908f28904ed733fe576320db18cabd7b6cd'
################################ LMS Migration #################################
MITX_FEATURES
[
'ENABLE_LMS_MIGRATION'
]
=
True
LMS_MIGRATION_ALLOWED_IPS
=
[
'any'
]
################################ OpenID Auth #################################
MITX_FEATURES
[
'AUTH_USE_OPENID'
]
=
True
MITX_FEATURES
[
'BYPASS_ACTIVATION_EMAIL_FOR_EXTAUTH'
]
=
True
...
...
lms/urls.py
View file @
54dc17bf
...
...
@@ -169,6 +169,12 @@ if settings.MITX_FEATURES.get('AUTH_USE_OPENID'):
url
(
r'^openid/logo.gif$'
,
'django_openid_auth.views.logo'
,
name
=
'openid-logo'
),
)
if
settings
.
MITX_FEATURES
.
get
(
'ENABLE_LMS_MIGRATION'
):
urlpatterns
+=
(
url
(
r'^migrate/modules$'
,
'lms_migration.migrate.manage_modulestores'
),
url
(
r'^migrate/reload/(?P<reload_dir>[^/]+)$'
,
'lms_migration.migrate.manage_modulestores'
),
)
urlpatterns
=
patterns
(
*
urlpatterns
)
if
settings
.
DEBUG
:
...
...
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