diff --git a/manuskript/loadSave.py b/manuskript/loadSave.py index 908bc37..93ede03 100644 --- a/manuskript/loadSave.py +++ b/manuskript/loadSave.py @@ -39,10 +39,16 @@ def loadProject(project): isZip = False # Does it have a VERSION in zip root? + # Was used in transition between 0.2.0 and 0.3.0 + # So VERSION part can be deleted for manuskript 0.4.0 if isZip and "VERSION" in zf.namelist(): version = int(zf.read("VERSION")) - # Zip but no VERSION: oldest file format + # Does it have a MANUSKRIPT in zip root? + elif isZip and "MANUSKRIPT" in zf.namelist(): + version = int(zf.read("MANUSKRIPT")) + + # Zip but no VERSION/MANUSKRIPT: oldest file format elif isZip: version = 0 diff --git a/manuskript/load_save/version_1.py b/manuskript/load_save/version_1.py index 3e64670..913dffc 100644 --- a/manuskript/load_save/version_1.py +++ b/manuskript/load_save/version_1.py @@ -118,9 +118,8 @@ def saveProject(zip=None): mw = mainWindow() - if zip: - # File format version - files.append(("VERSION", "1")) + # File format version + files.append(("MANUSKRIPT", "1")) # General infos (book and author) # Saved in plain text, in infos.txt @@ -378,10 +377,6 @@ def saveProject(zip=None): if os.path.isdir(filename): shutil.rmtree(filename) - elif path == "VERSION": - # If loading from zip, but saving to path, file VERSION is not needed. - continue - else: # elif os.path.exists(filename) os.remove(filename) diff --git a/sample-projects/book-of-acts/MANUSKRIPT b/sample-projects/book-of-acts/MANUSKRIPT new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/sample-projects/book-of-acts/MANUSKRIPT @@ -0,0 +1 @@ +1 \ No newline at end of file