12 |
12 |
13 class BookmarksImporter(QObject): |
13 class BookmarksImporter(QObject): |
14 """ |
14 """ |
15 Class implementing the base class for the bookmarks importers. |
15 Class implementing the base class for the bookmarks importers. |
16 """ |
16 """ |
|
17 |
17 def __init__(self, sourceId="", parent=None): |
18 def __init__(self, sourceId="", parent=None): |
18 """ |
19 """ |
19 Constructor |
20 Constructor |
20 |
21 |
21 @param sourceId source ID (string) |
22 @param sourceId source ID (string) |
22 @param parent reference to the parent object (QObject) |
23 @param parent reference to the parent object (QObject) |
23 """ |
24 """ |
24 super().__init__(parent) |
25 super().__init__(parent) |
25 |
26 |
26 self._path = "" |
27 self._path = "" |
27 self._file = "" |
28 self._file = "" |
28 self._error = False |
29 self._error = False |
29 self._errorString = "" |
30 self._errorString = "" |
30 self._id = sourceId |
31 self._id = sourceId |
31 |
32 |
32 def setPath(self, path): |
33 def setPath(self, path): |
33 """ |
34 """ |
34 Public method to set the path of the bookmarks file or directory. |
35 Public method to set the path of the bookmarks file or directory. |
35 |
36 |
36 @param path bookmarks file or directory (string) |
37 @param path bookmarks file or directory (string) |
37 @exception NotImplementedError raised to indicate this method must |
38 @exception NotImplementedError raised to indicate this method must |
38 be implemented by a subclass |
39 be implemented by a subclass |
39 """ |
40 """ |
40 raise NotImplementedError |
41 raise NotImplementedError |
41 |
42 |
42 def open(self): |
43 def open(self): |
43 """ |
44 """ |
44 Public method to open the bookmarks file. |
45 Public method to open the bookmarks file. |
45 |
46 |
46 It must return a flag indicating success (boolean). |
47 It must return a flag indicating success (boolean). |
47 |
48 |
48 @exception NotImplementedError raised to indicate this method must |
49 @exception NotImplementedError raised to indicate this method must |
49 be implemented by a subclass |
50 be implemented by a subclass |
50 """ |
51 """ |
51 raise NotImplementedError |
52 raise NotImplementedError |
52 |
53 |
53 def importedBookmarks(self): |
54 def importedBookmarks(self): |
54 """ |
55 """ |
55 Public method to get the imported bookmarks. |
56 Public method to get the imported bookmarks. |
56 |
57 |
57 It must return the imported bookmarks (BookmarkNode). |
58 It must return the imported bookmarks (BookmarkNode). |
58 |
59 |
59 @exception NotImplementedError raised to indicate this method must |
60 @exception NotImplementedError raised to indicate this method must |
60 be implemented by a subclass |
61 be implemented by a subclass |
61 """ |
62 """ |
62 raise NotImplementedError |
63 raise NotImplementedError |
63 |
64 |
64 def error(self): |
65 def error(self): |
65 """ |
66 """ |
66 Public method to check for an error. |
67 Public method to check for an error. |
67 |
68 |
68 @return flag indicating an error (boolean) |
69 @return flag indicating an error (boolean) |
69 """ |
70 """ |
70 return self._error |
71 return self._error |
71 |
72 |
72 def errorString(self): |
73 def errorString(self): |
73 """ |
74 """ |
74 Public method to get the error description. |
75 Public method to get the error description. |
75 |
76 |
76 @return error description (string) |
77 @return error description (string) |
77 """ |
78 """ |
78 return self._errorString |
79 return self._errorString |