Home | Trees | Indices | Help |
|
---|
|
1 # Copyright (C) 2009, 2010, 2011 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.db.exceptions import TimelineIOError 20 21 22 FORWARD = 0 23 BACKWARD = 1 24 BOTH = 2 25 2628 338135 self.view.set_count(1) 36 self.view.set_frequency(1) 37 self.view.select_move_period_fn_at_index(0) 38 self.view.set_direction(FORWARD)3941 (periods, nbr_of_missing_dates) = self._repeat_period( 42 self.event.time_period, 43 self.view.get_move_period_fn(), 44 self.view.get_frequency(), 45 self.view.get_count(), 46 self.view.get_direction()) 47 try: 48 for period in periods: 49 event = self.event.clone() 50 event.update_period(period.start_time, period.end_time) 51 self.db.save_event(event) 52 if nbr_of_missing_dates > 0: 53 self.view.handle_date_errors(nbr_of_missing_dates) 54 self.view.close() 55 except TimelineIOError, e: 56 self.view.handle_db_error(e)5760 periods = [] 61 nbr_of_missing_dates = 0 62 for index in self._calc_indicies(direction, repetitions): 63 new_period = move_period_fn(period, index*frequency) 64 if new_period == None: 65 nbr_of_missing_dates += 1 66 else: 67 periods.append(new_period) 68 return (periods, nbr_of_missing_dates)69
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Aug 3 03:56:38 2013 | http://epydoc.sourceforge.net |