Home | Trees | Indices | Help |
|
---|
|
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Rickard Lindberg, Roger Lindberg 2 # 3 # This file is part of Timeline. 4 # 5 # Timeline is free software: you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by 7 # the Free Software Foundation, either version 3 of the License, or 8 # (at your option) any later version. 9 # 10 # Timeline is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with Timeline. If not, see <http://www.gnu.org/licenses/>. 17 18 19 from timelinelib.canvas.data.base import ItemBase 20 from timelinelib.canvas.data.immutable import ImmutableEra 21 from timelinelib.canvas.data.item import TimelineItem 22 23 24 DEFAULT_ERA_COLOR = (200, 200, 200) 25 2628 """ 29 A clearly defined period of time of arbitrary but well-defined length. 30 An Era is indicated in a timeline, by setting the background color 31 to the Era color for the Era time period. The Era name is also 32 drawn on the timeline within the Era time period. 33 """ 34 3711339 with self._db.transaction("Save era") as t: 40 t.save_era(self._immutable_value, self.ensure_id()) 41 return self42 4749 return (isinstance(other, Era) and 50 self.get_id() == other.get_id() and 51 self.get_time_period() == other.get_time_period() and 52 self.get_name() == other.get_name() and 53 self.get_color() == other.get_color())54 57 60 6365 return self._immutable_value.ends_today66 69 70 _ends_today = property(ends_today, set_ends_today) 7173 """ """ 74 self.update_period(start_time, end_time) 75 self.name = name.strip() 76 self.color = color 77 return self78 8284 return self._immutable_value.name85 86 name = property(get_name, set_name) 87 9193 return self._immutable_value.color94 95 color = property(get_color, set_color) 9698 """ """ 99 if era.get_start_time() >= self.get_end_time(): 100 return 0 101 if era.get_start_time() == self.get_start_time(): 102 if era.get_end_time() == self.get_end_time(): 103 return 4 104 if era.get_end_time() > self.get_end_time(): 105 return 2 106 else: 107 return 3 108 if era.get_end_time() == self.get_end_time(): 109 return 5 110 if era.get_end_time() > self.get_end_time(): 111 return 1 112 return 6
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Dec 19 02:55:28 2018 | http://epydoc.sourceforge.net |