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
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
------------
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
------------
from setuptools import setup, find_packages
-version = '0.3.1'
+version = '0.4.0'
setup(
name='tasklib',
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',
+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'
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):
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]
+# coding=utf-8
+
import shutil
import tempfile
import unittest
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()