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": |
32 if Globals.isWindowsPlatform(): |
|
33 standardDir = os.path.expandvars("%APPDATA%\\Opera\\Opera") |
|
34 elif Globals.isMacPlatform(): |
|
35 standardDir = os.path.expanduser( |
|
36 "~/Library/Opera") |
|
37 else: |
|
38 standardDir = os.path.expanduser("~/.opera") |
|
39 return ( |
|
40 UI.PixmapCache.getPixmap("opera"), |
|
41 "Opera", |
|
42 "bookmarks.adr", |
|
43 QCoreApplication.translate( |
|
44 "OperaImporter", |
|
45 """Opera stores its bookmarks in the <b>bookmarks.adr</b> """ |
|
46 """text file. This file is usually located in"""), |
|
47 QCoreApplication.translate( |
|
48 "OperaImporter", |
|
49 """Please choose the file to begin importing bookmarks."""), |
|
50 standardDir, |
|
51 ) |
|
52 else: |
|
53 raise ValueError( |
32 raise ValueError( |
54 "Unsupported browser ID given ({0}).".format(sourceId)) |
33 "Unsupported browser ID given ({0}).".format(sourceId)) |
|
34 |
|
35 if Globals.isWindowsPlatform(): |
|
36 standardDir = os.path.expandvars("%APPDATA%\\Opera\\Opera") |
|
37 elif Globals.isMacPlatform(): |
|
38 standardDir = os.path.expanduser( |
|
39 "~/Library/Opera") |
|
40 else: |
|
41 standardDir = os.path.expanduser("~/.opera") |
|
42 return ( |
|
43 UI.PixmapCache.getPixmap("opera"), |
|
44 "Opera", |
|
45 "bookmarks.adr", |
|
46 QCoreApplication.translate( |
|
47 "OperaImporter", |
|
48 """Opera stores its bookmarks in the <b>bookmarks.adr</b> """ |
|
49 """text file. This file is usually located in"""), |
|
50 QCoreApplication.translate( |
|
51 "OperaImporter", |
|
52 """Please choose the file to begin importing bookmarks."""), |
|
53 standardDir, |
|
54 ) |
55 |
55 |
56 |
56 |
57 class OperaImporter(BookmarksImporter): |
57 class OperaImporter(BookmarksImporter): |
58 """ |
58 """ |
59 Class implementing the Opera bookmarks importer. |
59 Class implementing the Opera bookmarks importer. |