31 Public method to write an Netscape HTML bookmark file. |
31 Public method to write an Netscape HTML bookmark file. |
32 |
32 |
33 @param fileNameOrDevice name of the file to write (string) |
33 @param fileNameOrDevice name of the file to write (string) |
34 or device to write to (QIODevice) |
34 or device to write to (QIODevice) |
35 @param root root node of the bookmark tree (BookmarkNode) |
35 @param root root node of the bookmark tree (BookmarkNode) |
|
36 @return flag indicating success (boolean) |
36 """ |
37 """ |
37 if isinstance(fileNameOrDevice, QIODevice): |
38 if isinstance(fileNameOrDevice, QIODevice): |
38 f = fileNameOrDevice |
39 f = fileNameOrDevice |
39 else: |
40 else: |
40 f = QFile(fileNameOrDevice) |
41 f = QFile(fileNameOrDevice) |
47 def __write(self, root): |
48 def __write(self, root): |
48 """ |
49 """ |
49 Private method to write an Netscape HTML bookmark file. |
50 Private method to write an Netscape HTML bookmark file. |
50 |
51 |
51 @param root root node of the bookmark tree (BookmarkNode) |
52 @param root root node of the bookmark tree (BookmarkNode) |
|
53 @return flag indicating success (boolean) |
52 """ |
54 """ |
53 self.__dev.write("<!DOCTYPE NETSCAPE-Bookmark-file-1>\n" |
55 self.__dev.write("<!DOCTYPE NETSCAPE-Bookmark-file-1>\n" |
54 "<!-- This is an automatically generated file.\n" |
56 "<!-- This is an automatically generated file.\n" |
55 " It will be read and overwritten.\n" |
57 " It will be read and overwritten.\n" |
56 " DO NOT EDIT! -->\n" |
58 " DO NOT EDIT! -->\n" |