Mercurial > getan
changeset 19:a9d58053bef7
rename substract to subtract
(substract might be correct, too, but outdated)
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Tue, 18 Aug 2009 16:09:17 +0200 |
parents | 4242b263fad4 |
children | 28489e672e61 |
files | getan |
diffstat | 1 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/getan Tue Aug 18 16:07:21 2009 +0200 +++ b/getan Tue Aug 18 16:09:17 2009 +0200 @@ -239,8 +239,8 @@ cur.execute(DELETE_PROJECT, { 'id': pid }) cur.connection.commit() - def substractTime(self, cur, seconds): - substractTimeed, zero = timedelta(), timedelta() + def subtractTime(self, cur, seconds): + subtractTimeed, zero = timedelta(), timedelta() pid = {'project_id': self.getId(cur)} utc = UTC() while seconds > zero: @@ -255,18 +255,18 @@ cur.execute(DELETE_ENTRY, { 'id': row[0] }) cur.connection.commit() seconds -= runtime - substractTimeed += runtime + subtractTimeed += runtime else: stop_time -= seconds cur.execute(UPDATE_STOP_TIME, { 'id': row[0], 'stop_time': stop_time}) cur.connection.commit() - substractTimeed += seconds + subtractTimeed += seconds break - self.total -= substractTimeed - return substractTimeed + self.total -= subtractTimeed + return subtractTimeed def addTime(self, cur, seconds, description): now = datetime.now() @@ -433,13 +433,13 @@ finally: tolerantClose(cur) - def substractTime(self, key, seconds): + def subtractTime(self, key, seconds): project = self.findProject(key) if project is None: return cur = None try: cur = self.con.cursor() - project.substractTime(cur, seconds) + project.subtractTime(cur, seconds) finally: tolerantClose(cur) @@ -554,7 +554,7 @@ seconds = human_seconds(timespec) if seconds > 0: seconds = timedelta(seconds=seconds) - self.substractTime(key, seconds) + self.subtractTime(key, seconds) except ValueError: pass stdscr.erase() @@ -676,7 +676,7 @@ cur = None try: cur = self.con.cursor() - self.current_project.substractTime(cur, seconds) + self.current_project.subtractTime(cur, seconds) finally: tolerantClose(cur) except ValueError: