parent and children array
This commit is contained in:
parent
5059a15826
commit
bca529f3c3
@ -110,9 +110,6 @@ class WPMenu:
|
||||
if href == "{0}://{1}/".format(self._protocol_canalblog, self._canalblog):
|
||||
parent = "home"
|
||||
itemMenu = {"id":"", "type":"", "title": parent, "children":list()}
|
||||
|
||||
|
||||
#menu = self._child(parent, parent)
|
||||
if href == "#":
|
||||
li = anchor.find("ul").find_all("li")
|
||||
for child in li:
|
||||
@ -122,13 +119,16 @@ class WPMenu:
|
||||
menu.append(itemMenu)
|
||||
|
||||
|
||||
for i in range(0, len(children)-1):
|
||||
self._logger.info("{0} : Child {1}".format(self._name, children[i]))
|
||||
for j in range(0, len(menu)-1):
|
||||
if menu[j]["title"] == children[i]["title"]:
|
||||
self._logger.info("{0} : Parent {1}".format(self._name, menu[j]))
|
||||
del menu[j]
|
||||
for j in range(0, len(menu)-1):
|
||||
for i in range(0, len(children)):
|
||||
self._logger.info("{0} : Child {1} {2}".format(self._name, children[i], i))
|
||||
for j in range(0, len(menu)):
|
||||
if j < len(menu):
|
||||
if menu[j]["title"] == children[i]["title"]:
|
||||
self._logger.info("{0} : Parent {1} {2}".format(self._name, menu[j], j))
|
||||
del menu[j]
|
||||
|
||||
for j in range(0, len(menu)):
|
||||
self._logger.info("{0} : Children for : {1}".format(self._name, menu[j]["title"]))
|
||||
if menu[j]["title"] == children[i]["parent"]:
|
||||
menu[j]["children"].append({"id":"", "title":children[i]["title"], "parent": children[i]["parent"]})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user