module timelinelib.config.dotfile

Handle application configuration.

This module is global and can be used by all modules. Before accessing configurations, the read function should be called. To save the current configuration back to file, call the write method.

Tests are found here.

timelinelib.config.dotfile.SELECTED_EVENT_BOX_DRAWER = 'selected_event_box_drawer'
timelinelib.config.dotfile.WINDOW_WIDTH = 'window_width'
timelinelib.config.dotfile.WINDOW_HEIGHT = 'window_height'
timelinelib.config.dotfile.WINDOW_XPOS = 'window xpos'
timelinelib.config.dotfile.WINDOW_YPOS = 'window ypos'
timelinelib.config.dotfile.RECENT_FILES = 'recent_files'
timelinelib.config.dotfile.WEEK_START = 'week_start'
timelinelib.config.dotfile.DATE_FORMAT = 'date_format'
timelinelib.config.dotfile.DEFAULTS = {'balloon_font': '10:74:90:90:False:Tahoma:33:(0, 0, 0, 255)', 'balloon_on_hover': 'True', 'bg_colour': '(255, 255, 255)', 'center_event_texts': 'False', 'colorize_weekends': 'False', 'date_format': 'yyyy-mm-dd', 'default_day': '03', 'default_month': '02', 'default_year': '2020', 'display_checkmark_on_events_done': 'False', 'divider_line_slider_pos': '50', 'draw_point_events_to_right': 'False', 'era_font': 'nfi|1;8;-11;0;0;0;400;0;0;0;1;0;0;2;32;Arial|(0, 0, 0, 255)', 'event_editor_show_period': 'False', 'event_editor_show_time': 'False', 'event_editor_tab_order': '01234:', 'event_font': 'nfi|1;8;-11;0;0;0;400;0;0;0;1;0;0;2;32;Arial|(0, 0, 0, 255)', 'experimental_features': '', 'filtered_listbox_export': 'False', 'fuzzy_icon': 'fuzzy.png', 'hide_events_done': 'False', 'hyperlink_icon': 'hyperlink.png', 'legend_font': '10:74:90:90:False:Tahoma:33:(0, 0, 0, 255)', 'legend_pos': '0', 'locked_icon': 'locked.png', 'major_strip_divider_line_colour': '(200, 200, 200)', 'major_strip_font': '10:74:90:90:False:Tahoma:33:(0, 0, 0, 255)', 'minor_strip_divider_line_colour': '(200, 200, 200)', 'minor_strip_font': '10:74:90:90:False:Tahoma:33:(0, 0, 0, 255)', 'never_show_period_events_as_point_events': 'False', 'never_use_time': 'False', 'now_line_colour': '(200, 0, 0)', 'open_recent_at_startup': 'True', 'recent_files': '', 'selected_event_box_drawer': 'Default Event box drawer', 'show_label_filtering': 'False', 'show_legend': 'True', 'show_sidebar': 'True', 'show_toolbar': 'True', 'sidebar_width': '200', 'skip_s_in_decade_text': 'False', 'text_below_icon': 'False', 'time_scale_pos': '1', 'uncheck_time_for_new_events': 'False', 'use_bold_nowline': 'False', 'use_date_default_values': 'False', 'use_inertial_scrolling': 'False', 'use_second': 'False', 'use_sidebar_filter_hint': 'True', 'use_sidebar_text_coloring': 'False', 'vertical_space_between_events': '5', 'week_start': 'monday', 'weekend_colour': '(255, 255, 255)', 'window xpos': '-1', 'window ypos': '-1', 'window_height': '500', 'window_maximized': 'False', 'window_width': '900', 'workday_length': '8'}
timelinelib.config.dotfile.MAX_NBR_OF_RECENT_FILES_SAVED = 5
timelinelib.config.dotfile.ENCODING = 'utf-8'
timelinelib.config.dotfile.read_config()[source]
class timelinelib.config.dotfile.Config[source]

Bases: timelinelib.general.observer.Observable

Provide read and write access to application configuration settings.

