class documentation

class Index(SignalEmitter): (source)

View In Hierarchy

The Index keeps a cache of all pages in a notebook store, all links between pages and all tags. This data is used to speed up many operatons in the user interface, like showing the notebook index in the side pane, showing "what links here" and faster search for page attributes.

The Index object is an opaque object that only exposes an API to trigger index updates and notifications when changes are found. It does not expose the data it keeps directly. To query the index, you need to construct an "index view" first, see e.g. the PagesIndexView, LinksIndexView and TagsIndexView classes. For convenience the Notebook class also exposes these three views with the respective attributes pages, links and tags.

Unknown Field: signal
new-update-iter (update_iter): signal used for plugins wanting to extend the indexer
changed (): emitted after changes have been committed
Method __init__ Constructor @param dbpath: a file path for the sqlite db, or ":memory:" @param layout: a NotebookLayout instance to index
Method check_and_update Check and update all data in the index
Method check_and_update_iter Undocumented
Method check_async Undocumented
Method file_moved Undocumented
Method flag_reindex No summary
Method flush Delete all data in the index
Method get_property Undocumented
Method on_commit Undocumented
Method remove_file Undocumented
Method set_property Undocumented
Method start_background_check Undocumented
Method stop_background_check Undocumented
Method touch_current_page_placeholder Create a placeholder for path if the page does not exist. Cleans up old placeholders.
Method update Update all data in the index
Method update_file Undocumented
Class Variable __signals__ Undocumented
Instance Variable background_check Undocumented
Instance Variable dbpath Undocumented
Instance Variable layout Undocumented
Instance Variable update_iter Undocumented
Property is_uptodate Undocumented
Method _db_connect Undocumented
Method _db_init Undocumented
Method _db_recover Undocumented
Method _update_iter_init Undocumented
Instance Variable _checker Undocumented
Instance Variable _db Undocumented

Inherited from SignalEmitter:

Method __new__ Undocumented
Method block_signals Returns a context manager for blocking one or more signals
Method connect Register a handler for a specific object.
Method connect_after Like connect() but handler will be called after default handler
Method disconnect Undocumented
Method emit Undocumented
Method emit_return_first Emits a signal and stops emission on the first handler that returns a not-None value.
Method emit_return_iter Returns an generator that calls one handler on each iteration and yields the return values. This allows aggregating return values.
Method _connect Undocumented
Method _setup_signal Undocumented
Method _teardown_signal Undocumented
def __init__(self, dbpath, layout): (source)
Constructor
Parameters
dbpatha file path for the sqlite db, or ":memory:"
layouta NotebookLayout instance to index
def check_and_update(self): (source)
Check and update all data in the index
def check_and_update_iter(self): (source)

Undocumented

def check_async(self, notebook, paths, recursive=False): (source)

Undocumented

def file_moved(self, oldfile, newfile): (source)

Undocumented

def flag_reindex(self): (source)
This methods flags all pages with content to be re-indexed. Main reason to use this would be when loading a new plugin that wants to index all pages. Differs from flush() because it does not drop all data
def flush(self): (source)
Delete all data in the index
def get_property(self, key): (source)

Undocumented

def on_commit(self, iter): (source)

Undocumented

def remove_file(self, file): (source)

Undocumented

def set_property(self, key, value): (source)

Undocumented

def start_background_check(self, notebook): (source)

Undocumented

def stop_background_check(self): (source)

Undocumented

def touch_current_page_placeholder(self, path): (source)
Create a placeholder for path if the page does not exist. Cleans up old placeholders.
def update(self): (source)
Update all data in the index
def update_file(self, file): (source)

Undocumented

__signals__ = (source)

Undocumented

background_check = (source)

Undocumented

dbpath: str = (source)

Undocumented

layout = (source)

Undocumented

update_iter = (source)

Undocumented

@property
is_uptodate = (source)

Undocumented

def _db_connect(self): (source)

Undocumented

def _db_init(self): (source)

Undocumented

def _db_recover(self): (source)

Undocumented

def _update_iter_init(self): (source)

Undocumented

_checker = (source)

Undocumented

Undocumented