diff --git a/cms/djangoapps/contentstore/views/item.py b/cms/djangoapps/contentstore/views/item.py index 0a85eb7765..ff0596d1d0 100644 --- a/cms/djangoapps/contentstore/views/item.py +++ b/cms/djangoapps/contentstore/views/item.py @@ -67,7 +67,7 @@ def xblock_handler(request, tag=None, course_id=None, branch=None, version_guid= to None! Absent ones will be left alone. :nullout: which metadata fields to set to None :graderType: change how this unit is graded - :publish: can be one of three values, 'make_public, 'make_private', or 'create_draft' + :publish: can be one of three values, 'make_public, 'make_private', or 'create_draft' The JSON representation on the updated xblock (minus children) is returned. if xblock locator is not specified, create a new xblock instance. The json playload can contain diff --git a/cms/djangoapps/contentstore/views/tabs.py b/cms/djangoapps/contentstore/views/tabs.py index cf0ab42ffb..0cbfb0ac96 100644 --- a/cms/djangoapps/contentstore/views/tabs.py +++ b/cms/djangoapps/contentstore/views/tabs.py @@ -40,7 +40,7 @@ def initialize_course_tabs(course): {"type": "discussion", "name": _("Discussion")}, {"type": "wiki", "name": _("Wiki")}, {"type": "progress", "name": _("Progress")}, - ] + ] modulestore('direct').update_metadata(course.location.url(), own_metadata(course)) diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py index 2d6ba84118..3c17f52d4a 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py @@ -28,6 +28,7 @@ MAX_SCORE = 1 FILE_NOT_FOUND_IN_RESPONSE_MESSAGE = "We could not find a file in your submission. Please try choosing a file or pasting a link to your file into the answer box." ERROR_SAVING_FILE_MESSAGE = "We are having trouble saving your file. Please try another file or paste a link to your file into the answer box." + def upload_to_s3(file_to_upload, keyname, s3_interface): ''' Upload file to S3 using provided keyname. diff --git a/common/test/data/splitmongo_json/structures.json b/common/test/data/splitmongo_json/structures.json index 00d5c7892b..644df803b4 100644 --- a/common/test/data/splitmongo_json/structures.json +++ b/common/test/data/splitmongo_json/structures.json @@ -68,7 +68,7 @@ "definition":{ "$oid" : "cd00000000000000dddd0020"}, "fields":{ "children":[ - + ], "display_name":"Hercules" }, @@ -86,7 +86,7 @@ "definition":{ "$oid" : "cd00000000000000dddd0022"}, "fields":{ "children":[ - + ], "display_name":"Hera heckles Hercules" }, @@ -123,7 +123,7 @@ "definition":{ "$oid" : "0d00000040000000dddd0031"}, "fields":{ "children":[ - + ], "display_name":"Problem 3.1", "graceperiod":"4 hours 0 minutes 0 seconds" @@ -142,7 +142,7 @@ "definition":{ "$oid" : "0d00000040000000dddd0032"}, "fields":{ "children":[ - + ], "display_name":"Problem 3.2" }, @@ -172,7 +172,7 @@ "definition":{ "$oid" : "ad00000000000000dddd0001"}, "fields":{ "children":[ - + ], "end":"2013-04-13T04:30", "tabs":[ @@ -236,7 +236,7 @@ "definition":{ "$oid" : "ad00000000000000dddd0010"}, "fields":{ "children":[ - + ], "end":null, "tabs":[ @@ -290,7 +290,7 @@ "definition":{ "$oid" : "ad00000000000000dddd0020"}, "fields":{ "children":[ - + ], "end":null, "tabs":[ @@ -326,7 +326,7 @@ "$date":1364481313238 } } - + } } }, @@ -345,7 +345,7 @@ "definition":{ "$oid" : "2d00000000000000dddd0020"}, "fields":{ "children":[ - + ], "end":null, "tabs":[ @@ -399,7 +399,7 @@ "definition":{ "$oid" : "ad00000000000000dddd0020"}, "fields":{ "children":[ - + ], "end":null, "tabs":[ @@ -453,7 +453,7 @@ "definition":{ "$oid" : "3d00000000000000dddd0020"}, "fields":{ "children":[ - + ], "end":null, "tabs":[ diff --git a/docs/data/source/course_data_formats/conditional_module/conditional_module.rst b/docs/data/source/course_data_formats/conditional_module/conditional_module.rst index c0c3a3c338..b5ec2063a8 100644 --- a/docs/data/source/course_data_formats/conditional_module/conditional_module.rst +++ b/docs/data/source/course_data_formats/conditional_module/conditional_module.rst @@ -23,7 +23,7 @@ be specified for this tag:: sources - location id of required modules, separated by ';' [message | ""] - message for case, where one or more are not passed. Here you can use variable {link}, which generate link to required module. - + [submitted] - map to `is_submitted` module method. (pressing RESET button makes this function to return False.) @@ -77,4 +77,4 @@ Examples of conditional depends on problem You see this, cause "lec27_Q1" is not attempted. - \ No newline at end of file + diff --git a/docs/developers/Makefile b/docs/developers/Makefile index faa8708cd4..486990c732 100644 --- a/docs/developers/Makefile +++ b/docs/developers/Makefile @@ -12,7 +12,7 @@ ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) endif -Q_FLAG = +Q_FLAG = ifeq ($(quiet), true) Q_FLAG = -Q diff --git a/docs/internal/mongo.md b/docs/internal/mongo.md index 5ce0362e95..9a84b0f7e8 100644 --- a/docs/internal/mongo.md +++ b/docs/internal/mongo.md @@ -1,5 +1,5 @@ # Notes on using mongodb backed LMS and CMS - + These are some random notes for developers, on how things are stored in mongodb, and how to debug mongodb data. ## Databases @@ -62,7 +62,7 @@ Under ubuntu, do: - apt-get install php5-fpm php-pear - pecl install mongo - - edit /etc/php5/fpm/php.ini to add "extension=mongo.so" + - edit /etc/php5/fpm/php.ini to add "extension=mongo.so" - /etc/init.d/php5-fpm restart and also setup nginx to run php through fastcgi. diff --git a/docs/internal/remote_gradebook.md b/docs/internal/remote_gradebook.md index 644105a76d..26326307e8 100644 --- a/docs/internal/remote_gradebook.md +++ b/docs/internal/remote_gradebook.md @@ -26,13 +26,13 @@ Each course, in addition, should define the name of the gradebook being used. A - user: username of staff person initiating the request (for logging) - section: (optional) name of section -The return body content should be a JSON string, of the format {'msg': message, 'data': data}. The message is displayed in the instructor dashboard. +The return body content should be a JSON string, of the format {'msg': message, 'data': data}. The message is displayed in the instructor dashboard. The data is a list of dicts (associative arrays). Each dict should be key:value. ## For submit=post-grades: -A file is also posted, with the field name "datafile". This file is CSV format, with two columns, one being "External email" and the other being the name of the assignment (that column contains the grades for the assignment). +A file is also posted, with the field name "datafile". This file is CSV format, with two columns, one being "External email" and the other being the name of the assignment (that column contains the grades for the assignment). ## For submit=get-assignments diff --git a/i18n/config.py b/i18n/config.py index 6f3e5d7773..0a50688dce 100644 --- a/i18n/config.py +++ b/i18n/config.py @@ -50,7 +50,7 @@ class Configuration: def dummy_locale(self): """ Returns a locale to use for the dummy text, e.g. 'eo'. - Throws exception if no dummy-locale is declared. + Throws exception if no dummy-locale is declared. The locale is a string. """ dummy = self._config.get('dummy-locale', None) diff --git a/i18n/generate.py b/i18n/generate.py index 65c65c00d6..1923d6b1a9 100755 --- a/i18n/generate.py +++ b/i18n/generate.py @@ -4,7 +4,7 @@ See https://edx-wiki.atlassian.net/wiki/display/ENG/PO+File+workflow - This task merges and compiles the human-readable .pofiles on the + This task merges and compiles the human-readable .pofiles on the local filesystem into machine-readable .mofiles. This is typically necessary as part of the build process since these .mofiles are needed by Django when serving the web app. @@ -21,6 +21,7 @@ from execute import execute LOG = logging.getLogger(__name__) + def merge(locale, target='django.po', fail_if_missing=True): """ For the given locale, merge django-partial.po, messages.po, mako.po -> django.po @@ -52,6 +53,7 @@ def merge(locale, target='django.po', fail_if_missing=True): django_filename = locale_directory.joinpath(target) os.rename(merged_filename, django_filename) # can't overwrite file on Windows + def clean_metadata(file): """ Clean up redundancies in the metadata caused by merging. @@ -59,6 +61,7 @@ def clean_metadata(file): """ pofile(file).save() + def validate_files(dir, files_to_merge): """ Asserts that the given files exist. @@ -71,7 +74,8 @@ def validate_files(dir, files_to_merge): if not pathname.exists(): raise Exception("I18N: Cannot generate because file not found: {0}".format(pathname)) -def main (): + +def main(): logging.basicConfig(stream=sys.stdout, level=logging.INFO) for locale in CONFIGURATION.locales: @@ -81,5 +85,6 @@ def main (): compile_cmd = 'django-admin.py compilemessages' execute(compile_cmd, working_directory=BASE_DIR) + if __name__ == '__main__': main() diff --git a/i18n/make_dummy.py b/i18n/make_dummy.py index 20eac03522..864f03c15f 100755 --- a/i18n/make_dummy.py +++ b/i18n/make_dummy.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # Generate test translation files from human-readable po files. -# +# # Dummy language is specified in configuration file (see config.py) # two letter language codes reference: # see http://www.loc.gov/standards/iso639-2/php/code_list.php @@ -28,6 +28,7 @@ from dummy import Dummy from config import CONFIGURATION from execute import create_dir_if_necessary + def main(file, locale): """ Takes a source po file, reads it, and writes out a new po file @@ -44,6 +45,7 @@ def main(file, locale): create_dir_if_necessary(new_file) pofile.save(new_file) + def new_filename(original_filename, new_locale): """Returns a filename derived from original_filename, using new_locale as the locale""" orig_dir = os.path.dirname(original_filename) @@ -57,10 +59,10 @@ def new_filename(original_filename, new_locale): if __name__ == '__main__': # required arg: file - if len(sys.argv)<2: + if len(sys.argv) < 2: raise Exception("missing file argument") # optional arg: locale - if len(sys.argv)<3: + if len(sys.argv) < 3: locale = CONFIGURATION.get_dummy_locale() else: locale = sys.argv[2] diff --git a/lms/djangoapps/courseware/tests/test_tabs.py b/lms/djangoapps/courseware/tests/test_tabs.py index e1c15d0df7..94ebe611f3 100644 --- a/lms/djangoapps/courseware/tests/test_tabs.py +++ b/lms/djangoapps/courseware/tests/test_tabs.py @@ -35,13 +35,13 @@ class ProgressTestCase(TestCase): self.assertEqual(tab_constructor(self.stagnation_page, self.course, self.anonymous_user), []) self.assertEqual(tab_constructor(self.progress_page, self.course, self.user)[0].name, 'same') - + tab_list = tab_constructor(self.progress_page, self.course, self.user) expected_link = reverse('progress', args=[self.course.id]) self.assertEqual(tab_list[0].link, expected_link) - + self.assertEqual(tab_constructor(self.stagnation_page, self.course, self.user)[0].is_active, False) - + self.assertEqual(tab_constructor(self.progress_page, self.course, self.user)[0].is_active, True) diff --git a/lms/djangoapps/dashboard/views.py b/lms/djangoapps/dashboard/views.py index 8d1f63b410..cefa41252b 100644 --- a/lms/djangoapps/dashboard/views.py +++ b/lms/djangoapps/dashboard/views.py @@ -12,7 +12,7 @@ def dictfetchall(cursor): desc = cursor.description table = [] table.append([col[0] for col in desc]) - + # ensure response from db is a list, not a tuple (which is returned # by MySQL backed django instances) rows_from_cursor=cursor.fetchall() @@ -27,7 +27,7 @@ def SQL_query_to_list(cursor, query_string): def dashboard(request): """ Slightly less hackish hack to show staff enrollment numbers and other - simple queries. + simple queries. All queries here should be indexed and simple. Mostly, this means don't touch courseware_studentmodule, as tempting as it may be. @@ -45,7 +45,7 @@ def dashboard(request): # count how many users we have results["scalars"]["Unique Usernames"]=User.objects.filter().count() results["scalars"]["Activated Usernames"]=User.objects.filter(is_active=1).count() - + # count how many enrollments we have results["scalars"]["Total Enrollments Across All Courses"] = CourseEnrollment.objects.filter(is_active=1).count() diff --git a/lms/djangoapps/django_comment_client/utils.py b/lms/djangoapps/django_comment_client/utils.py index a92797f7e6..5430ad5d54 100644 --- a/lms/djangoapps/django_comment_client/utils.py +++ b/lms/djangoapps/django_comment_client/utils.py @@ -117,7 +117,7 @@ def _filter_unstarted_categories(category_map): return result_map - + def _sort_map_entries(category_map, sort_alpha): things = [] for title, entry in category_map["entries"].items(): diff --git a/lms/envs/dev_ike.py b/lms/envs/dev_ike.py index 92c40b53e1..205b845b3a 100644 --- a/lms/envs/dev_ike.py +++ b/lms/envs/dev_ike.py @@ -51,4 +51,4 @@ MIDDLEWARE_CLASSES = tuple([mcl for mcl in MIDDLEWARE_CLASSES if not mcl.startsw TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', - ) +) diff --git a/lms/templates/discussion/_underscore_templates.html b/lms/templates/discussion/_underscore_templates.html index 854a53bdf0..e331a779a5 100644 --- a/lms/templates/discussion/_underscore_templates.html +++ b/lms/templates/discussion/_underscore_templates.html @@ -4,7 +4,7 @@ diff --git a/lms/templates/instructor/instructor_dashboard_2/send_email.html b/lms/templates/instructor/instructor_dashboard_2/send_email.html index ff9514ddbe..cb8afb88a1 100644 --- a/lms/templates/instructor/instructor_dashboard_2/send_email.html +++ b/lms/templates/instructor/instructor_dashboard_2/send_email.html @@ -33,8 +33,8 @@
  • -
    - ${ section_data['editor'] } +
  • diff --git a/lms/templates/instructor/instructor_dashboard_2/student_admin.html b/lms/templates/instructor/instructor_dashboard_2/student_admin.html index 57d8aba8e7..1ff3e2727c 100644 --- a/lms/templates/instructor/instructor_dashboard_2/student_admin.html +++ b/lms/templates/instructor/instructor_dashboard_2/student_admin.html @@ -30,7 +30,7 @@


    -

    ${_('Specify a particular problem in the course here by its url:')} +

    ${_('Specify a particular problem in the course here by its url:')}

    diff --git a/lms/templates/press.json b/lms/templates/press.json index 43c295b63e..794a0803f6 100644 --- a/lms/templates/press.json +++ b/lms/templates/press.json @@ -18,7 +18,7 @@ "publication": "The New York Times", "publish_date": "April 29, 2013" }, - + { "title": "Online Education Lifts Pass Rates at University", "url": "http://online.wsj.com/article/SB10001424127887323741004578414861572832182.html?mod=googlenews_wsj", @@ -80,7 +80,7 @@ "publish_date": "February 20, 2013" }, - + { "title": "Georgetown to offer free online courses", "url": "http://www.washingtonpost.com/local/education/georgetown-to-offer-free-online-courses/2012/12/09/365c4612-3fd3-11e2-bca3-aadc9b7e29c5_story.html", @@ -90,7 +90,7 @@ "publication": "The Washington Post", "publish_date": "December 9, 2012" }, - + { "title": "Wellesley College teams up with online provider edX", "url": "http://bostonglobe.com/2012/12/04/edx/AqnQ808q4IEcaUa8KuZuBO/story.html", @@ -136,7 +136,7 @@ "deck": null, "publication": "BBC", "publish_date": "October 31, 2012" - }, + }, { "title": "VMware to provide software for HarvardX CS50x", "url": "http://tech.mit.edu/V132/N48/edxvmware.html", diff --git a/lms/templates/static_templates/faq.html b/lms/templates/static_templates/faq.html index 9b90fd5c6c..4621b30323 100644 --- a/lms/templates/static_templates/faq.html +++ b/lms/templates/static_templates/faq.html @@ -62,7 +62,7 @@ Toronto="University of Toronto", ANU="Australian National University", Delft="Delft University of Technology", - Rice="Rice University", + Rice="Rice University", )}

    ${_("{EdX} will actively explore the addition of other institutions from around the world to the {edX} platform, and looks forward to adding more \"{X_Universities}\".").format(EdX="EdX", edX="edX", X_Universities="X Universities")}

    diff --git a/lms/templates/widgets/segment-io.html b/lms/templates/widgets/segment-io.html index 135a946811..3c6728bb16 100644 --- a/lms/templates/widgets/segment-io.html +++ b/lms/templates/widgets/segment-io.html @@ -29,4 +29,4 @@ }; -% endif \ No newline at end of file +% endif diff --git a/proxy/nginx.conf b/proxy/nginx.conf index 2b48e17d03..c349ccf826 100644 --- a/proxy/nginx.conf +++ b/proxy/nginx.conf @@ -1,4 +1,4 @@ -# Mapping of +# Mapping of # # From the /mitx directory: # /usr/local/Cellar/nginx/1.2.2/sbin/nginx -p `pwd`/ -c nginx.conf @@ -49,7 +49,7 @@ http { rewrite ^(.*)/favicon.ico$ /static/images/favicon.ico last; - # Our catchall + # Our catchall location / { proxy_pass http://portal; }