Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow figure in info box
  • Loading branch information
kthoden committed Sep 7, 2020
1 parent a897d79 commit f19896c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/imxml2django.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2020-09-04 19:15:08 (kthoden)>
# Time-stamp: <2020-09-07 10:28:32 (kthoden)>

"""
Create an XML file that can be inserted into the Django database
Expand Down Expand Up @@ -319,7 +319,7 @@ def djangoParseObject(xmlElement, indent=False, listtype=None, listnumber=0, uid
arg2 = OUTPUT_DIR / "images/embedded" / (strImageFileDir + strImageFileName),
)

# strCommand = GM_PATH + " convert " + os.getcwd() + "/" + strImageFileString + " -resize 250x250\\> " + os.getcwd() + "/CONVERT/django/images/embedded/" + strImageFileDir + strImageFileName

listArguments = shlex.split(strCommand)
subprocess.check_output(listArguments, shell=False)
tmpStrTail = xmlFigure.tail
Expand Down Expand Up @@ -357,6 +357,9 @@ def djangoParseObject(xmlElement, indent=False, listtype=None, listnumber=0, uid
PUBLICATION_DIR / strImageFileString,
OUTPUT_DIR / "images" / (strImageFileDir + strImageFileName)
)
style_attribute = xmlElement.get("style")
if style_attribute is not None:
xmlEOAfigure.set("style", style_attribute)
xmlEOAfigure.set("file", strImageFileDir + strImageFileName)
xmlEOAfigure.set("width", xmlElement.find(".//width").text + "px;")
xmlEOAfigure.set("order", str(intObjectNumber))
Expand Down

0 comments on commit f19896c

Please sign in to comment.