Built as a wrapper around ConfigParser: Properties exist to read and write values but ConfigParser does the actual reading and writing of the configuration file.

The application_arguments argument handles the parsing of the command line arguments and options.

__init__(application_arguments)[source]

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

property path

The path to the configuration file.

property has_files

Returns True if the command line contains a file specification.

property first_file

Returns the first filename given on the command line, or None if no file is specified.

property debug_enabled

Returns True if the comman line option --debug is given on the command line.

read()[source]

Read settings from file specified in the path property.

write()[source]

Write settings to the file specified in path property and raise IOError if failed.

get_selected_event_box_drawer()[source]
set_selected_event_box_drawer(selected)[source]
get_window_size()[source]
set_window_size(size)[source]
get_window_pos()[source]
set_window_pos(pos)[source]
get_recently_opened()[source]
has_recently_opened_files()[source]
get_latest_recently_opened_file()[source]
append_recently_opened(path)[source]
get_week_start()[source]
week_starts_on_monday()[source]
set_week_start(week_start)[source]
get_shortcut_key(cfgid, default)[source]
set_shortcut_key(cfgid, value)[source]
get_date_formatter(formatter_class=<class 'timelinelib.calendar.gregorian.dateformatter.GregorianDateFormatter'>)[source]
get_date_format()[source]
set_date_format(date_format)[source]
property date_format
get(key)[source]
set(key, value)[source]
property balloon_font
property balloon_on_hover
property bg_colour
property center_event_texts
property colorize_weekends
property default_day
property default_month
property default_year
property display_checkmark_on_events_done
property divider_line_slider_pos
property draw_point_events_to_right
property era_font
property event_editor_show_period
property event_editor_show_time
property event_editor_tab_order
property event_font
property experimental_features
property filtered_listbox_export
property fuzzy_icon
property hide_events_done
property legend_font
property legend_pos
property locked_icon
property major_strip_divider_line_colour
property major_strip_font
property minor_strip_divider_line_colour
property minor_strip_font
property never_show_period_events_as_point_events
property never_use_time
property now_line_colour
property open_recent_at_startup
property show_label_filtering
property show_legend
property show_sidebar
property show_toolbar
property sidebar_width
property skip_s_in_decade_text
property text_below_icon
property time_scale_pos
property uncheck_time_for_new_events
property use_bold_nowline
property use_date_default_values
property use_inertial_scrolling
property use_second
property use_sidebar_filter_hint
property use_sidebar_text_coloring
property vertical_space_between_events
property weekend_colour
property window_maximized
property workday_length
timelinelib.config.dotfile.BOOLEAN_CONFIGS = ({'name': 'show_toolbar', 'default': 'True'}, {'name': 'show_sidebar', 'default': 'True'}, {'name': 'show_legend', 'default': 'True'}, {'name': 'show_label_filtering', 'default': 'False'}, {'name': 'window_maximized', 'default': 'False'}, {'name': 'open_recent_at_startup', 'default': 'True'}, {'name': 'balloon_on_hover', 'default': 'True'}, {'name': 'use_inertial_scrolling', 'default': 'False'}, {'name': 'never_show_period_events_as_point_events', 'default': 'False'}, {'name': 'draw_point_events_to_right', 'default': 'False'}, {'name': 'event_editor_show_period', 'default': 'False'}, {'name': 'event_editor_show_time', 'default': 'False'}, {'name': 'center_event_texts', 'default': 'False'}, {'name': 'uncheck_time_for_new_events', 'default': 'False'}, {'name': 'text_below_icon', 'default': 'False'}, {'name': 'filtered_listbox_export', 'default': 'False'}, {'name': 'colorize_weekends', 'default': 'False'}, {'name': 'use_bold_nowline', 'default': 'False'}, {'name': 'skip_s_in_decade_text', 'default': 'False'}, {'name': 'display_checkmark_on_events_done', 'default': 'False'}, {'name': 'never_use_time', 'default': 'False'}, {'name': 'use_second', 'default': 'False'}, {'name': 'use_date_default_values', 'default': 'False'}, {'name': 'hide_events_done', 'default': 'False'}, {'name': 'use_sidebar_text_coloring', 'default': 'False'}, {'name': 'use_sidebar_filter_hint', 'default': 'True'})
timelinelib.config.dotfile.INT_CONFIGS = ({'name': 'sidebar_width', 'default': '200'}, {'name': 'divider_line_slider_pos', 'default': '50'}, {'name': 'vertical_space_between_events', 'default': '5'}, {'name': 'legend_pos', 'default': '0'}, {'name': 'time_scale_pos', 'default': '1'}, {'name': 'workday_length', 'default': '8'})
timelinelib.config.dotfile.STR_CONFIGS = ({'name': 'experimental_features', 'default': ''}, {'name': 'event_editor_tab_order', 'default': '01234:'}, {'name': 'fuzzy_icon', 'default': 'fuzzy.png'}, {'name': 'locked_icon', 'default': 'locked.png'}, {'name': 'hyperlink_icon', 'default': 'hyperlink.png'}, {'name': 'default_year', 'default': '2020'}, {'name': 'default_month', 'default': '02'}, {'name': 'default_day', 'default': '03'})
timelinelib.config.dotfile.COLOUR_CONFIGS = ({'name': 'now_line_colour', 'default': '(200, 0, 0)'}, {'name': 'weekend_colour', 'default': '(255, 255, 255)'}, {'name': 'bg_colour', 'default': '(255, 255, 255)'}, {'name': 'minor_strip_divider_line_colour', 'default': '(200, 200, 200)'}, {'name': 'major_strip_divider_line_colour', 'default': '(200, 200, 200)'})
timelinelib.config.dotfile.FONT_CONFIGS = ({'name': 'minor_strip_font', 'default': '10:74:90:90:False:Tahoma:33:(0, 0, 0, 255)'}, {'name': 'major_strip_font', 'default': '10:74:90:90:False:Tahoma:33:(0, 0, 0, 255)'}, {'name': 'legend_font', 'default': '10:74:90:90:False:Tahoma:33:(0, 0, 0, 255)'}, {'name': 'balloon_font', 'default': '10:74:90:90:False:Tahoma:33:(0, 0, 0, 255)'}, {'name': 'event_font', 'default': 'nfi|1;8;-11;0;0;0;400;0;0;0;1;0;0;2;32;Arial|(0, 0, 0, 255)'}, {'name': 'era_font', 'default': 'nfi|1;8;-11;0;0;0;400;0;0;0;1;0;0;2;32;Arial|(0, 0, 0, 255)'})
timelinelib.config.dotfile.BOOLEANS = ['show_toolbar', 'show_sidebar', 'show_legend', 'show_label_filtering', 'window_maximized', 'open_recent_at_startup', 'balloon_on_hover', 'use_inertial_scrolling', 'never_show_period_events_as_point_events', 'draw_point_events_to_right', 'event_editor_show_period', 'event_editor_show_time', 'center_event_texts', 'uncheck_time_for_new_events', 'text_below_icon', 'filtered_listbox_export', 'colorize_weekends', 'use_bold_nowline', 'skip_s_in_decade_text', 'display_checkmark_on_events_done', 'never_use_time', 'use_second', 'use_date_default_values', 'hide_events_done', 'use_sidebar_text_coloring', 'use_sidebar_filter_hint']
timelinelib.config.dotfile.INTS = ['sidebar_width', 'divider_line_slider_pos', 'vertical_space_between_events', 'legend_pos', 'time_scale_pos', 'workday_length']
timelinelib.config.dotfile.COLOURS = ['now_line_colour', 'weekend_colour', 'bg_colour', 'minor_strip_divider_line_colour', 'major_strip_divider_line_colour']
timelinelib.config.dotfile.FONTS = ['minor_strip_font', 'major_strip_font', 'legend_font', 'balloon_font', 'event_font', 'era_font']
timelinelib.config.dotfile.setatt(name)[source]