Skip to content

Commit 6064190

Browse files
committed
added info logging when setting platform of fonttable to Windows when running on linux
1 parent b09630b commit 6064190

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pycdxml/cdxml_converter/chemdraw_types.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def from_bytes(property_bytes: bytes, charset='iso-8859-1', fonttable=None) -> '
102102
# In that case get_charset will be off by 2 bytes and determine a font id which does not exist in the
103103
# document. hence we catch that here and re-read bytes assuming no style runs at all + ascii charset
104104
# I have only observed this in newer files from ChemDraw 21.
105-
# Potential issue: if the byte offset happens to by accident lead to a valid font, the problem will
105+
# Potential issue: if the byte offset happens to lead by accident to a valid font, the problem will
106106
# emerge somewhere else (possibly only after visual inspection of the file). this is however unlikley to happen
107107
# as font_ids usually are around 1-10 which happen to be ASCII control characters unlikely to be at the
108108
# start of a string
@@ -367,6 +367,7 @@ def from_element(fonttable: ET.Element) -> 'CDXFontTable':
367367
os_type = CDXFontTable.PLATFORM_MAC
368368
else:
369369
# running on linux / not supported -> set to windows
370+
logger.info("Detected Linux OS. Setting cdx file platform type to default of 'Windows'.")
370371
os_type = CDXFontTable.PLATFORM_WINDOWS
371372
return CDXFontTable(os_type, fonts)
372373

0 commit comments

Comments
 (0)