mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
Unittest - Helper code to easily parse tx.data
This commit is contained in:
parent
b58c6566af
commit
974045da7a
2 changed files with 36 additions and 1 deletions
|
@ -8,7 +8,7 @@ import atexit
|
|||
from time import sleep
|
||||
from subprocess import Popen
|
||||
from .utils import (find_unused_port, release_port, port_used, run_cmd_wait,
|
||||
which)
|
||||
which, parse_datafile)
|
||||
from .exceptions import CommandError
|
||||
|
||||
try:
|
||||
|
@ -278,4 +278,16 @@ class Taskd(object):
|
|||
else:
|
||||
return True
|
||||
|
||||
def client_data(self, client):
|
||||
"""Return a python list with the content of tx.data matching the given
|
||||
task client. tx.data will be parsed to string and JSON.
|
||||
"""
|
||||
file = os.path.join(self.datadir,
|
||||
client.credentials["org"],
|
||||
"users",
|
||||
client.credentials["userkey"],
|
||||
"tx.data")
|
||||
|
||||
return parse_datafile(file)
|
||||
|
||||
# vim: ai sts=4 et sw=4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue