From: Tomas Babej Date: Fri, 19 Dec 2014 07:58:12 +0000 (+0100) Subject: Task: Allow setting attributes via keyword arguments X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/94038d3bb43acee54055ca075baa70cba6ad6263 Task: Allow setting attributes via keyword arguments --- diff --git a/tasklib/task.py b/tasklib/task.py index 0953588..170fc77 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -95,9 +95,13 @@ class Task(TaskResource): """ pass - def __init__(self, warrior, data={}): + def __init__(self, warrior, data={}, **kwargs): self.warrior = warrior - self._load_data(data) + + # We keep data for backwards compatibility + kwargs.update(data) + + self._load_data(kwargs) self._modified_fields = set() def __unicode__(self):