From: Rob Golding Date: Sat, 13 Feb 2016 23:19:58 +0000 (+0000) Subject: Merge branch 'release/0.12.1' X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/f97d6c209f065d708b497e377607e2a0e91e8f79?hp=40c76c99eba2484594a692b797e31960644b7786 Merge branch 'release/0.12.1' --- diff --git a/.coveragerc b/.coveragerc index aa6418a..264003a 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,2 +1,5 @@ [report] omit = */tests.py +exclude_lines = + raise NotImplementedError + @abc.abstractmethod diff --git a/.travis.yml b/.travis.yml index f579787..721c530 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ env: - TASK_VERSION=v2.4.3 - TASK_VERSION=v2.4.4 - TASK_VERSION=v2.5.0 - - TASK_VERSION=v2.5.1 + - TASK_VERSION=2.5.1 python: - "2.7" - "3.3" diff --git a/docs/conf.py b/docs/conf.py index 9b679e0..d1a1ce1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,9 +51,9 @@ copyright = u'2014, Rob Golding' # built documents. # # The short X.Y version. -version = '0.12.0' +version = '0.12.1' # The full version, including alpha/beta/rc tags. -release = '0.12.0' +release = '0.12.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index eea0197..b7ebe9c 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages install_requirements = ['six==1.5.2', 'pytz', 'tzlocal'] -version = '0.12.0' +version = '0.12.1' try: import importlib diff --git a/tasklib/backends.py b/tasklib/backends.py index 76fce88..6e7d918 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -323,8 +323,10 @@ class TaskWarrior(Backend): id_lines = [l for l in output if l.startswith('Created task ')] # Complain loudly if it seems that more tasks were created - # Should not happen - if len(id_lines) != 1 or len(id_lines[0].split(' ')) != 3: + # Should not happen. + # Expected output: Created task 1. + # Created task 1 (recurrence template). + if len(id_lines) != 1 or len(id_lines[0].split(' ')) not in (3, 5): raise TaskWarriorException("Unexpected output when creating " "task: %s" % '\n'.join(id_lines)) diff --git a/tasklib/lazy.py b/tasklib/lazy.py index aa2c065..a1b63ef 100644 --- a/tasklib/lazy.py +++ b/tasklib/lazy.py @@ -42,6 +42,12 @@ class LazyUUIDTask(object): def __repr__(self): return "LazyUUIDTask: {0}".format(self._uuid) + def __copy__(self): + return LazyUUIDTask(self._tw, self._uuid) + + def __deepcopy__(self, memo): + return LazyUUIDTask(self._tw, self._uuid) + @property def saved(self): """ diff --git a/tasklib/tests.py b/tasklib/tests.py index b0e342d..be54504 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -781,6 +781,14 @@ class TaskFromHookTest(TasklibTest): '"start":"20141119T152233Z",' '"uuid":"a360fc44-315c-4366-b70c-ea7e7520b749"}') + input_add_data_recurring = six.StringIO( + '{"description":"Mow the lawn",' + '"entry":"20160210T224304Z",' + '"parent":"62da6227-519c-42c2-915d-dccada926ad7",' + '"recur":"weekly",' + '"status":"pending",' + '"uuid":"81305335-0237-49ff-8e87-b3cdc2369cec"}') + input_modify_data = six.StringIO(input_add_data.getvalue() + '\n' + '{"description":"Buy some milk finally",' '"entry":"20141118T050231Z",' @@ -797,6 +805,12 @@ class TaskFromHookTest(TasklibTest): self.assertEqual(t['description'], "Buy some milk") self.assertEqual(t.pending, True) + def test_setting_up_from_add_hook_input_recurring(self): + t = Task.from_input(input_file=self.input_add_data_recurring, + backend=self.tw) + self.assertEqual(t['description'], "Mow the lawn") + self.assertEqual(t.pending, True) + def test_setting_up_from_modified_hook_input(self): t = Task.from_input(input_file=self.input_modify_data, modify=True, backend=self.tw)