Legend:
- Unmodified
- Added
- Removed
-
page.py
r30 r31 1 1 #!/usr/bin/env python 2 2 # -*- coding: utf-8 -*- 3 import sys 4 import string 3 import sys, string, xml.dom.minidom 5 4 try: 6 5 import gtk … … 18 17 string = widget.get_name() 19 18 # this must be modified if we change the string representation 20 array=string.split("\n\n",2) 21 return array 19 doc = xml.dom.minidom.parseString(string) 20 bmark = doc.getElementsByTagName("bookmark")[0] 21 stype = int(bmark.getAttribute("type")) 22 title = bmark.getAttribute("title") 23 return [title, stype, string] 22 24 23 25 def read_descr(string) : … … 55 57 zename='' 56 58 title='' 59 doc = xml.dom.minidom.Document() 60 bmark = doc.createElement("bookmark") 61 doc.appendChild(bmark) 57 62 if search_type == 1 : 63 bmark.setAttribute("type","1") 58 64 title = "bug #%s"%args 59 zename= "%s\n\n1\n\n%s" %(title,args) 65 bmark.setAttribute("title", title) 66 node = doc.createElement("bug") 67 node_text = doc.createTextNode(args) 68 node.appendChild(node_text) 69 bmark.appendChild(node) 60 70 elif search_type == 2 : 61 71 search = args["search"] 62 72 title = "%s" %search 63 zename = "%s\n\n2\n\n%s"%(title,search) 73 bmark.setAttribute("type","2") 74 bmark.setAttribute("title", title) 75 node = doc.createElement("search") 76 node_text = doc.createTextNode(search) 77 node.appendChild(node_text) 78 bmark.appendChild(node) 64 79 elif search_type == 3 : 80 bmark.setAttribute("type","3") 81 search = args["search"] 65 82 product = args["product"] 66 search = args["search"]67 83 if search == None : 68 84 title = "(%s)"%product 69 descr = product70 85 else : 71 86 title = "(%s) %s"%(product,search) 72 descr = "%s\n%s"%(product, search) 73 zename = "%s\n\n3\n\n%s"%(title,descr) 87 node = doc.createElement("search") 88 node_text = doc.createTextNode(search) 89 node.appendChild(node_text) 90 bmark.appendChild(node) 91 92 bmark.setAttribute("title", title) 93 prod = doc.createElement("product") 94 prod_text = doc.createTextNode(product) 95 prod.appendChild(prod_text) 96 bmark.appendChild(prod) 97 98 zename = doc.toxml() 74 99 return [title, zename] 75 100
