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
0eeb8289
Commit
0eeb8289
authored
Jun 28, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used dictionary update for cleaner course settings code.
parent
de0a3710
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
lms/djangoapps/courseware/course_settings.py
+6
-8
No files found.
lms/djangoapps/courseware/course_settings.py
View file @
0eeb8289
...
...
@@ -64,11 +64,11 @@ global_settings_json = """
class
Settings
(
object
):
def
__init__
(
self
):
#Load the global settings as a dictionary
#
Load the global settings as a dictionary
global_settings
=
json
.
loads
(
global_settings_json
)
#Load the course settings as a dictionary
#
Load the course settings as a dictionary
course_settings
=
{}
try
:
with
open
(
settings
.
DATA_DIR
+
"/course_settings.json"
)
as
course_settings_file
:
...
...
@@ -78,15 +78,13 @@ class Settings(object):
log
.
warning
(
"Unable to load course settings file from "
+
str
(
settings
.
DATA_DIR
)
+
"/course_settings.json"
)
#First, set the properties from the global settings on ourselves
# Override any global settings with the course settings
global_settings
.
update
(
course_settings
)
# Now, set the properties from the course settings on ourselves
for
setting
in
global_settings
:
setting_value
=
global_settings
[
setting
]
setattr
(
self
,
setting
,
setting_value
)
#Now, set the properties from the course settings on ourselves, possibly overriding global values
for
setting
in
course_settings
:
setting_value
=
course_settings
[
setting
]
setattr
(
self
,
setting
,
setting_value
)
# Here is where we should parse any configurations, so that we can fail early
self
.
GRADER
=
graders
.
grader_from_conf
(
self
.
GRADER
)
...
...
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