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
df0e3e64
Commit
df0e3e64
authored
Jan 12, 2015
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pylint fixes to make diff-quality happy
parent
7f1b60b2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
common/lib/xmodule/xmodule/modulestore/django.py
+0
-1
common/lib/xmodule/xmodule/modulestore/mixed.py
+3
-3
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+4
-4
common/lib/xmodule/xmodule/modulestore/tests/utils.py
+1
-1
common/lib/xmodule/xmodule/modulestore/xml.py
+4
-3
No files found.
common/lib/xmodule/xmodule/modulestore/django.py
View file @
df0e3e64
...
...
@@ -14,7 +14,6 @@ from django.core.cache import get_cache, InvalidCacheBackendError
import
django.utils
import
re
import
threading
from
xmodule.util.django
import
get_current_request_hostname
import
xmodule.modulestore
# pylint: disable=unused-import
...
...
common/lib/xmodule/xmodule/modulestore/mixed.py
View file @
df0e3e64
...
...
@@ -314,7 +314,7 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
:param course_key: must be a CourseKey
"""
assert
(
isinstance
(
course_key
,
CourseKey
)
)
assert
isinstance
(
course_key
,
CourseKey
)
store
=
self
.
_get_modulestore_for_courseid
(
course_key
)
try
:
return
store
.
get_course
(
course_key
,
depth
=
depth
,
**
kwargs
)
...
...
@@ -351,7 +351,7 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
* ignore_case (bool): If True, do a case insensitive search. If
False, do a case sensitive search
"""
assert
(
isinstance
(
course_id
,
CourseKey
)
)
assert
isinstance
(
course_id
,
CourseKey
)
store
=
self
.
_get_modulestore_for_courseid
(
course_id
)
return
store
.
has_course
(
course_id
,
ignore_case
,
**
kwargs
)
...
...
@@ -359,7 +359,7 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
"""
See xmodule.modulestore.__init__.ModuleStoreWrite.delete_course
"""
assert
(
isinstance
(
course_key
,
CourseKey
)
)
assert
isinstance
(
course_key
,
CourseKey
)
store
=
self
.
_get_modulestore_for_courseid
(
course_key
)
return
store
.
delete_course
(
course_key
,
user_id
)
...
...
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
df0e3e64
...
...
@@ -281,7 +281,7 @@ class CachingDescriptorSystem(MakoDescriptorSystem, EditInfoRuntimeMixin):
# decache any computed pending field settings
module
.
save
()
return
module
except
:
except
Exception
:
# pylint: disable=broad-except
log
.
warning
(
"Failed to load descriptor from
%
s"
,
json_data
,
exc_info
=
True
)
return
ErrorDescriptor
.
from_json
(
json_data
,
...
...
@@ -937,7 +937,7 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase, Mongo
"""
Get the course with the given courseid (org/course/run)
"""
assert
(
isinstance
(
course_key
,
CourseKey
)
)
assert
isinstance
(
course_key
,
CourseKey
)
course_key
=
self
.
fill_in_run
(
course_key
)
location
=
course_key
.
make_usage_key
(
'course'
,
course_key
.
run
)
try
:
...
...
@@ -954,7 +954,7 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase, Mongo
If ignore_case is True, do a case insensitive search,
otherwise, do a case sensitive search
"""
assert
(
isinstance
(
course_key
,
CourseKey
)
)
assert
isinstance
(
course_key
,
CourseKey
)
if
isinstance
(
course_key
,
LibraryLocator
):
return
None
# Libraries require split mongo
course_key
=
self
.
fill_in_run
(
course_key
)
...
...
@@ -1606,7 +1606,7 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase, Mongo
elif
isinstance
(
course_assets
[
'assets'
],
list
):
# This record is in the old course assets format.
# Ensure that no data exists before updating the format.
assert
(
len
(
course_assets
[
'assets'
])
==
0
)
assert
len
(
course_assets
[
'assets'
])
==
0
# Update the format to a dict.
self
.
asset_collection
.
update
(
{
'_id'
:
doc_id
},
...
...
common/lib/xmodule/xmodule/modulestore/tests/utils.py
View file @
df0e3e64
...
...
@@ -77,7 +77,7 @@ class MixedSplitTestCase(TestCase):
Stripped-down version of ModuleStoreTestCase that can be used without Django
(i.e. for testing in common/lib/ ). Sets up MixedModuleStore and Split.
"""
RENDER_TEMPLATE
=
lambda
t_n
,
d
,
ctx
=
None
,
nsp
=
'main'
:
u'{}: {}, {}'
.
format
(
t_n
,
repr
(
d
),
repr
(
ctx
))
RENDER_TEMPLATE
=
lambda
t_n
,
d
,
ctx
=
None
,
nsp
=
'main'
:
u'{}: {}, {}'
.
format
(
t_n
,
repr
(
d
),
repr
(
ctx
))
modulestore_options
=
{
'default_class'
:
'xmodule.raw_module.RawDescriptor'
,
'fs_root'
:
DATA_DIR
,
...
...
common/lib/xmodule/xmodule/modulestore/xml.py
View file @
df0e3e64
...
...
@@ -64,7 +64,8 @@ class ImportSystem(XMLParsingSystem, MakoDescriptorSystem):
self
.
unnamed
=
defaultdict
(
int
)
# category -> num of new url_names for that category
self
.
used_names
=
defaultdict
(
set
)
# category -> set of used url_names
# cdodge: adding the course_id as passed in for later reference rather than having to recomine the org/course/url_name
# Adding the course_id as passed in for later reference rather than
# having to recombine the org/course/url_name
self
.
course_id
=
course_id
self
.
load_error_modules
=
load_error_modules
self
.
modulestore
=
xmlstore
...
...
@@ -304,8 +305,8 @@ class XMLModuleStore(ModuleStoreReadBase):
default_class (str): dot-separated string defining the default descriptor
class to use if none is specified in entry_points
course_dirs or course_ids (list of str): If specified, the list of course_dirs or course_ids to load.
Otherwise,
load all courses. Note, providing both
course_dirs or course_ids (list of str): If specified, the list of course_dirs or course_ids to load.
Otherwise,
load all courses. Note, providing both
"""
super
(
XMLModuleStore
,
self
)
.
__init__
(
**
kwargs
)
...
...
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