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
3560c025
Commit
3560c025
authored
Feb 27, 2015
by
E. Kolpakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SettingsService for accessing server-wide settings from XBlock
(cherry picked from commit aa3b9dc)
parent
7a6d9b27
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
12 deletions
+6
-12
cms/envs/aws.py
+2
-0
common/lib/xmodule/xmodule/settings_service.py
+0
-9
lms/djangoapps/lms_xblock/runtime.py
+2
-3
lms/envs/aws.py
+2
-0
No files found.
cms/envs/aws.py
View file @
3560c025
...
@@ -326,3 +326,5 @@ NOTIFICATION_MAX_LIST_SIZE = ENV_TOKENS.get('NOTIFICATION_MAX_LIST_SIZE', NOTIFI
...
@@ -326,3 +326,5 @@ NOTIFICATION_MAX_LIST_SIZE = ENV_TOKENS.get('NOTIFICATION_MAX_LIST_SIZE', NOTIFI
#date format the api will be formatting the datetime values
#date format the api will be formatting the datetime values
API_DATE_FORMAT
=
'
%
Y-
%
m-
%
d'
API_DATE_FORMAT
=
'
%
Y-
%
m-
%
d'
API_DATE_FORMAT
=
ENV_TOKENS
.
get
(
'API_DATE_FORMAT'
,
API_DATE_FORMAT
)
API_DATE_FORMAT
=
ENV_TOKENS
.
get
(
'API_DATE_FORMAT'
,
API_DATE_FORMAT
)
XBLOCK_SETTINGS
=
ENV_TOKENS
.
get
(
'XBLOCK_SETTINGS'
,
{})
common/lib/xmodule/xmodule/settings_service.py
deleted
100644 → 0
View file @
7a6d9b27
"""
XBlock service to allow to access the server settings
"""
from
django.conf
import
settings
class
SettingsService
(
object
):
def
get
(
self
,
setting_name
):
return
getattr
(
settings
,
setting_name
)
lms/djangoapps/lms_xblock/runtime.py
View file @
3560c025
...
@@ -5,16 +5,15 @@ Module implementing `xblock.runtime.Runtime` functionality for the LMS
...
@@ -5,16 +5,15 @@ Module implementing `xblock.runtime.Runtime` functionality for the LMS
import
re
import
re
import
xblock.reference.plugins
import
xblock.reference.plugins
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.conf
import
settings
from
django.conf
import
settings
from
lms.djangoapps.lms_xblock.models
import
XBlockAsidesConfig
from
lms.djangoapps.lms_xblock.models
import
XBlockAsidesConfig
from
openedx.core.djangoapps.user_api.api
import
course_tag
as
user_course_tag_api
from
openedx.core.djangoapps.user_api.api
import
course_tag
as
user_course_tag_api
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
xmodule.services
import
SettingsService
from
xmodule.library_tools
import
LibraryToolsService
from
xmodule.library_tools
import
LibraryToolsService
from
xmodule.x_module
import
ModuleSystem
from
xmodule.x_module
import
ModuleSystem
from
xmodule.partitions.partitions_service
import
PartitionService
from
xmodule.partitions.partitions_service
import
PartitionService
from
xmodule.settings_service
import
SettingsService
def
_quote_slashes
(
match
):
def
_quote_slashes
(
match
):
...
@@ -259,7 +258,6 @@ class LmsModuleSystem(LmsHandlerUrls, LmsCourse, LmsUser, ModuleSystem): # pyli
...
@@ -259,7 +258,6 @@ class LmsModuleSystem(LmsHandlerUrls, LmsCourse, LmsUser, ModuleSystem): # pyli
"""
"""
def
__init__
(
self
,
**
kwargs
):
def
__init__
(
self
,
**
kwargs
):
services
=
kwargs
.
setdefault
(
'services'
,
{})
services
=
kwargs
.
setdefault
(
'services'
,
{})
services
[
'settings'
]
=
SettingsService
()
services
[
'user_tags'
]
=
UserTagsService
(
self
)
services
[
'user_tags'
]
=
UserTagsService
(
self
)
services
[
'partitions'
]
=
LmsPartitionService
(
services
[
'partitions'
]
=
LmsPartitionService
(
user
=
kwargs
.
get
(
'user'
),
user
=
kwargs
.
get
(
'user'
),
...
@@ -268,6 +266,7 @@ class LmsModuleSystem(LmsHandlerUrls, LmsCourse, LmsUser, ModuleSystem): # pyli
...
@@ -268,6 +266,7 @@ class LmsModuleSystem(LmsHandlerUrls, LmsCourse, LmsUser, ModuleSystem): # pyli
)
)
services
[
'library_tools'
]
=
LibraryToolsService
(
modulestore
())
services
[
'library_tools'
]
=
LibraryToolsService
(
modulestore
())
services
[
'fs'
]
=
xblock
.
reference
.
plugins
.
FSService
()
services
[
'fs'
]
=
xblock
.
reference
.
plugins
.
FSService
()
services
[
'settings'
]
=
SettingsService
()
self
.
request_token
=
kwargs
.
pop
(
'request_token'
,
None
)
self
.
request_token
=
kwargs
.
pop
(
'request_token'
,
None
)
super
(
LmsModuleSystem
,
self
)
.
__init__
(
**
kwargs
)
super
(
LmsModuleSystem
,
self
)
.
__init__
(
**
kwargs
)
...
...
lms/envs/aws.py
View file @
3560c025
...
@@ -573,3 +573,5 @@ NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS = ENV_TOKENS.get(
...
@@ -573,3 +573,5 @@ NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS = ENV_TOKENS.get(
NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS
NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS
)
)
NOTIFICATION_MAX_LIST_SIZE
=
ENV_TOKENS
.
get
(
'NOTIFICATION_MAX_LIST_SIZE'
,
NOTIFICATION_MAX_LIST_SIZE
)
NOTIFICATION_MAX_LIST_SIZE
=
ENV_TOKENS
.
get
(
'NOTIFICATION_MAX_LIST_SIZE'
,
NOTIFICATION_MAX_LIST_SIZE
)
XBLOCK_SETTINGS
=
ENV_TOKENS
.
get
(
'XBLOCK_SETTINGS'
,
{})
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