X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/f0ceeddfda580cc3bb0786f7e895d28b907a5c2a..a8a458c71b1a1f6e23fb734da35c349b14f5c462:/tasklib/task.py diff --git a/tasklib/task.py b/tasklib/task.py index c821fcc..c40a3c7 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -1,6 +1,5 @@ from __future__ import print_function import copy -import datetime import importlib import json import logging @@ -76,7 +75,6 @@ class TaskResource(SerializingObject): if update_original: self._original_data = copy.deepcopy(self._data) - def __getitem__(self, key): # This is a workaround to make TaskResource non-iterable # over simple index-based iteration @@ -121,7 +119,7 @@ class TaskResource(SerializingObject): # to pass that to TaskWarrior. data_tuples = filter(lambda t: t[1] is not '', data_tuples) data = dict(data_tuples) - return json.dumps(data, separators=(',',':')) + return json.dumps(data, separators=(',', ':')) @property def _modified_fields(self): @@ -274,7 +272,6 @@ class Task(TaskResource): # If the tasks are not saved, compare the actual instances return id(self) == id(other) - def __hash__(self): if self['uuid']: # For saved Tasks, just define equality by equality of uuids @@ -420,6 +417,7 @@ class Task(TaskResource): else: self._load_data(new_data) + class TaskQuerySet(object): """ Represents a lazy lookup for a task objects.