mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-04-30 11:02:28 +12:00
Minor tweak in file format
This commit is contained in:
parent
574660dc19
commit
cf6e021ed1
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
1
sample-projects/book-of-acts/MANUSKRIPT
Normal file
1
sample-projects/book-of-acts/MANUSKRIPT
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
Loading…
Reference in a new issue