mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
Bug corrected
This commit is contained in:
parent
468e2e0dd7
commit
a3f1d11324
|
@ -49,7 +49,7 @@ characterMap = OrderedDict([
|
||||||
])
|
])
|
||||||
|
|
||||||
# If true, logs infos while saving and loading.
|
# If true, logs infos while saving and loading.
|
||||||
LOG = False
|
LOG = True
|
||||||
|
|
||||||
def formatMetaData(name, value, tabLength=10):
|
def formatMetaData(name, value, tabLength=10):
|
||||||
|
|
||||||
|
@ -321,7 +321,8 @@ def saveProject(zip=None):
|
||||||
|
|
||||||
# If cache is empty (meaning we haven't loaded from disk), we wipe folder, just to be sure.
|
# If cache is empty (meaning we haven't loaded from disk), we wipe folder, just to be sure.
|
||||||
if not cache:
|
if not cache:
|
||||||
shutil.rmtree(os.path.join(dir, folder))
|
if os.path.exists(os.path.join(dir, folder)):
|
||||||
|
shutil.rmtree(os.path.join(dir, folder))
|
||||||
|
|
||||||
# Moving files that have been renamed
|
# Moving files that have been renamed
|
||||||
for old, new in moves:
|
for old, new in moves:
|
||||||
|
@ -897,8 +898,6 @@ def outlineFromMMD(text, parent):
|
||||||
# Store body
|
# Store body
|
||||||
item.setData(Outline.text.value, str(body))
|
item.setData(Outline.text.value, str(body))
|
||||||
|
|
||||||
# FIXME: add lastpath
|
|
||||||
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|
||||||
|
@ -920,10 +919,13 @@ def appendRevisions(mdl, root):
|
||||||
ID = root.attrib["ID"]
|
ID = root.attrib["ID"]
|
||||||
if not ID:
|
if not ID:
|
||||||
log("* Serious problem: no ID!")
|
log("* Serious problem: no ID!")
|
||||||
return
|
continue
|
||||||
|
|
||||||
# Find outline item in model
|
# Find outline item in model
|
||||||
item = mdl.getItemByID(ID)
|
item = mdl.getItemByID(ID)
|
||||||
|
if not item:
|
||||||
|
log("* Error: no item whose ID is", ID)
|
||||||
|
continue
|
||||||
|
|
||||||
# Store revision
|
# Store revision
|
||||||
log("* Appends revision ({}) to {}".format(child.attrib["timestamp"], item.title()))
|
log("* Appends revision ({}) to {}".format(child.attrib["timestamp"], item.title()))
|
||||||
|
@ -981,7 +983,7 @@ def parseMMDFile(text, asDict=False):
|
||||||
inBody = False
|
inBody = False
|
||||||
for s in text.split("\n"):
|
for s in text.split("\n"):
|
||||||
if not inBody:
|
if not inBody:
|
||||||
m = re.match(r"^(.*?):\s*(.*)$", s)
|
m = re.match(r"^([^\s].*?):\s*(.*)$", s)
|
||||||
if m:
|
if m:
|
||||||
# Commit last metadata
|
# Commit last metadata
|
||||||
if descr:
|
if descr:
|
||||||
|
|
Loading…
Reference in a new issue