Source

mekk.rtm / src / mekk / rtm / rtm_client.py

Diff from to

File src/mekk/rtm/rtm_client.py

 
         return task
 
+    def move_task(self, task_key, new_list_id):
+        """
+        Moves given task to new list. Returns current task state.
+        Note that task key changes after this operation!
+        """
+        timeline = self._get_timeline()
+        r = self.connector.call(
+            "rtm.tasks.moveTo",
+            timeline = timeline,
+            from_list_id = task_key.list_id,
+            to_list_id = new_list_id,
+            taskseries_id = task_key.taskseries_id,
+            task_id = task_key.task_id)
+        task = RtmClient._parse_task(
+            new_list_id,
+            RtmClient._ensure_element_is_singular(r['list']['taskseries']))
+        return task
+
     def add_task_note(self, task_key, 
                       note_title, note_text):
         """