src/eric7/WebBrowser/Bookmarks/BookmarksImporters/OperaImporter.py

branch
eric7
changeset 9504
1193fc2bf192
parent 9489
c03b8323d11a
child 9624
b47dfa7a137d
equal deleted inserted replaced
9503:ae9232bf4854 9504:1193fc2bf192
26 the default bookmarks file (string), an info text (string), 26 the default bookmarks file (string), an info text (string),
27 a prompt (string) and the default directory of the bookmarks file 27 a prompt (string) and the default directory of the bookmarks file
28 (string) 28 (string)
29 @exception ValueError raised to indicate an invalid browser ID 29 @exception ValueError raised to indicate an invalid browser ID
30 """ 30 """
31 if sourceId != "opera": 31 if sourceId != "opera_legacy":
32 raise ValueError("Unsupported browser ID given ({0}).".format(sourceId)) 32 raise ValueError("Unsupported browser ID given ({0}).".format(sourceId))
33 33
34 if Globals.isWindowsPlatform(): 34 if Globals.isWindowsPlatform():
35 standardDir = os.path.expandvars("%APPDATA%\\Opera\\Opera") 35 standardDir = os.path.expandvars("%APPDATA%\\Opera\\Opera")
36 elif Globals.isMacPlatform(): 36 elif Globals.isMacPlatform():
37 standardDir = os.path.expanduser("~/Library/Opera") 37 standardDir = os.path.expanduser("~/Library/Opera")
38 else: 38 else:
39 standardDir = os.path.expanduser("~/.opera") 39 standardDir = os.path.expanduser("~/.opera")
40 return ( 40 return (
41 EricPixmapCache.getPixmap("opera"), 41 EricPixmapCache.getPixmap("opera_legacy"),
42 "Opera", 42 "Opera (Legacy)",
43 "bookmarks.adr", 43 "bookmarks.adr",
44 QCoreApplication.translate( 44 QCoreApplication.translate(
45 "OperaImporter", 45 "OperaImporter",
46 """Opera stores its bookmarks in the <b>bookmarks.adr</b> """ 46 """Opera (Legacy) stores its bookmarks in the <b>bookmarks.adr</b> """
47 """text file. This file is usually located in""", 47 """text file. This file is usually located in""",
48 ), 48 ),
49 QCoreApplication.translate( 49 QCoreApplication.translate(
50 "OperaImporter", """Please choose the file to begin importing bookmarks.""" 50 "OperaImporter", """Please choose the file to begin importing bookmarks."""
51 ), 51 ),
132 132
133 if self._id == "opera": 133 if self._id == "opera":
134 importRootNode.title = self.tr("Opera Import") 134 importRootNode.title = self.tr("Opera Import")
135 else: 135 else:
136 importRootNode.title = self.tr("Imported {0}").format( 136 importRootNode.title = self.tr("Imported {0}").format(
137 QDate.currentDate().toString(Qt.DateFormat.SystemLocaleShortDate) 137 QDate.currentDate().toString(Qt.DateFormat.ISODate)
138 ) 138 )
139 return importRootNode 139 return importRootNode
140 140
141 141
142 def createImporter(sourceId="", parent=None): 142 def createImporter(sourceId="", parent=None):

eric ide

mercurial