MCPcopy
hub / github.com/iBaa/PlexConnect / XML_ExpandTree

Function XML_ExpandTree

XMLConverter.py:449–469  ·  view source on GitHub ↗
(CommandCollection, elem, src, srcXML)

Source from the content-addressed store, hash-verified

447
448
449def XML_ExpandTree(CommandCollection, elem, src, srcXML):
450 # unpack template 'COPY'/'CUT' command in children
451 res = False
452 while True:
453 if list(elem)==[]: # no sub-elements, stop recursion
454 break
455
456 for child in elem:
457 res = XML_ExpandNode(CommandCollection, elem, child, src, srcXML, 'TEXT')
458 if res==True: # tree modified: restart from 1st elem
459 break # "for child"
460
461 # recurse into children
462 XML_ExpandTree(CommandCollection, child, src, srcXML)
463
464 res = XML_ExpandNode(CommandCollection, elem, child, src, srcXML, 'TAIL')
465 if res==True: # tree modified: restart from 1st elem
466 break # "for child"
467
468 if res==False: # complete tree parsed with no change, stop recursion
469 break # "while True"
470
471
472

Callers 4

XML_PMS2aTVFunction · 0.85
TREE_COPYMethod · 0.85
TREE_COPY_PLAYLISTMethod · 0.85
XMLConverter.pyFile · 0.85

Calls 1

XML_ExpandNodeFunction · 0.85

Tested by

no test coverage detected