Software Freedom Law Center

Changeset 177

Show
Ignore:
Timestamp:
07/13/08 17:09:13 (3 months ago)
Author:
landon
Message:

Updated entry.py to use gozerbot's new REST server

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/antimatter/luke/myplugs/libtracker/entry.py

    r176 r177  
    11""" Abstract database interface for time manipulation """ 
    22 
    3 from myplugs.timedbplug.timedb import TimeObj 
     3from gozerbot.rest.client import RestClient 
     4 
     5baseurl = 'http://localhost:8888/timedb' 
    46 
    57def 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 

SFLC Main Page

[frdm] Support SFLC