- Timestamp:
- 07/10/06 16:44:02 (2 years ago)
- Files:
-
- 1 modified
-
storage/bookmarks_store.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
storage/bookmarks_store.py
r35 r36 62 62 self.listing.insert_before(None, [title, bmark.toxml()]) 63 63 return 1 64 65 def open_file(self,zefile) : 66 #programmation défensive needed ici !!! 67 # !!!!!!!! 68 array=[] 69 f = open(zefile,mode='r') 70 # sanitize the pretty XML 71 stringed = f.read().replace('\n','').replace('\t','') 72 try : 73 doc = xml.dom.minidom.parseString(stringed) 74 except : 75 return array 76 for bmark in doc.getElementsByTagName("bookmark") : 77 array.append(bmark.toxml()) 78 return array 64 79 65 80 … … 106 121 class bookmark : 107 122 # constructor take the path to the bug in the store. 108 def __init__(self,path ) :123 def __init__(self,path,descr) : 109 124 zbug = 0 110 125 zsearch = '' 111 126 zproduct = '' 112 127 ztitle = '' 113 zetuple = path.get_selection().get_selected() 114 string = zetuple[0].get_value(zetuple[1],1) 128 if path != None : 129 zetuple = path.get_selection().get_selected() 130 string = zetuple[0].get_value(zetuple[1],1) 131 else : 132 string = descr 115 133 doc2 = xml.dom.minidom.parseString(string) 116 134 bmark = doc2.getElementsByTagName("bookmark")[0]
