diff --git a/ChangeLog b/ChangeLog index 5d3920c0d..d52c2d202 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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). diff --git a/scripts/add-ons/export-csv.pl b/scripts/add-ons/export-csv.pl index 2a7f0d915..eebd631bf 100755 --- a/scripts/add-ons/export-csv.pl +++ b/scripts/add-ons/export-csv.pl @@ -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); diff --git a/scripts/add-ons/export-html.pl b/scripts/add-ons/export-html.pl index fd605807f..27832875e 100755 --- a/scripts/add-ons/export-html.pl +++ b/scripts/add-ons/export-html.pl @@ -60,7 +60,7 @@ print "\n", " \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); diff --git a/scripts/add-ons/export-ical.pl b/scripts/add-ons/export-ical.pl index f7412ea3e..75ce8f803 100755 --- a/scripts/add-ons/export-ical.pl +++ b/scripts/add-ons/export-ical.pl @@ -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); diff --git a/scripts/add-ons/export-sql.py b/scripts/add-ons/export-sql.py index 1752ad204..36dd07d2f 100755 --- a/scripts/add-ons/export-sql.py +++ b/scripts/add-ons/export-sql.py @@ -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) diff --git a/scripts/add-ons/export-tsv.pl b/scripts/add-ons/export-tsv.pl index 00d2f7b6e..a51e3994c 100755 --- a/scripts/add-ons/export-tsv.pl +++ b/scripts/add-ons/export-tsv.pl @@ -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); diff --git a/scripts/add-ons/export-xml.pl b/scripts/add-ons/export-xml.pl index 3d93b7beb..c0763ac1d 100755 --- a/scripts/add-ons/export-xml.pl +++ b/scripts/add-ons/export-xml.pl @@ -46,7 +46,7 @@ if ($command =~ /No matches/) # Generate output. print "\n"; -for my $task (split /,$/ms, qx{$command}) +for my $task (split "\n", qx{$command}) { my $data = from_json ($task); diff --git a/scripts/add-ons/export-yad.pl b/scripts/add-ons/export-yad.pl index 565c939f0..e20589059 100755 --- a/scripts/add-ons/export-yad.pl +++ b/scripts/add-ons/export-yad.pl @@ -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);