Giter Club home page Giter Club logo

taskd-client-py's Introduction

taskd-client-py

PyPI version Build Status

A client library providing an interface to Taskd (from taskwarrior)

Library users will have some obligations as per the protocol. (key storage, sync key, tasks themselves (and additional data), etc)

Getting Started

  • pip install taskc
from taskc.simple import TaskdConnection
tc = TaskdConnection.from_taskrc() # only works if you have taskwarrior setup
resp = tc.pull()

User considerations

  • For taskd < 1.1.0 set client.allow in your taskd config ex: client.allow=^task [2-9],^Mirakel [1-9],^taskc-py [0-9]
  • optionally enable connection debugging for output when running taskd interactively debug.tls=2
  • for convience we're assuming ~/.task is your taskwarrior conf dir
  • if you run into trouble

taskd-client-py's People

Contributors

asabine avatar dependabot-preview[bot] avatar dependabot-support avatar ifbizo avatar jrabbit avatar philipsd6 avatar shir0kamii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

taskd-client-py's Issues

Allow whitespace in config

I believe I see an error if there is whitespace in .taskrc, like the following:

taskd.certificate = /home/jack/.task/jacklaxson.cert.pem
taskd.key         = /home/jack/.task/jacklaxson.key.pem
taskd.server      = 192.168.1.129:53589
taskd.credentials = Public/Jack Laxson/f60bfcb9-b7b8-4466-b4c1-7276b8afe609
taskd.trust       = yes
taskd.ca          = /home/jack/.task/ca.cert.pem

Right now, I think we're required to use no whitespace:

taskd.certificate=/home/jack/.task/jacklaxson.cert.pem
taskd.key=/home/jack/.task/jacklaxson.key.pem
taskd.server=192.168.1.129:53589
taskd.credentials=Public/Jack Laxson/f60bfcb9-b7b8-4466-b4c1-7276b8afe609
taskd.trust=yes
taskd.ca=/home/jack/.task/ca.cert.pem

Feature request: allow whitespace in .taskrc.

Cadata support on python2.7

Traceback (most recent call last):
  File "simple.py", line 123, in <module>
    taskd.connect()
  File "simple.py", line 38, in connect
    c.load_verify_locations(cadata=self.cacert)
ssl.SSLError: nested asn1 error (_ssl.c:2626)

End PY2 Support

Py2 support is ending for most things at the end of the year

Docker based tests

tests should run against jrabbit/taskd e.g. docker run -it --rm --name mytaskd -P jrabbit/taskd

pull/put imply connect

In [12]: foo.pull()
Status Good!
Out[12]: <taskc.transaction.TaskdResponse instance at 0x7fb1e151bb00>

In [13]: x = foo.pull()
---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-13-7c5655618c0d> in <module>()
----> 1 x = foo.pull()

/home/jack/Projects/taskd-client-py/taskc/simple.py in pull(self)
    129         self.conn.sendall(self._mkmsg("sync"))
    130 
--> 131         return self.recv()
    132 
    133     def put(self, tasks):

/home/jack/Projects/taskd-client-py/taskc/simple.py in recv(self)
     80         # Read the number of bytes of the message
     81         # ">L" is 4 bytes long in big endian
---> 82         bytes = struct.unpack('>L', a[:4])[0]
     83 
     84         # Read the message itself

error: unpack requires a string argument of length 4

odd behavior with empty task list?

Traceback:
File "/home/jack/Projects/Gegant/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/jack/Projects/Gegant/venv/local/lib/python2.7/site-packages/django/views/generic/base.py" in view
  71.             return self.dispatch(request, *args, **kwargs)
File "/home/jack/Projects/Gegant/venv/local/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
  89.         return handler(request, *args, **kwargs)
File "/home/jack/Projects/Gegant/venv/local/lib/python2.7/site-packages/django/views/generic/base.py" in get
  158.         context = self.get_context_data(**kwargs)
File "/home/jack/Projects/Gegant/gegantweb/views.py" in get_context_data
  237.         resp = tc.pull()
File "/home/jack/Projects/Gegant/venv/src/taskc-master/taskc/simple.py" in pull
  76.         self.conn.sendall(self._mkmsg("sync"))
File "/home/jack/Projects/Gegant/venv/src/taskc-master/taskc/simple.py" in _mkmsg
  67.         return transaction.prep_message(msg)
File "/home/jack/Projects/Gegant/venv/src/taskc-master/taskc/transaction.py" in prep_message
  16.     our_len = len(msg.as_string()) + 4
File "/usr/lib/python2.7/email/message.py" in as_string
  137.         g.flatten(self, unixfrom=unixfrom)
File "/usr/lib/python2.7/email/generator.py" in flatten
  83.         self._write(msg)
File "/usr/lib/python2.7/email/generator.py" in _write
  115.             self._write_headers(msg)
File "/usr/lib/python2.7/email/generator.py" in _write_headers
  164.                     v, maxlinelen=self._maxheaderlen, header_name=h).encode()
File "/usr/lib/python2.7/email/header.py" in encode
  407.             newchunks += self._split(s, charset, targetlen, splitchars)
File "/usr/lib/python2.7/email/header.py" in _split
  292.         elen = charset.encoded_header_len(encoded)
File "/usr/lib/python2.7/email/charset.py" in encoded_header_len
  345.             return len(s)
File "/home/jack/Projects/Gegant/venv/local/lib/python2.7/site-packages/django/utils/functional.py" in inner
  227.         return func(self._wrapped, *args)

Exception Type: TypeError at /view/taskw
Exception Value: object of type 'User' has no len()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.