# HG changeset patch # User zack # Date 1315536410 14400 # Node ID 6af374f5229500e9b28f60b7d61cbcb4116c0c44 # Parent 2f7fcbc59b021cbcea2205977d5091a32e757796 Fix taskline parsing to allow pipes(|) in task diff -r 2f7fcbc59b02 -r 6af374f52295 t.py --- a/t.py Mon May 09 21:22:15 2011 -0400 +++ b/t.py Thu Sep 08 22:46:50 2011 -0400 @@ -52,7 +52,7 @@ supported to enable editing of the taskfile with a simple text editor. """ if '|' in taskline: - text, _, meta = taskline.partition('|') + text, _, meta = taskline.rpartition('|') task = { 'text': text.strip() } for piece in meta.strip().split(','): label, data = piece.split(':') diff -r 2f7fcbc59b02 -r 6af374f52295 tests/basic.t --- a/tests/basic.t Mon May 09 21:22:15 2011 -0400 +++ b/tests/basic.t Thu Sep 08 22:46:50 2011 -0400 @@ -12,12 +12,21 @@ $ xt 3 - Sample one. 7 - Sample two. + $ xt 'this | that' + $ xt + 3 - Sample one. + 4 - this | that + 7 - Sample two. Finishing tasks: $ xt -f 3 $ xt + 4 - this | that 7 - Sample two. $ xt -f 7 $ xt + 4 - this | that + $ xt -f 4 + $ xt diff -r 2f7fcbc59b02 -r 6af374f52295 tests/editing.t --- a/tests/editing.t Mon May 09 21:22:15 2011 -0400 +++ b/tests/editing.t Thu Sep 08 22:46:50 2011 -0400 @@ -10,10 +10,23 @@ $ xt -e a New sample. $ xt a - New sample. + $ xt 'this | that' + $ xt + 4 - this | that + a - New sample. + $ xt -e 4 'this &| that' + $ xt + 4 - this &| that + a - New sample. Sed-style substitution: $ xt -e a 's/New/Testing/' $ xt + 4 - this &| that + a - Testing sample. + $ xt -e 4 '/this &/this /' + $ xt + 4 - this | that a - Testing sample. diff -r 2f7fcbc59b02 -r 6af374f52295 tests/finished.t --- a/tests/finished.t Mon May 09 21:22:15 2011 -0400 +++ b/tests/finished.t Thu Sep 08 22:46:50 2011 -0400 @@ -8,6 +8,7 @@ $ xt Sample two. $ xt Sample three. $ xt Sample four. + $ xt 'this | that' Finish and test .test.done: @@ -29,4 +30,11 @@ Sample one. | id:329950673481cb1c19102c982bfc63e745ab4a6f Sample two. | id:7a4dc18c23f3b890602da09da1690ccfb4c87bd1 Sample three. | id:90cf0626ca134e0aa6453b3562dc1c8bb34f1568 + $ xt -f 4 + $ cat .test.done + Sample four. | id:1dd56b09a9ca0fdf4f2a8c0959a298098eb8f7de + Sample one. | id:329950673481cb1c19102c982bfc63e745ab4a6f + this | that | id:48ad7c827191fa3c896d13b47f618ff1732e911e + Sample two. | id:7a4dc18c23f3b890602da09da1690ccfb4c87bd1 + Sample three. | id:90cf0626ca134e0aa6453b3562dc1c8bb34f1568