This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #1 from open-craft/initial-implementation
Initial implementation
- Loading branch information
Showing
26 changed files
with
4,704 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
__pycache__/ | ||
*.py[cod] | ||
tests.integration.*.log | ||
tests.integration.*.png | ||
vectordraw_xblock.egg-info/ | ||
var/ |
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,19 @@ | ||
language: python | ||
python: | ||
- 2.7 | ||
before_install: | ||
- export DISPLAY=:99 | ||
- sh -e /etc/init.d/xvfb start | ||
install: | ||
- pip install -r test-requirements.txt | ||
- pip install -r $VIRTUAL_ENV/src/xblock-sdk/requirements/base.txt | ||
- pip install -r $VIRTUAL_ENV/src/xblock-sdk/requirements/test.txt | ||
- pip install -r $VIRTUAL_ENV/src/xblock/requirements.txt | ||
script: | ||
- pep8 --max-line-length=100 vectordraw | ||
- pylint vectordraw | ||
- ./run_tests.py --with-coverage --cover-package=vectordraw | ||
notifications: | ||
email: false | ||
addons: | ||
firefox: 36.0 |
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,19 @@ | ||
[REPORTS] | ||
reports=no | ||
|
||
[FORMAT] | ||
max-line-length=100 | ||
|
||
[MESSAGES CONTROL] | ||
disable= | ||
I, | ||
attribute-defined-outside-init, | ||
maybe-no-member, | ||
star-args, | ||
too-few-public-methods, | ||
too-many-ancestors, | ||
too-many-instance-attributes, | ||
too-many-public-methods | ||
|
||
[VARIABLES] | ||
dummy-variables-rgx=_$|dummy|unused |
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,3 @@ | ||
git+https://github.com/edx/[email protected]#egg=XBlock | ||
git+https://github.com/edx/xblock-utils.git@b4f9b51146c7fafa12f41d54af752b8f1516dffd#egg=xblock-utils | ||
-e . |
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,52 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
"""Run tests for the Vector Drawing XBlock. | ||
This script is required to run our selenium tests inside the xblock-sdk workbench | ||
because the workbench SDK's settings file is not inside any python module. | ||
""" | ||
|
||
import os | ||
import logging | ||
import sys | ||
|
||
from django.conf import settings | ||
from django.core.management import execute_from_command_line | ||
|
||
logging_level_overrides = { | ||
'workbench.views': logging.ERROR, | ||
'django.request': logging.ERROR, | ||
'workbench.runtime': logging.ERROR, | ||
} | ||
|
||
if __name__ == '__main__': | ||
# Use the workbench settings file: | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'workbench.settings') | ||
# Configure a range of ports in case the default port of 8081 is in use | ||
os.environ.setdefault('DJANGO_LIVE_TEST_SERVER_ADDRESS', 'localhost:8081-8099') | ||
|
||
try: | ||
os.mkdir('var') | ||
except OSError: | ||
# May already exist. | ||
pass | ||
|
||
settings.INSTALLED_APPS += ('vectordraw', ) | ||
|
||
for noisy_logger, log_level in logging_level_overrides.iteritems(): | ||
logging.getLogger(noisy_logger).setLevel(log_level) | ||
|
||
args_iter = iter(sys.argv[1:]) | ||
options = [] | ||
paths = [] | ||
for arg in args_iter: | ||
if arg == '--': | ||
break | ||
if arg.startswith('-'): | ||
options.append(arg) | ||
else: | ||
paths.append(arg) | ||
paths.extend(args_iter) | ||
if not paths: | ||
paths = ['tests/'] | ||
execute_from_command_line([sys.argv[0], 'test'] + options + ['--'] + paths) |
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,40 @@ | ||
"""Setup for vectordraw XBlock.""" | ||
|
||
import os | ||
from setuptools import setup | ||
|
||
|
||
def package_data(pkg, roots): | ||
"""Generic function to find package_data. | ||
All of the files under each of the `roots` will be declared as package | ||
data for package `pkg`. | ||
""" | ||
data = [] | ||
for root in roots: | ||
for dirname, _, files in os.walk(os.path.join(pkg, root)): | ||
for fname in files: | ||
data.append(os.path.relpath(os.path.join(dirname, fname), pkg)) | ||
|
||
return {pkg: data} | ||
|
||
|
||
setup( | ||
name='vectordraw-xblock', | ||
version='0.1', | ||
description='vectordraw XBlock', # TODO: write a better description. | ||
packages=[ | ||
'vectordraw', | ||
], | ||
install_requires=[ | ||
'XBlock', | ||
'xblock-utils', | ||
], | ||
entry_points={ | ||
'xblock.v1': [ | ||
'vectordraw = vectordraw:VectorDrawXBlock', | ||
] | ||
}, | ||
package_data=package_data("vectordraw", ["static", "public"]), | ||
) |
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 @@ | ||
Django>=1.8, <1.9 | ||
-r requirements.txt | ||
-e git+https://github.com/edx/xblock-sdk.git@8eb5f174dc59c0f4e40e10eaab56753958651d17#egg=xblock-sdk | ||
ddt | ||
selenium==2.47.3 # 2.48 is not working atm |
Empty file.
Empty file.
Oops, something went wrong.