module timelinelib.canvas.data.memorydb.db

timelinelib.canvas.data.memorydb.db.STATE_CHANGE_CATEGORY = 1
timelinelib.canvas.data.memorydb.db.STATE_CHANGE_ANY = 2
class timelinelib.canvas.data.memorydb.db.MemoryDB[source]

Bases: timelinelib.general.observer.Observable

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

new_category(**kwargs)[source]
new_milestone(**kwargs)[source]
new_era(**kwargs)[source]
new_event(**kwargs)[source]
new_container(**kwargs)[source]
new_subevent(**kwargs)[source]
get_timestamp_string()[source]
property now
next_id()[source]
transaction(name)[source]
clear_transactions()[source]
transactions_status()[source]
display_in_canvas(canvas)[source]
is_saved()[source]
get_should_lock()[source]
set_should_lock(should_lock)[source]
register_save_callback(callback)[source]
get_time_type()[source]
set_time_type(time_type)[source]
is_read_only()[source]
set_readonly()[source]
search(search_string)[source]
get_events(time_period)[source]
get_all_events()[source]
property all_milestones
get_max_sort_order()[source]
get_first_event()[source]
get_last_event()[source]
save_events(events)[source]
save_event(event)[source]
delete_event(event_or_id)[source]
get_all_eras()[source]
get_all_periods()[source]
save_era(era)[source]
delete_era(era)[source]
get_categories()[source]
get_containers()[source]
save_category(category)[source]
get_category_by_name(name)[source]
get_category_by_id(id_)[source]
delete_category(category_or_id)[source]
get_saved_now()[source]
set_saved_now(time)[source]
load_view_properties(view_properties)[source]
save_view_properties(view_properties)[source]
place_event_after_event(event_to_place, target_event)[source]
place_event_before_event(event_to_place, target_event)[source]
undo()[source]
redo()[source]
undo_enabled()[source]
redo_enabled()[source]
find_event_with_ids(ids)[source]
find_event_with_id(event_id)[source]
get_displayed_period()[source]

Inheritors can call this method to get the displayed period used in load_view_properties and save_view_properties.

set_displayed_period(period)[source]

Inheritors can call this method to set the displayed period used in load_view_properties and save_view_properties.

get_hidden_categories()[source]
set_hidden_categories(hidden_categories)[source]
import_db(db)[source]
compress()[source]
measure_distance_between_events(event_ids)[source]
get_start_and_end_for_all_visible_events(filter_function)[source]

The events collection contains milestone events as well as ordinary events. The self.get_first_event function only consider ordinary events, so if there is only milestone events in the timeline the test

len(events) > 0

will pass, but the self.get_first_event will return None. TODO: Decide if milestone events should be included in this function?

get_distance_info(event_ids)[source]