28 a prompt (string) and the default directory of the bookmarks file (string) |
28 a prompt (string) and the default directory of the bookmarks file (string) |
29 """ |
29 """ |
30 if id == "opera": |
30 if id == "opera": |
31 if Globals.isWindowsPlatform(): |
31 if Globals.isWindowsPlatform(): |
32 standardDir = os.path.expandvars("%APPDATA%\\Opera\\Opera") |
32 standardDir = os.path.expandvars("%APPDATA%\\Opera\\Opera") |
|
33 elif Globals.isMacPlatform(): |
|
34 standardDir = os.path.expanduser( |
|
35 "~/Library/Opera") |
33 else: |
36 else: |
34 standardDir = os.path.expanduser("~/.opera") |
37 standardDir = os.path.expanduser("~/.opera") |
35 return ( |
38 return ( |
36 UI.PixmapCache.getPixmap("opera.png"), |
39 UI.PixmapCache.getPixmap("opera.png"), |
37 "Opera", |
40 "Opera", |
88 Public method to get the imported bookmarks. |
91 Public method to get the imported bookmarks. |
89 |
92 |
90 @return imported bookmarks (BookmarkNode) |
93 @return imported bookmarks (BookmarkNode) |
91 """ |
94 """ |
92 try: |
95 try: |
93 f = open(self.__fileName, "r") |
96 f = open(self.__fileName, "r", encoding="utf-8") |
94 contents = f.read() |
97 contents = f.read() |
95 f.close() |
98 f.close() |
96 except IOError as err: |
99 except IOError as err: |
97 self._error = True |
100 self._error = True |
98 self._errorString = self.trUtf8("File '{0}' cannot be read.\nReason: {1}")\ |
101 self._errorString = self.trUtf8("File '{0}' cannot be read.\nReason: {1}")\ |