Trying another method of parsing the meta string

This commit is contained in:
Veronica K. B. Olsen
2020-06-12 17:45:27 +02:00
parent 06ac3bdaba
commit 5358bf5e6b
+10 -14
View File
@@ -226,21 +226,17 @@ class NWDoc():
break
theClass = nwItemClass.NO_CLASS
for aClass in nwItemClass:
if theMeta.startswith(aClass.name):
theClass = aClass
theMeta = theMeta.lstrip(aClass.name+":")
theLayout = nwItemLayout.NO_LAYOUT
theData = theMeta.split(":")
for aLayout in nwItemLayout:
if theMeta.startswith(aLayout.name):
theLayout = aLayout
theMeta = theMeta.lstrip(aLayout.name+":")
if (n := len(theData)) > 1:
if theData[0] in nwItemClass.__members__:
theClass = nwItemClass[theData[0]]
if n > 2:
if theData[1] in nwItemLayout.__members__:
theLayout = nwItemLayout[theData[1]]
theName = theData[2]
else:
theName = theData[1]
else:
theName = theData[0]
return theName, thePath, theClass, theLayout
return theMeta, thePath, theClass, theLayout
# END Class NWDoc