From 17d29ad181d4177bf7a4120a876114c703ce1203 Mon Sep 17 00:00:00 2001 From: kthoden Date: Fri, 2 Aug 2019 16:26:56 +0200 Subject: [PATCH] collage handling --- imxml2django.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/imxml2django.py b/imxml2django.py index 0b82359..29258b7 100755 --- a/imxml2django.py +++ b/imxml2django.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- -# Time-stamp: <2019-07-31 14:46:18 (kthoden)> +# Time-stamp: <2019-08-02 16:25:56 (kthoden)> """ Create an XML file that can be inserted into the Django database @@ -416,7 +416,7 @@ def djangoParseObject(xmlElement, indent=False, listtype=None, listnumber=0, uid else: xmlEOAfigure.set("file", strImageFileDir + strImageFileName) - if figure_type == "hionly" or figure_type == "hionlycollage": + if figure_type == "hionly":# or figure_type == "hionlycollage": logging.debug(f"Found hyperimage figure ({figure_type}), no need for caption and size information.") pass else: @@ -426,10 +426,11 @@ def djangoParseObject(xmlElement, indent=False, listtype=None, listnumber=0, uid xmlResult.append(xmlEOAfigure) intObjectNumber += 1 # Insert visual Number and uid - strFigureNumber = dictFigures[xmlElement.find(".//anchor").get("id")] - xmlEOAfigure.set("number", strFigureNumber) - strFigureUID = xmlElement.find(".//anchor").get("id") - xmlEOAfigure.set("id", strFigureUID) + if figure_type != "hionlycollage": + strFigureNumber = dictFigures[xmlElement.find(".//anchor").get("id")] + xmlEOAfigure.set("number", strFigureNumber) + strFigureUID = xmlElement.find(".//anchor").get("id") + xmlEOAfigure.set("id", strFigureUID) hi_figure_types = ["hitrue", "hionly", "hionlycollage"]