Gnumed.timelinelib.canvas.data.timeperiod.TimePeriod

Package Gnumed :: Package timelinelib :: Package canvas :: Package data :: Module timeperiod :: Class TimePeriod |
[frames] | no frames]

# Class TimePeriod

source code

    object --+
             |
            TimePeriod

Represents a period in time using a start and end time.

This is used both to store the time period for an event and for storing the currently displayed time period in the GUI.

Instance Methods
__init__(self, start_time, end_time) x.__init__(...) initializes x; see help(type(x)) for signature | source code
start_time(self) | source code
end_time(self) | source code
start_and_end_time(self) | source code
__eq__(self, other) | source code
__ne__(self, other) | source code
__repr__(self) repr(x) | source code
get_time_at_percent(self, percent) | source code
get_start_time(self) | source code
get_end_time(self) | source code
set_start_time(self, time) | source code
set_end_time(self, time) | source code
start_to_start(self, time_period) | source code
start_to_end(self, time_period) | source code
end_to_start(self, time_period) | source code
end_to_end(self, time_period) | source code
update(self, start_time, end_time, start_delta=None, end_delta=None) | source code
inside(self, time) Return True if the given time is inside this period or on the border, otherwise False. | source code
distance_to(self, time_period) | source code
overlaps(self, time_period) | source code
outside_period(self, time_period) | source code
inside_period(self, time_period) | source code
starts_after(self, time) | source code
starts_before(self, time) | source code
ends_before(self, time) | source code
ends_after(self, time) | source code
ends_at(self, time) | source code
is_period(self) Return True if this time period is longer than just a point in time, otherwise False. | source code
mean_time(self) Return the time in the middle if this time period is longer than just a point in time, otherwise the point in time for this time period. | source code
zoom(self, times, ratio=0.5) | source code
move(self, direction) Move this time period one 10th to the given direction. | source code
move_delta(self, delta) | source code
delta(self) Return the length of this time period as a timedelta object. | source code
center(self, time) | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, start_time, end_time) (Constructor) | source code
x.__init__(...) initializes x; see help(type(x)) for signature Overrides: object.__init__ (inherited documentation)

### start_time(self) | source code
Decorators: `@property`

### end_time(self) | source code
Decorators: `@property`

### start_and_end_time(self) | source code
Decorators: `@property`

### __repr__(self) (Representation operator) | source code
repr(x) Overrides: object.__repr__ (inherited documentation)

### move(self, direction) | source code
Move this time period one 10th to the given direction. Direction should be -1 for moving to the left or 1 for moving to the right.