Move import_from_xml to xmodule/modulestore

This commit is contained in:
Victor Shnayder
2012-07-19 18:19:00 -04:00
parent 3cc601b398
commit 60cba3d95f
6 changed files with 76 additions and 40 deletions

View File

@@ -5,7 +5,8 @@ from django.conf import settings
from fs.osfs import OSFS
from git import Repo, PushInfo
from contentstore import import_from_xml
from xmodule.modulestore.xml_importer import import_from_xml
from xmodule.modulestore.django import modulestore
from xmodule.modulestore import Location
from .exceptions import GithubSyncError
@@ -56,7 +57,8 @@ def import_from_github(repo_settings):
git_repo = setup_repo(repo_settings)
git_repo.head.reset('origin/%s' % repo_settings['branch'], index=True, working_tree=True)
module_store = import_from_xml(settings.GITHUB_REPO_ROOT, course_dirs=[course_dir])
module_store = import_from_xml(modulestore(),
settings.GITHUB_REPO_ROOT, course_dirs=[course_dir])
return git_repo.head.commit.hexsha, module_store.courses[course_dir]