Changeset 177
- Timestamp:
- 07/13/08 17:09:13 (3 months ago)
- Files:
-
- trunk/antimatter/luke/myplugs/libtracker/entry.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/antimatter/luke/myplugs/libtracker/entry.py
r176 r177 1 1 """ Abstract database interface for time manipulation """ 2 2 3 from myplugs.timedbplug.timedb import TimeObj 3 from gozerbot.rest.client import RestClient 4 5 baseurl = 'http://localhost:8888/timedb' 4 6 5 7 def add(user, adjustment): 6 restconn = TimeObj('http://localhost:8888/timedb/') 7 result = restconn.add(user.name, adjustment.category, adjustment.start, adjustment.duration) 8 return result 8 restconn = RestClient(baseurl + '/entries') 9 result = restconn.add(name=user.name, category=adjustment.category, start=adjustment.start, elapsed=adjustment.duration) 10 if result.error: 11 return result.error 12 return result.data