mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-04 10:37:19 +02:00
TW-1588: Fix broken export scripts
This commit is contained in:
parent
df209b9b8b
commit
3f394fa164
8 changed files with 10 additions and 8 deletions
|
@ -10,6 +10,8 @@
|
||||||
Ulf Eliasson).
|
Ulf Eliasson).
|
||||||
- TW-1587 Fix and improve example on-exit hook, adjust to new hooks API
|
- TW-1587 Fix and improve example on-exit hook, adjust to new hooks API
|
||||||
(thanks to Jochen Sprickerhof).
|
(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
|
- Setting 'bulk' to zero is interpreted as infinity, which means there is no
|
||||||
amount of changes that is considered dangerous (thanks to Tomas Babej).
|
amount of changes that is considered dangerous (thanks to Tomas Babej).
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ if ($command =~ /No matches/)
|
||||||
print "'uuid','status','tags','entry','start','due','recur','end','project',",
|
print "'uuid','status','tags','entry','start','due','recur','end','project',",
|
||||||
"'priority','fg','bg','description'\n";
|
"'priority','fg','bg','description'\n";
|
||||||
|
|
||||||
for my $task (split /,$/ms, qx{$command})
|
for my $task (split "\n", qx{$command})
|
||||||
{
|
{
|
||||||
my $data = from_json ($task);
|
my $data = from_json ($task);
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ print "<html>\n",
|
||||||
" <tbody>\n";
|
" <tbody>\n";
|
||||||
|
|
||||||
my $count = 0;
|
my $count = 0;
|
||||||
for my $task (split /\n/ms, qx{$command})
|
for my $task (split "\n", qx{$command})
|
||||||
{
|
{
|
||||||
++$count;
|
++$count;
|
||||||
my $data = from_json ($task);
|
my $data = from_json ($task);
|
||||||
|
|
|
@ -49,7 +49,7 @@ print "BEGIN:VCALENDAR\n",
|
||||||
"VERSION:2.0\n",
|
"VERSION:2.0\n",
|
||||||
"PRODID:=//GBF/taskwarrior 1.9.4//EN\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);
|
my $data = from_json ($task);
|
||||||
|
|
||||||
|
|
|
@ -140,10 +140,10 @@ def main():
|
||||||
""" Return a list of SQL statements. """
|
""" Return a list of SQL statements. """
|
||||||
|
|
||||||
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
# 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
|
# 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
|
# Mangle datetime strings into python datetime objects
|
||||||
tasks = map(parse_datetime, tasks)
|
tasks = map(parse_datetime, tasks)
|
||||||
|
|
|
@ -48,7 +48,7 @@ if ($command =~ /No matches/)
|
||||||
print "uuid\tstatus\ttags\tentry\tstart\tdue\trecur\tend\tproject\t",
|
print "uuid\tstatus\ttags\tentry\tstart\tdue\trecur\tend\tproject\t",
|
||||||
"priority\tfg\tbg\tdescription\n";
|
"priority\tfg\tbg\tdescription\n";
|
||||||
|
|
||||||
for my $task (split /,$/ms, qx{$command})
|
for my $task (split "\n", qx{$command})
|
||||||
{
|
{
|
||||||
my $data = from_json ($task);
|
my $data = from_json ($task);
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ if ($command =~ /No matches/)
|
||||||
|
|
||||||
# Generate output.
|
# Generate output.
|
||||||
print "<tasks>\n";
|
print "<tasks>\n";
|
||||||
for my $task (split /,$/ms, qx{$command})
|
for my $task (split "\n", qx{$command})
|
||||||
{
|
{
|
||||||
my $data = from_json ($task);
|
my $data = from_json ($task);
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ if ($command =~ /No matches/)
|
||||||
print "'uuid','status','tags','entry','start','due','recur','end','project',",
|
print "'uuid','status','tags','entry','start','due','recur','end','project',",
|
||||||
"'priority','fg','bg','description'\n";
|
"'priority','fg','bg','description'\n";
|
||||||
|
|
||||||
for my $task (split /,$/ms, qx{$command})
|
for my $task (split "\n", qx{$command})
|
||||||
{
|
{
|
||||||
my $data = from_json ($task);
|
my $data = from_json ($task);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue