forked from openedx-unsupported/edx-notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openedx-unsupported#221 from edx/rebase-ironwood
Updating development with ironwood code base
- Loading branch information
Showing
156 changed files
with
2,093 additions
and
819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,42 @@ | ||
language: python | ||
python: | ||
- "2.7" | ||
|
||
matrix: | ||
include: | ||
- python: "2.7" | ||
env: DJANGO_SETTINGS_MODULE=settings | ||
script: | ||
- tox -e py27 | ||
- ./node_modules/gulp/bin/gulp.js test | ||
- bash ./run_bokchoy_tests.sh | ||
|
||
- python: "3.5" | ||
env: DJANGO_SETTINGS_MODULE=settings | ||
script: | ||
- tox -e py35 | ||
- ./node_modules/gulp/bin/gulp.js test | ||
- bash ./run_bokchoy_tests.sh | ||
|
||
addons: | ||
firefox: "46.0" | ||
firefox: "52.0.3" | ||
|
||
env: | ||
- DJANGO_SETTINGS_MODULE=settings | ||
services: | ||
- xvfb | ||
|
||
before_install: | ||
- wget "https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz" | ||
- tar xfz geckodriver-v0.24.0-linux64.tar.gz | ||
- sudo mv geckodriver /usr/local/bin | ||
- "export DISPLAY=:99.0" | ||
- "sh -e /etc/init.d/xvfb start" | ||
|
||
install: | ||
- npm install | ||
- "pip install -r requirements.txt" | ||
- "pip install -r test_requirements.txt" | ||
- "pip install -r requirements/base.txt" | ||
- "pip install -r requirements/testing.txt" | ||
- "pip install coveralls==1.1" | ||
|
||
script: | ||
- ./manage.py migrate --settings=testserver.settings | ||
- coverage run ./manage.py test edx_notifications | ||
- coverage report -m | ||
- ./node_modules/gulp/bin/gulp.js test | ||
- bash ./run_bokchoy_tests.sh | ||
- pep8 edx_notifications | ||
- pylint edx_notifications --report=no | ||
|
||
after_success: coveralls | ||
|
||
branches: | ||
only: | ||
- master | ||
- cdodge/mcka-master | ||
- cdodge/notification-digest | ||
- development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
include LICENSE | ||
include README.md | ||
include requirements/base.txt | ||
include requirements/testing.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade | ||
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in | ||
pip install -q pip-tools | ||
pip-compile --upgrade -o requirements/base.txt requirements/base.in | ||
pip-compile --upgrade -o requirements/testing.txt requirements/testing.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
""" | ||
Configuration for edx_notifications Django app | ||
""" | ||
from __future__ import absolute_import | ||
|
||
import logging | ||
|
||
from django.apps import AppConfig | ||
from django.conf import settings | ||
|
||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
class EdxNotificationsConfig(AppConfig): | ||
""" | ||
Configuration class for edx_notifications Django app | ||
""" | ||
name = 'edx_notifications' | ||
verbose_name = "Notification subsystem" | ||
|
||
def ready(self): | ||
if settings.FEATURES.get('ENABLE_NOTIFICATIONS', False): | ||
startup_notification_subsystem() | ||
|
||
|
||
def startup_notification_subsystem(): | ||
""" | ||
Initialize the Notification subsystem | ||
""" | ||
try: | ||
from openedx.core.djangoapps.course_groups.scope_resolver import CourseGroupScopeResolver # pylint: disable=import-error | ||
from student.scope_resolver import CourseEnrollmentsScopeResolver, StudentEmailScopeResolver # pylint: disable=import-error | ||
from edx_solutions_projects.scope_resolver import GroupProjectParticipantsScopeResolver # pylint: disable=import-error | ||
from edx_notifications.scopes import register_user_scope_resolver | ||
from edx_notifications.namespaces import register_namespace_resolver | ||
from util.namespace_resolver import CourseNamespaceResolver # pylint: disable=import-error, no-name-in-module | ||
from edx_notifications import startup | ||
|
||
startup.initialize() | ||
|
||
# register the scope resolvers that the runtime will be providing to edx-notifications. | ||
register_user_scope_resolver('course_enrollments', CourseEnrollmentsScopeResolver()) | ||
register_user_scope_resolver('course_group', CourseGroupScopeResolver()) | ||
register_user_scope_resolver('group_project_participants', GroupProjectParticipantsScopeResolver()) | ||
register_user_scope_resolver('group_project_workgroup', GroupProjectParticipantsScopeResolver()) | ||
register_user_scope_resolver('user_email_resolver', StudentEmailScopeResolver()) | ||
|
||
# register namespace resolver | ||
register_namespace_resolver(CourseNamespaceResolver()) | ||
except Exception as ex: # pylint: disable=broad-except | ||
# Note this will fail when we try to run migrations as manage.py will call startup.py | ||
# and startup.initialze() will try to manipulate some database tables. | ||
# We need to research how to identify when we are being started up as part of | ||
# a migration script | ||
log.error( | ||
'There was a problem initializing notifications subsystem. ' | ||
'This could be because the database tables have not yet been created and ' | ||
'./manage.py lms syncdb needs to run setup.py. Error was "%s". Continuing...', str(ex) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.