From 2849c7f3fad5c4c25f02a4194d2354da3c25e054 Mon Sep 17 00:00:00 2001 From: katkamrachana Date: Sun, 6 Aug 2017 17:10:42 +0530 Subject: [PATCH] pull transcript data/file with class in dump. --- .../gnowsys_ndf/ndf/management/commands/group_export.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/management/commands/group_export.py b/gnowsys-ndf/gnowsys_ndf/ndf/management/commands/group_export.py index 206f643965..7715c9b2eb 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/management/commands/group_export.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/management/commands/group_export.py @@ -348,6 +348,13 @@ def pick_media_from_content(content_soup): if data_ele: if 'media' in data_ele['data']: find_file_from_media_url(data_ele['data']) + + all_transcript_data = content_soup.find_all(attrs={'class':'transcript-data'}) + for each_transcript in all_transcript_data: + data_ele = each_transcript.findNext('object',data=True) + if data_ele: + if 'media' in data_ele['data']: + find_file_from_media_url(data_ele['data']) except Exception as pick_media_err: error_log = "\n !!! Error found in pick_media_from_content()." error_log += "\nError: " + str(pick_media_err) @@ -549,7 +556,7 @@ def handle(self, *args, **options): else: global DUMP_NODE_objS_LIST global TOP_PATH - datetimestamp = datetime.datetime.now().isoformat() + datetimestamp = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M") TOP_PATH = os.path.join(GSTUDIO_DATA_ROOT, 'data_export', slugify(dump_node_obj.name) + "_"+ str(datetimestamp)) SCHEMA_MAP_PATH = TOP_PATH UNIT_NAMES = []