This commit adds all of cms. These keys are now objects with a limited interface, and the particular internal representation is managed by the data storage layer (the modulestore). For the LMS, there should be no outward-facing changes to the system. The keys are, for now, a change to internal representation only. For Studio, the new serialized form of the keys is used in urls, to allow for further migration in the future. Co-Author: Andy Armstrong <andya@edx.org> Co-Author: Christina Roberts <christina@edx.org> Co-Author: David Baumgold <db@edx.org> Co-Author: Diana Huang <dkh@edx.org> Co-Author: Don Mitchell <dmitchell@edx.org> Co-Author: Julia Hansbrough <julia@edx.org> Co-Author: Nimisha Asthagiri <nasthagiri@edx.org> Co-Author: Sarina Canelake <sarina@edx.org> [LMS-2370]
22 lines
571 B
Python
22 lines
571 B
Python
|
|
import ConfigParser
|
|
from django.conf import settings
|
|
|
|
config_file = open(settings.REPO_ROOT / "docs" / "config.ini")
|
|
config = ConfigParser.ConfigParser()
|
|
config.readfp(config_file)
|
|
|
|
|
|
def doc_url(request):
|
|
# in the future, we will detect the locale; for now, we will
|
|
# hardcode en_us, since we only have English documentation
|
|
locale = "en_us"
|
|
|
|
def get_doc_url(token):
|
|
try:
|
|
return config.get(locale, token)
|
|
except ConfigParser.NoOptionError:
|
|
return config.get(locale, "default")
|
|
|
|
return {"doc_url": get_doc_url}
|