define abstract BookmarkElement and Bookmarks classes
This commit is contained in:
87
bookmark_sync/__init__.py
Normal file
87
bookmark_sync/__init__.py
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
|
class BookmarkElement(ABC):
|
||||||
|
def __init__(self,data):
|
||||||
|
self._data = data
|
||||||
|
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def children(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def name(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def parent(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def date_added(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def position(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class Bookmark(BookmarkElement):
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def address(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
def children(self):
|
||||||
|
return []
|
||||||
|
|
||||||
|
class Folder(BookmarkElement):
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def date_modified(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def is_root(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def is_toolbar(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class Bookmarks(ABC):
|
||||||
|
def __init__(self, profile_name="default"):
|
||||||
|
self.profile = profile_name
|
||||||
|
self.read_data()
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def read_data(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def folders(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def bookmarks(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
def root_folder(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def toolbar_folder(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def other_bookmarks(self):
|
||||||
|
pass
|
||||||
Reference in New Issue
Block a user