TW-1588: Fix broken export scripts

This commit is contained in:
Wilhelm Schuermann 2015-03-31 06:57:04 +02:00
parent df209b9b8b
commit 3f394fa164
8 changed files with 10 additions and 8 deletions

View file

@ -10,6 +10,8 @@
Ulf Eliasson).
- TW-1587 Fix and improve example on-exit hook, adjust to new hooks API
(thanks to Jochen Sprickerhof).
- TW-1588 Most Export scripts cannot deal with new export format (thanks to
Scott Carter).
- Setting 'bulk' to zero is interpreted as infinity, which means there is no
amount of changes that is considered dangerous (thanks to Tomas Babej).

View file

@ -48,7 +48,7 @@ if ($command =~ /No matches/)
print "'uuid','status','tags','entry','start','due','recur','end','project',",
"'priority','fg','bg','description'\n";
for my $task (split /,$/ms, qx{$command})
for my $task (split "\n", qx{$command})
{
my $data = from_json ($task);

View file

@ -60,7 +60,7 @@ print "<html>\n",
" <tbody>\n";
my $count = 0;
for my $task (split /\n/ms, qx{$command})
for my $task (split "\n", qx{$command})
{
++$count;
my $data = from_json ($task);

View file

@ -49,7 +49,7 @@ print "BEGIN:VCALENDAR\n",
"VERSION:2.0\n",
"PRODID:=//GBF/taskwarrior 1.9.4//EN\n";
for my $task (split /,$/ms, qx{$command})
for my $task (split "\n", qx{$command})
{
my $data = from_json ($task);

View file

@ -140,10 +140,10 @@ def main():
""" Return a list of SQL statements. """
# Use the taskwarrior 2.0+ export command to filter and return JSON
command = "task rc.verbose=nothing rc.json.array=no export " + " ".join(sys.argv[1:])
command = "task rc.verbose=nothing rc.json.array=yes " + " ".join(sys.argv[1:]) + " export"
# Load each task from json to a python dict
tasks = map(json.loads, commands.getoutput(command).split(",\n"))
tasks = json.loads(commands.getoutput(command))
# Mangle datetime strings into python datetime objects
tasks = map(parse_datetime, tasks)

View file

@ -48,7 +48,7 @@ if ($command =~ /No matches/)
print "uuid\tstatus\ttags\tentry\tstart\tdue\trecur\tend\tproject\t",
"priority\tfg\tbg\tdescription\n";
for my $task (split /,$/ms, qx{$command})
for my $task (split "\n", qx{$command})
{
my $data = from_json ($task);

View file

@ -46,7 +46,7 @@ if ($command =~ /No matches/)
# Generate output.
print "<tasks>\n";
for my $task (split /,$/ms, qx{$command})
for my $task (split "\n", qx{$command})
{
my $data = from_json ($task);

View file

@ -48,7 +48,7 @@ if ($command =~ /No matches/)
print "'uuid','status','tags','entry','start','due','recur','end','project',",
"'priority','fg','bg','description'\n";
for my $task (split /,$/ms, qx{$command})
for my $task (split "\n", qx{$command})
{
my $data = from_json ($task);