Contains unit test utility functions.
Many functions use a human readable date and time string as argument.
Such a string has a day, month, year and an optional time like this:
|
|
|
|
|
human_time_to_pharaonic(human_time)
Create a :doc:`PharaonicTime
<timelinelib.calendar.pharaonic.time>` object from a human
readable date and time string. |
source code
|
|
|
a_time_period()
Create a random :doc:`TimePeriod
<timelinelib_canvas_data_timeperiod>` object. |
source code
|
|
|
human_time_to_ymdhm(human_time)
Convert a human readable date and time string into a tuple of numeric
values. |
source code
|
|
|
an_event()
Create an :doc:`Event <timelinelib_canvas_data_event>` object. |
source code
|
|
|
an_event_with(human_start_time=None,
human_end_time=None,
time=ANY_TIME,
text="foo",
fuzzy=False,
locked=False,
ends_today=False,
category=None,
default_color=None)
Create an :doc:`Event <timelinelib_canvas_data_event>` object. |
source code
|
|
|
a_subevent()
Create a :doc:`Subevent <timelinelib_canvas_data_subevent>`
object. |
source code
|
|
|
a_subevent_with(start=None,
end=None,
time=ANY_TIME,
text="sub",
category=None,
container=None)
Create a :doc:`Subevent <timelinelib_canvas_data_subevent>`
object. |
source code
|
|
|
a_container(name,
category,
sub_events)
Create a :doc:`Container <timelinelib_canvas_data_container>`
object. |
source code
|
|
|
a_container_with(text="container",
category=None)
Create a :doc:`Container <timelinelib_canvas_data_container>`
object. |
source code
|
|
|
a_category()
Create a :doc:`Category <timelinelib_canvas_data_category>`
object. |
source code
|
|
|
a_category_with(name,
color=(255,0,0),
font_color=(0,255,255),
parent=None)
Create a :doc:`Category <timelinelib_canvas_data_category>`
object. |
source code
|
|
|
a_pharaonic_era()
Create an :doc:`Era <timelinelib_canvas_data_era>` object. |
source code
|
|
|
a_pharaonic_era_with(start=None,
end=None,
time=ANY_TIME,
name="foo",
color=(128,128,128),
time_type=PharaonicTimeType(),
ends_today=False)
Create an :doc:`Era <timelinelib_canvas_data_era>` object. |
source code
|
|
|
a_numeric_era()
Create an :doc:`Era <timelinelib_canvas_data_era>` object. |
source code
|
|
|
a_numeric_era_with(start=None,
end=None,
time=ANY_NUM_TIME,
name="foo",
color=(128,128,128))
Create an :doc:`Era <timelinelib_canvas_data_era>` object. |
source code
|
|
|
|
|
|
|
new_parent(category)
Return a new category parent. |
source code
|
|
|
|
|
modifier_change_ends_today(event)
Toggle the event's ends-today property. |
source code
|
|
|
|
|
ANY_TIME = "1 I Akhet 1710"
|
|
ANY_NUM_TIME = 10
|
|
EVENT_MODIFIERS = [("change fuzzy", lambda event: event.set_fu...
|
|
SUBEVENT_MODIFIERS = [("change fuzzy", lambda event: event.set...
|
|
CONTAINER_MODIFIERS = [("change time period", lambda event: ev...
|
|
CATEGORY_MODIFIERS = [("change name", lambda category: categor...
|
|
TIME_PERIOD_MODIFIERS = [("zoom", lambda time_period: time_per...
|
|
ERA_MODIFIERS = [("change id", lambda era: era.set_id(inc(era....
|
|
NUM_ERA_MODIFIERS = [("change id", lambda era: era.set_id(inc(...
|
|
TIME_MODIFIERS = [("add", lambda time: time+ PharaonicDelta(1)),]
|
|
ANY = _ANY()
This object is always considered equal to any other object.
|