class RtMilkManager(object):
"""
Interface with rememberthemilk.com
+
+ @todo Decide upon an interface that will end up a bit less bloated
+ @todo Add interface for task tags
+ @todo Add interface for postponing tasks (have way for UI to specify how many days to postpone?)
+ @todo Add interface for task recurrence
+ @todo Add interface for task estimate
+ @todo Add interface for task location
+ @todo Add interface for task url
+ @todo Add interface for task notes
+ @todo Add undo support
"""
API_KEY = '71f471f7c6ecdda6def341967686fe05'
SECRET = '7d3248b085f7efbe'
return locations
def get_tasks_with_details(self, projId):
- for taskSeries in self._get_taskseries(projId):
+ for realProjId, taskSeries in self._get_taskseries(projId):
for task in self._get_tasks(taskSeries):
- taskId = self._pack_ids(projId, taskSeries.id, task.id)
+ taskId = self._pack_ids(realProjId, taskSeries.id, task.id)
priority = task.priority if task.priority != "N" else ""
yield {
"id": taskId,
def get_task_details(self, taskId):
projId, seriesId, taskId = self._unpack_ids(taskId)
- for taskSeries in self._get_taskseries(projId):
+ for realProjId, taskSeries in self._get_taskseries(projId):
+ assert projId == realProjId, "%s != %s, looks like we let leak a metalist id when packing a task id" % (projId, realProjId)
curSeriesId = taskSeries.id
if seriesId != curSeriesId:
continue
continue
return {
"id": taskId,
- "projId": projId,
+ "projId": realProjId,
"name": taskSeries.name,
"url": fix_url(taskSeries.url),
"locationId": taskSeries.location_id,
def set_project(self, taskId, newProjId):
projId, seriesId, taskId = self._unpack_ids(taskId)
- rsp = self._rtm.tasks.setName(
+ rsp = self._rtm.tasks.moveTo(
timeline=self._timeline,
from_list_id=projId,
to_list_id=newProjId,
rspTasksList = (rspTasksList, )
for something in rspTasksList:
+ realProjId = something.id
try:
something.taskseries
except AttributeError:
somethingsTaskseries = (something.taskseries, )
for taskSeries in somethingsTaskseries:
- yield taskSeries
+ yield realProjId, taskSeries
def _get_tasks(self, taskSeries):
if isinstance(taskSeries.task, list):