def override(self, edx_relative_path, dst_path): """Copy edx-platform template (from openfun/fork branch) to destination file""" self.log_override(dst_path, os.path.join(self.edx_repo_path, edx_relative_path)) with cd(self.edx_repo_path): file_content = subprocess.check_output([ 'git', 'show', "{}:{}".format(self.branch, edx_relative_path) ]) with open(os.path.join(dst_path), 'w') as fun_file: fun_file.write(file_content)
def compile_messages(path, locale): from fun.utils.context import cd, setenv import subprocess with cd(path): with setenv("DJANGO_SETTINGS_MODULE", None): subprocess.call(["/edx/app/edxapp/venvs/edxapp/bin/django-admin.py", "compilemessages", "-l", locale])