eric6/Helpviewer/Bookmarks/BookmarksImporters/BookmarksImporter.py

changeset 7220
5cf645f6daab
parent 7218
eaf2cf171f3a
parent 7211
1c97f3142fa8
child 7221
0485ccdf7877
equal deleted inserted replaced
7218:eaf2cf171f3a 7220:5cf645f6daab
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2012 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a base class for the bookmarks importers.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt5.QtCore import QObject
13
14
15 class BookmarksImporter(QObject):
16 """
17 Class implementing the base class for the bookmarks importers.
18 """
19 def __init__(self, sourceId="", parent=None):
20 """
21 Constructor
22
23 @param sourceId source ID (string)
24 @param parent reference to the parent object (QObject)
25 """
26 super(BookmarksImporter, self).__init__(parent)
27
28 self._path = ""
29 self._file = ""
30 self._error = False
31 self._errorString = ""
32 self._id = sourceId
33
34 def setPath(self, path):
35 """
36 Public method to set the path of the bookmarks file or directory.
37
38 @param path bookmarks file or directory (string)
39 @exception NotImplementedError raised to indicate this method must
40 be implemented by a subclass
41 """
42 raise NotImplementedError
43
44 def open(self):
45 """
46 Public method to open the bookmarks file.
47
48 It must return a flag indicating success (boolean).
49
50 @exception NotImplementedError raised to indicate this method must
51 be implemented by a subclass
52 """
53 raise NotImplementedError
54
55 def importedBookmarks(self):
56 """
57 Public method to get the imported bookmarks.
58
59 It must return the imported bookmarks (BookmarkNode).
60
61 @exception NotImplementedError raised to indicate this method must
62 be implemented by a subclass
63 """
64 raise NotImplementedError
65
66 def error(self):
67 """
68 Public method to check for an error.
69
70 @return flag indicating an error (boolean)
71 """
72 return self._error
73
74 def errorString(self):
75 """
76 Public method to get the error description.
77
78 @return error description (string)
79 """
80 return self._errorString

eric ide

mercurial