]> git.madduck.net Git - etc/taskwarrior.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge branch 'release/0.4.0'
authorRob Golding <rob@robgolding.com>
Sun, 7 Sep 2014 17:31:33 +0000 (18:31 +0100)
committerRob Golding <rob@robgolding.com>
Sun, 7 Sep 2014 17:31:33 +0000 (18:31 +0100)
.travis.yml
README.rst
docs/index.rst
setup.py
tasklib/task.py
tasklib/tests.py

index d456ec96669b17af18dd4c67fd740e5b3a394c70..bc6cd0e201b8046dd813e072be1ae45bbfec631e 100644 (file)
@@ -1,17 +1,19 @@
 language: python
 env:
+  - TASK_VERSION=2.1.1
+  - TASK_VERSION=2.1.2
   - TASK_VERSION=2.2.0
-  - TASK_VERSION=2.3.0.beta2
 python:
   - "2.6"
   - "2.7"
   - "3.2"
   - "3.3"
+  - "3.4"
 install:
   - pip install -e .
   - sudo apt-get install -qq build-essential cmake uuid-dev
-  - wget http://www.taskwarrior.org/download/task-$TASK_VERSION.tar.gz
-  - tar -zxvf task-$TASK_VERSION.tar.gz
+  - wget http://archive.ubuntu.com/ubuntu/pool/universe/t/task/task_$TASK_VERSION.orig.tar.gz
+  - tar -zxvf task_$TASK_VERSION.orig.tar.gz
   - cd task-$TASK_VERSION
   - cmake .
   - make
index c835dc2a6fb5ef0b3577b6df598c9fb1d81a2df1..c8053ef90574233ed011e79060d01e428e54cdac 100644 (file)
@@ -7,13 +7,13 @@ tasklib
 tasklib is a Python library for interacting with taskwarrior_ databases, using
 a queryset API similar to that of Django's ORM.
 
-Supports Python 2.6, 2.7, 3.2 and 3.3 with taskwarrior 2.2.0 or 2.3.0 beta2.
-Older versions of taskwarrior are untested and probably won't work.
+Supports Python 2.6, 2.7, 3.2, 3.3 and 3.4 with taskwarrior 2.1.x and 2.2.x.
+Older versions of taskwarrior are untested and may not work.
 
 Requirements
 ------------
 
-* taskwarrior_ v2.2.0 or v2.3.0 beta2
+* taskwarrior_ v2.1.x or v2.2.x
 
 Installation
 ------------
index 9a86f1c4ab5bade5ffe63237b09cecd178fc49f8..037d75647db1d9c941bff8352ac228c59f4c3b32 100644 (file)
@@ -4,13 +4,13 @@ Welcome to tasklib's documentation!
 tasklib is a Python library for interacting with taskwarrior_ databases, using
 a queryset API similar to that of Django's ORM.
 
-Supports Python 2.6, 2.7, 3.2 and 3.3 with taskwarrior 2.2.0 or 2.3.0 beta2.
-Older versions of taskwarrior are untested and probably won't work.
+Supports Python 2.6, 2.7, 3.2, 3.3 and 3.4 with taskwarrior 2.1.x and 2.2.x.
+Older versions of taskwarrior are untested and may not work.
 
 Requirements
 ------------
 
-* taskwarrior_ v2.2.0 or v2.3.0 beta2
+* taskwarrior_ v2.1.x or v2.2.x
 
 Installation
 ------------
index 3546c3ba73e420561f87547e1116e39b76d12cb9..37a3065553ac8cc09cc8b01587502844db7f8a8d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = '0.3.1'
+version = '0.4.0'
 
 setup(
     name='tasklib',
@@ -15,6 +15,7 @@ setup(
     packages=find_packages(),
     include_package_data=True,
     test_suite='tasklib.tests',
+    install_requires=['six==1.5.2'],
     classifiers=[
         'Development Status :: 4 - Beta',
         'Programming Language :: Python',
index de0443caef2ad4732aafdbca31d393e860ac44ad..6fbce776d658bef73b250983d86042273cb28e57 100644 (file)
@@ -1,8 +1,10 @@
+from __future__ import print_function
 import copy
 import datetime
 import json
 import logging
 import os
+import six
 import subprocess
 
 DATE_FORMAT = '%Y%m%dT%H%M%SZ'
@@ -36,8 +38,11 @@ class TaskResource(object):
         self._data[key] = dehydrate_func(value)
         self._modified_fields.add(key)
 
-    def __repr__(self):
-        return self.__unicode__()
+    def __str__(self):
+        s = six.text_type(self.__unicode__())
+        if not six.PY3:
+            s = s.encode('utf-8')
+        return s
 
 
 class TaskAnnotation(TaskResource):
@@ -297,7 +302,7 @@ class TaskWarrior(object):
         logger.debug(' '.join(command_args))
         p = subprocess.Popen(command_args, stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE)
-        stdout, stderr = [x.decode() for x in p.communicate()]
+        stdout, stderr = [x.decode('utf-8') for x in p.communicate()]
         if p.returncode:
             if stderr.strip():
                 error_msg = stderr.strip().splitlines()[-1]
index c738739d713a365f530ba8c7ba6d1f643cede7a4..4ff4e03e255082051b08de1067bff41c1b123659 100644 (file)
@@ -1,3 +1,5 @@
+# coding=utf-8
+
 import shutil
 import tempfile
 import unittest
@@ -76,3 +78,14 @@ class AnnotationTest(TasklibTest):
         ann = task['annotations'][0]
         task.remove_annotation(ann)
         self.assertEqual(len(task['annotations']), 0)
+
+
+class UnicodeTest(TasklibTest):
+
+    def test_unicode_task(self):
+        self.tw.execute_command(['add', '†åßk'])
+        self.tw.tasks.get()
+
+    def test_non_unicode_task(self):
+        self.tw.execute_command(['add', 'task'])
+        self.tw.tasks.get()