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
7b71271b
Commit
7b71271b
authored
May 13, 2013
by
Steve Strassmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefix unused vars with _
parent
9b7374ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
cms/djangoapps/contentstore/views/assets.py
+6
-8
cms/djangoapps/contentstore/views/preview.py
+2
-2
No files found.
cms/djangoapps/contentstore/views/assets.py
View file @
7b71271b
...
@@ -176,7 +176,7 @@ def import_course(request, org, course, name):
...
@@ -176,7 +176,7 @@ def import_course(request, org, course, name):
# find the 'course.xml' file
# find the 'course.xml' file
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
course_dir
):
for
dirpath
,
_
dirnames
,
filenames
in
os
.
walk
(
course_dir
):
for
files
in
filenames
:
for
files
in
filenames
:
if
files
==
'course.xml'
:
if
files
==
'course.xml'
:
break
break
...
@@ -192,13 +192,11 @@ def import_course(request, org, course, name):
...
@@ -192,13 +192,11 @@ def import_course(request, org, course, name):
for
fname
in
os
.
listdir
(
dirpath
):
for
fname
in
os
.
listdir
(
dirpath
):
shutil
.
move
(
dirpath
/
fname
,
course_dir
)
shutil
.
move
(
dirpath
/
fname
,
course_dir
)
# var module_store is unused
_module_store
,
course_items
=
import_from_xml
(
modulestore
(
'direct'
),
settings
.
GITHUB_REPO_ROOT
,
# pylint: disable=W0612
[
course_subdir
],
load_error_modules
=
False
,
module_store
,
course_items
=
import_from_xml
(
modulestore
(
'direct'
),
settings
.
GITHUB_REPO_ROOT
,
static_content_store
=
contentstore
(),
[
course_subdir
],
load_error_modules
=
False
,
target_location_namespace
=
Location
(
location
),
static_content_store
=
contentstore
(),
draft_store
=
modulestore
())
target_location_namespace
=
Location
(
location
),
draft_store
=
modulestore
())
# we can blow this away when we're done importing.
# we can blow this away when we're done importing.
shutil
.
rmtree
(
course_dir
)
shutil
.
rmtree
(
course_dir
)
...
...
cms/djangoapps/contentstore/views/preview.py
View file @
7b71271b
...
@@ -96,7 +96,7 @@ def preview_module_system(request, preview_id, descriptor):
...
@@ -96,7 +96,7 @@ def preview_module_system(request, preview_id, descriptor):
return
ModuleSystem
(
return
ModuleSystem
(
ajax_url
=
reverse
(
'preview_dispatch'
,
args
=
[
preview_id
,
descriptor
.
location
.
url
(),
''
])
.
rstrip
(
'/'
),
ajax_url
=
reverse
(
'preview_dispatch'
,
args
=
[
preview_id
,
descriptor
.
location
.
url
(),
''
])
.
rstrip
(
'/'
),
# TODO (cpennington): Do we want to track how instructors are using the preview problems?
# TODO (cpennington): Do we want to track how instructors are using the preview problems?
track_function
=
lambda
type
,
event
:
None
,
track_function
=
lambda
event_
type
,
event
:
None
,
filestore
=
descriptor
.
system
.
resources_fs
,
filestore
=
descriptor
.
system
.
resources_fs
,
get_module
=
partial
(
get_preview_module
,
request
,
preview_id
),
get_module
=
partial
(
get_preview_module
,
request
,
preview_id
),
render_template
=
render_from_lms
,
render_template
=
render_from_lms
,
...
@@ -171,7 +171,7 @@ def get_module_previews(request, descriptor):
...
@@ -171,7 +171,7 @@ def get_module_previews(request, descriptor):
descriptor: An XModuleDescriptor
descriptor: An XModuleDescriptor
"""
"""
preview_html
=
[]
preview_html
=
[]
for
idx
,
(
instance_state
,
shared_state
)
in
enumerate
(
descriptor
.
get_sample_state
()):
for
idx
,
(
_instance_state
,
_
shared_state
)
in
enumerate
(
descriptor
.
get_sample_state
()):
module
=
load_preview_module
(
request
,
str
(
idx
),
descriptor
)
module
=
load_preview_module
(
request
,
str
(
idx
),
descriptor
)
preview_html
.
append
(
module
.
get_html
())
preview_html
.
append
(
module
.
get_html
())
return
preview_html
return
preview_html
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