From a73a964e51247ed169d322c725a3a18859f109a3 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Mon, 14 Jun 2021 00:00:37 +0000 Subject: python, hg: tow outside the environment. they've served us well, and can ride off into the sunset. --- sys/src/cmd/python/Doc/lib/minidom-example.py | 64 --------------------------- 1 file changed, 64 deletions(-) delete mode 100644 sys/src/cmd/python/Doc/lib/minidom-example.py (limited to 'sys/src/cmd/python/Doc/lib/minidom-example.py') diff --git a/sys/src/cmd/python/Doc/lib/minidom-example.py b/sys/src/cmd/python/Doc/lib/minidom-example.py deleted file mode 100644 index c30c4e08a..000000000 --- a/sys/src/cmd/python/Doc/lib/minidom-example.py +++ /dev/null @@ -1,64 +0,0 @@ -import xml.dom.minidom - -document = """\ - -Demo slideshow -Slide title -This is a demo -Of a program for processing slides - - -Another demo slide -It is important -To have more than -one slide - - -""" - -dom = xml.dom.minidom.parseString(document) - -def getText(nodelist): - rc = "" - for node in nodelist: - if node.nodeType == node.TEXT_NODE: - rc = rc + node.data - return rc - -def handleSlideshow(slideshow): - print "" - handleSlideshowTitle(slideshow.getElementsByTagName("title")[0]) - slides = slideshow.getElementsByTagName("slide") - handleToc(slides) - handleSlides(slides) - print "" - -def handleSlides(slides): - for slide in slides: - handleSlide(slide) - -def handleSlide(slide): - handleSlideTitle(slide.getElementsByTagName("title")[0]) - handlePoints(slide.getElementsByTagName("point")) - -def handleSlideshowTitle(title): - print "%s" % getText(title.childNodes) - -def handleSlideTitle(title): - print "

%s

" % getText(title.childNodes) - -def handlePoints(points): - print "" - -def handlePoint(point): - print "
  • %s
  • " % getText(point.childNodes) - -def handleToc(slides): - for slide in slides: - title = slide.getElementsByTagName("title")[0] - print "

    %s

    " % getText(title.childNodes) - -handleSlideshow(dom) -- cgit v1.2.3