Unverified Commit d7d046fd by M. Rehan Committed by GitHub

Merge pull request #79 from edx/mrehan/improve-logging

Improve logging and add an option to run 3play translations.
parents e86f0a80 b7a9eaf3
......@@ -962,6 +962,11 @@ def handle_video_translations(video, translations, file_id, api_key, log_prefix)
translation_state = translation_metadata['state']
target_language = translation_metadata['target_language_iso_639_1_code']
LOGGER.info(
'[3PlayMedia Task] Translation metadata retrieved -- video=%s, translation_id=%s, language=%s, status=%s.',
video.studio_id, translation_id, target_language, translation_state
)
if translation_state == COMPLETE:
# Fetch the corresponding tracking process.
translation_process = get_in_progress_translation_process(
......@@ -1016,6 +1021,11 @@ def handle_video_translations(video, translations, file_id, api_key, log_prefix)
provider=TranscriptProvider.THREE_PLAY,
)
LOGGER.info(
'[3PlayMedia Task] Translation retrieval was successful -- video=%s, translation_id=%s, language=%s.',
video.studio_id, translation_id, target_language
)
# 5 - if all the processes for this video are complete, update transcript status
# for video in edx-val as well as edx-video-pipeline.
video_jobs = TranscriptProcessMetadata.objects.filter(video=video)
......
......@@ -51,7 +51,8 @@ def main():
{cmd} -i veda_id
{cmd} -c course_id
{cmd} -s schedule
[-i -c -s]
{cmd} --process-translations
[-i -c -s --process-translations]
Use --help to see all options.
'''.format(cmd=sys.argv[0])
......@@ -71,12 +72,27 @@ def main():
action='store_true'
)
parser.add_argument(
'--process-translations',
dest='process_translations',
help='Retrieves completed 3PlayMedia translations for the videos.',
action='store_true'
)
args = parser.parse_args()
veda_id = args.veda_id
course_id = args.course_id
schedule = args.schedule
process_translations = args.process_translations
if process_translations:
# Only kick off a round of retrieving successful
# translations from 3Play Media
os.environ['DJANGO_SETTINGS_MODULE'] = 'VEDA.settings.production'
retrieve_three_play_translations()
return
print '%s - %s: %s' % ('Healing', 'VEDA ID', veda_id)
print '%s - %s: %s' % ('Healing', 'Course', course_id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment