Dear list members
I have this python list that represets a sitemap:
tree = [{'indent': 1, 'title':'Item 1', 'hassubfolder':False},
{'indent': 1, 'title':'Item 2', 'hassubfolder':False},
{'indent': 1, 'title':'Folder 1', 'hassubfolder':True},
{'indent': 2, 'title':'Sub
On Wed, Jun 30, 2010 at 2:04 PM, Nico Grubert nicogrub...@yahoo.de wrote:
Dear list members
I have this python list that represets a sitemap:
tree = [{'indent': 1, 'title':'Item 1', 'hassubfolder':False},
{'indent': 1, 'title':'Item 2', 'hassubfolder':False},
{'indent': 1,
Nico Grubert, 30.06.2010 10:34:
I have this python list that represets a sitemap:
tree = [{'indent': 1, 'title':'Item 1', 'hassubfolder':False},
{'indent': 1, 'title':'Item 2', 'hassubfolder':False},
{'indent': 1, 'title':'Folder 1', 'hassubfolder':True},
{'indent': 2, 'title':'Sub Item 1.1',
Use a stack?
Whenever you start a new list, push the corresponding closing tag onto
a stack. Whenever your indent level decreases, pop the stack and
write out the closing tag you get.
It's straightforward to use a python list as a stack.
Thanks for the tip, Kushal.
Do you have a short code
Dear list members
I have this python list that represets a sitemap:
tree = [{'indent': 1, 'title':'Item 1', 'hassubfolder':False},
{'indent': 1, 'title':'Item 2', 'hassubfolder':False},
{'indent': 1, 'title':'Folder 1', 'hassubfolder':True},
{'indent': 2,
Nico Grubert wrote:
Use a stack?
Whenever you start a new list, push the corresponding closing tag onto
a stack. Whenever your indent level decreases, pop the stack and
write out the closing tag you get.
It's straightforward to use a python list as a stack.
Thanks for the tip, Kushal.
On Wed, 2010-06-30, Kushal Kumaran wrote:
On Wed, Jun 30, 2010 at 2:04 PM, Nico Grubert nicogrub...@yahoo.de wrote:
Dear list members
I have this python list that represets a sitemap:
tree = [{'indent': 1, 'title':'Item 1', 'hassubfolder':False},
{'indent': 1, 'title':'Item 2',
I have this python list that represets a sitemap:
tree = [{'indent': 1, 'title':'Item 1', 'hassubfolder':False},
{'indent': 1, 'title':'Item 2', 'hassubfolder':False},
{'indent': 1, 'title':'Folder 1', 'hassubfolder':True},
{'indent': 2, 'title':'Sub Item 1.1',