Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tbabej committed Oct 10, 2021
2 parents bbf5d9c + a58088f commit 3246c0d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
# built documents.
#
# The short X.Y version.
version = '2.4.2'
version = '2.4.3'
# The full version, including alpha/beta/rc tags.
release = '2.4.2'
release = '2.4.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

install_requirements = ['pytz', 'tzlocal']

version = '2.4.2'
version = '2.4.3'

try:
import importlib
Expand Down
2 changes: 1 addition & 1 deletion tasklib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from .task import Task
from .serializing import local_zone

__version__ = '2.4.2'
__version__ = '2.4.3'
10 changes: 7 additions & 3 deletions tasklib/task.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from __future__ import print_function
import copy
import datetime
import importlib
import json
import logging
import os
import sys

from .serializing import SerializingObject
from .serializing import SerializingObject, local_zone

DATE_FORMAT = '%Y%m%dT%H%M%SZ'
REPR_OUTPUT_SIZE = 10
Expand Down Expand Up @@ -295,7 +296,10 @@ def deleted(self):

@property
def waiting(self):
return self['status'] == 'waiting'
if not self['wait']:
return False

return self['wait'] > local_zone.localize(datetime.datetime.now())

@property
def pending(self):
Expand Down Expand Up @@ -523,7 +527,7 @@ def deleted(self):
return self.filter(status=DELETED)

def waiting(self):
return self.filter(status=WAITING)
return self.filter(wait__after='now')

def recurring(self):
return self.filter(status=RECURRING)
Expand Down
10 changes: 10 additions & 0 deletions tasklib/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ def test_waiting_non_empty(self):

self.assertEqual(len(self.tw.tasks.waiting()), 1)

def test_waiting_property(self):
t = Task(self.tw, description='test task')
t.save()
self.assertFalse(t.waiting)

t['wait'] = datetime.datetime.now() + datetime.timedelta(days=1)
t.save()

self.assertTrue(t.waiting)

def test_recurring_empty(self):
Task(self.tw, description='test task').save()
self.assertEqual(len(self.tw.tasks.recurring()), 0)
Expand Down

0 comments on commit 3246c0d

Please sign in to comment.