Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions manuskript/load_save/version_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,6 @@ def saveProject(zip=None):

# Removing phantoms
for path in [p for p in cache if p not in [p for p, c in files]]:
filename = os.path.join(dir, folder, path)
log("* Removing", path)

if os.path.isdir(filename):
shutil.rmtree(filename)

else: # elif os.path.exists(filename)
os.remove(filename)

# Clear cache
cache.pop(path, 0)
Expand Down Expand Up @@ -663,6 +655,9 @@ def loadProject(project, zip=None):
if f[-4:] in [".xml", "opml"]:
with open(os.path.join(dirpath, f), "rb") as fo:
files[os.path.join(p, f)] = fo.read()
elif f[-4:] in [".png", "jpeg",".jpg","bmp","tiff",".gif",".pdf"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should by configurable, I use often SVG images.

Also HTML Files often with research information or other filetypes. (bst -> bibtex and so on)

In the moment I store my Images in folder on the same level as the project-file (I do not us the zip/one-file mode!)... So I don't have this Problem.

# ignore file
pass
else:
with open(os.path.join(dirpath, f), "r", encoding="utf8") as fo:
files[os.path.join(p, f)] = fo.read()
Expand Down