eric6/WebBrowser/Bookmarks/BookmarksImporters/HtmlImporter.py

changeset 8205
4a0f1f896341
parent 8143
2c730d5fd177
child 8218
7c09585bd960
equal deleted inserted replaced
8204:fd477cded1c1 8205:4a0f1f896341
25 the default bookmarks file (string), an info text (string), 25 the default bookmarks file (string), an info text (string),
26 a prompt (string) and the default directory of the bookmarks file 26 a prompt (string) and the default directory of the bookmarks file
27 (string) 27 (string)
28 @exception ValueError raised to indicate an invalid browser ID 28 @exception ValueError raised to indicate an invalid browser ID
29 """ 29 """
30 if sourceId == "html": 30 if sourceId != "html":
31 return (
32 UI.PixmapCache.getPixmap("html"),
33 "HTML Netscape Bookmarks",
34 QCoreApplication.translate(
35 "HtmlImporter",
36 "HTML Netscape Bookmarks") + " (*.htm *.html)",
37 QCoreApplication.translate(
38 "HtmlImporter",
39 """You can import bookmarks from any browser that supports"""
40 """ HTML exporting. This file has usually the extension"""
41 """ .htm or .html."""),
42 QCoreApplication.translate(
43 "HtmlImporter",
44 """Please choose the file to begin importing bookmarks."""),
45 "",
46 )
47 else:
48 raise ValueError( 31 raise ValueError(
49 "Unsupported browser ID given ({0}).".format(sourceId)) 32 "Unsupported browser ID given ({0}).".format(sourceId))
33
34 return (
35 UI.PixmapCache.getPixmap("html"),
36 "HTML Netscape Bookmarks",
37 QCoreApplication.translate(
38 "HtmlImporter",
39 "HTML Netscape Bookmarks") + " (*.htm *.html)",
40 QCoreApplication.translate(
41 "HtmlImporter",
42 """You can import bookmarks from any browser that supports"""
43 """ HTML exporting. This file has usually the extension"""
44 """ .htm or .html."""),
45 QCoreApplication.translate(
46 "HtmlImporter",
47 """Please choose the file to begin importing bookmarks."""),
48 "",
49 )
50 50
51 51
52 class HtmlImporter(BookmarksImporter): 52 class HtmlImporter(BookmarksImporter):
53 """ 53 """
54 Class implementing the HTML bookmarks importer. 54 Class implementing the HTML bookmarks importer.

eric ide

mercurial