| |
- builtins.object
-
- Bookmarks
class Bookmarks(builtins.object) |
|
Bookmarks is a container which associates keys with bookmarks.
A key is a string with: len(key) == 1 and key in ALLOWED_KEYS.
A bookmark is an object with: bookmark == bookmarktype(str(instance))
Which is true for str or FileSystemObject. This condition is required
so bookmark-objects can be saved to and loaded from a file.
Optionally, a bookmark.go() method is used for entering a bookmark. |
|
Methods defined here:
- __contains__(self, key)
- Test whether a bookmark-key is defined
- __getitem__(self, key)
- Get the bookmark associated with the key
- __init__(self, bookmarkfile, bookmarktype=<class 'str'>, autosave=False)
- <bookmarkfile> specifies the path to the file where
bookmarks are saved in.
- __iter__(self)
- __setitem__(self, key, value)
- Bookmark <value> to the key <key>.
key is expected to be a 1-character string and element of ALLOWED_KEYS.
value is expected to be a filesystemobject.
- delete(self, key)
- Delete the bookmark with the given key
- enter(self, key)
- Enter the bookmark with the given key.
Requires the bookmark instance to have a go() method.
- load(self)
- Load the bookmarks from path/bookmarks
- remember(self, value)
- Bookmarks <value> to the keys ` and '
- save(self)
- Save the bookmarks to the bookmarkfile.
This is done automatically after every modification if autosave is True.
- update(self)
- Update the bookmarks from the bookmark file.
Useful if two instances are running which define different bookmarks.
- update_if_outdated(self)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- autosave = True
- last_mtime = None
- load_pattern = <_sre.SRE_Pattern object at 0x7f20a5b7b760>
| |