You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FileInfo section in imported EDS is not kept when exporting EDS #302
When an EDS file is imported by import_eds() method the FileInfo section is stored in od._edsFileInfo.
However, if the object dictionary is then stored as a new eds file using export_eds() method, then the FileInfo section is lost.
The reason seems to be indentation level of four lines in export_eds():
try:
# only if eds was loaded by us
origFileInfo = od.__edsFileInfo
except AttributeError:
origFileInfo = {
# just set some defaults
"CreationDate": defmtime.strftime("%m-%d-%Y"),
"CreationTime": defmtime.strftime("%I:%m%p"),
"EdsVersion": 4.2,
}
file_info.setdefault("ModificationDate", defmtime.strftime("%m-%d-%Y")) # This line,
file_info.setdefault("ModificationTime", defmtime.strftime("%I:%m%p")) # this line,
for k, v in origFileInfo.items(): # this line
file_info.setdefault(k, v) # and this line
# should decrease indentation level by 1
eds.add_section("FileInfo")
for k, v in file_info.items():
eds.set("FileInfo", k, v)
file_info is an empty dicitionary that is populated ony if __edsFileInfo does not exist as an attribute to od.
If __edsFileInfo exists, then file_info remains empty and no FileInfo section will be exported.
Activity
af-silva commentedon Mar 18, 2022
fix by #303