From 3ed126975375f62b9777bcf895ab9565380881df Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 9 Oct 2008 18:24:35 -0400 Subject: [PATCH] - Added support for plain text shadow files. --- AUTHORS | 1 + ChangeLog | 11 ++++++++-- NEWS | 2 +- TUTORIAL | 2 +- html/advanced.html | 5 +++++ html/task.html | 37 +++++++++------------------------ html/versions.html | 41 ++++++++++++++++++++++++++++++++++++- src/task.cpp | 51 ++++++++++++++++++++++++++++------------------ 8 files changed, 98 insertions(+), 52 deletions(-) diff --git a/AUTHORS b/AUTHORS index d045cad9b..027de8b31 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,4 +17,5 @@ With thanks to: Stas Antons Vincent Fleuranceau T. Charles Yun + ArchiMark diff --git a/ChangeLog b/ChangeLog index 756fddc64..92da6b0b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,15 @@ represents a feature release, and the Z represents a patch. ------ current release --------------------------- +1.4.3 (10/9/2008) + + Fixed misleading task count at bottom on "info" report. + + Added support for a shadow file that contains a plain text task report, + with the "shadow.file" and "shadow.command" configuration variables. + The shadow file is automatically updated whenever the task database + changes. Useful for integrating with "Samurize". + +------ old releases ------------------------------ + 1.4.2 (9/18/2008) + "task undo" can now retract a "task done" command, provided no reports have been run (and therefore TDB::gc run) @@ -30,8 +39,6 @@ represents a feature release, and the Z represents a patch. + Bug: Source now properly includes in order to build clean using gcc 4.3 (thanks to H. İbrahim Güngör) ------- old releases ------------------------------ - 1.4.1 (7/18/2008) + Bug: Descriptions can not be altered with "task 123 New description" + Tweak: For "task calendar" month names are now centered over the month diff --git a/NEWS b/NEWS index 18b4251e8..e936a4cb7 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -Welcome to Task 1.4.0. +Welcome to Task 1.4.3. Task has been built and tested on the following configurations: diff --git a/TUTORIAL b/TUTORIAL index 7f635f4c2..e389b623a 100644 --- a/TUTORIAL +++ b/TUTORIAL @@ -1,5 +1,5 @@ -This TUTORIAL file has been deprecated. It is superceded by a richer and more +This TUTORIAL file has been deprecated. It is superseded by a richer and more extensive online version that can be found at: http://www.beckingham.net/task.html diff --git a/html/advanced.html b/html/advanced.html index 126bbf3a2..6c1baebfa 100644 --- a/html/advanced.html +++ b/html/advanced.html @@ -319,6 +319,7 @@ ID Project Pri Description in the .taskrc file, then task will record every command that is run. When this command is run, task will display a count of how many times each command was used. +

@@ -326,6 +327,10 @@ ID Project Pri Description actually used.

+

+ This command is deprecated, and will be removed in task 1.5.0 +

+ % task version

This can be used to show the version number of task, and to display diff --git a/html/task.html b/html/task.html index 5218402bf..88a6048fd 100644 --- a/html/task.html +++ b/html/task.html @@ -1,7 +1,7 @@ - Task 1.4.2 + Task 1.4.3 @@ -75,12 +75,12 @@ - +
Source:task-1.4.2.tar.gztask-1.4.3.tar.gz
-

New in version 1.4.2 (9/18/2008)

+

New in version 1.4.3 (9/18/2008)

diff --git a/html/versions.html b/html/versions.html index 81bdcdecc..409c74fa4 100644 --- a/html/versions.html +++ b/html/versions.html @@ -35,12 +35,51 @@

+

+

New in version 1.4.2 (9/18/2008)

+ task-1.4.2.tar.gz +
+ Mac OS X 10.5 (Leopard) Intel-only: + task-1.4.2.pkg +
+ Debian package: task_1.4.2-1_i386.deb + (Thanks to Richard Querin) +

+ +
    +
  • "task undo" can now retract a "task done" command, provided no + reports have been run. +
  • Task now correctly sorts on entire strings, instead of just the + first character (thanks to Andy Lester). +
  • Task now uses dashes (-----) to underline column headings when + color is disabled (thanks to Vincent Fleuranceau). +
  • Task now allows mixed case attribute names (pri:, PRI:, Pri: ...) + and commands (add, ADD, Add ...) (thanks to Vincent Fleuranceau). +
  • Task now supports a default project and priority for new tasks, via + the new "default.project" and "default.priority" configuration variables + (thanks to Vincent Fleuranceau). +
  • Task supports improved word-wrapping to the terminal width. +
  • Task now supports "default.command" configuration variable (for example + it could contain "list due:tomorrow") which is the command that is run + whenever task is invoked with no arguments. +
  • Task supports modifying the existing description of a task, with the + following syntax: task <id> "new description ...". +
  • Fixed bug so that relative dates in filters (task list due:eom, + task list due:tomorrow, task list due:23rd ...) are now properly + supported. +
  • Fixed bug so that source now properly includes <string.h> in + order to build clean using gcc 4.3 (thanks to H. İbrahim Güngör) +
+

New in version 1.4.1 (7/18/2008)

task-1.4.1.tar.gz
Mac OS X 10.5 (Leopard) Intel-only: task-1.4.1.pkg +
+ Debian package: task_1.4.1-1_i386.deb + (Thanks to Richard Querin)

    @@ -54,7 +93,7 @@

    New in version 1.4.0 (7/10/2008)

    Source: task-1.4.0.tar.gz
    - Debian package: task_1.4.1-1_i386.deb + Debian package: task_1.4.0-1_i386.deb (Thanks to Richard Querin)

    diff --git a/src/task.cpp b/src/task.cpp index 11f9a6524..8e3b530b1 100644 --- a/src/task.cpp +++ b/src/task.cpp @@ -666,36 +666,47 @@ void updateRecurrenceMask ( // Using gTdb and gConf, generate a report. void onChangeCallback () { - if (gConf && gTdb) + try { - gConf->set ("curses", "off"); - gConf->set ("color", "off"); - - // Determine if shadow file is enabled. - std::string shadowFile = expandPath (gConf->get ("shadow.file")); - if (shadowFile != "") + if (gConf && gTdb) { - std::string command = gConf->get ("shadow.command", "list"); - int width = gConf->get ("shadow.width", 80); + gConf->set ("curses", "off"); + gConf->set ("color", "off"); - // Run report. - try + // Determine if shadow file is enabled. + std::string shadowFile = expandPath (gConf->get ("shadow.file")); + if (shadowFile != "") { + // Capture std::cout for the shadow file. + std::ofstream shadow (shadowFile.c_str ()); + std::streambuf* original = std::cout.rdbuf (shadow.rdbuf ()); + + // Run report. Use shadow.command, using default.command as a fallback + // with "list" as a default. + std::string command = gConf->get ("shadow.command", + gConf->get ("default.command", "list")); std::vector args; split (args, command, ' '); runTaskCommand (args, *gTdb, *gConf); - } - catch (std::string& error) - { - std::cout << error << std::endl; - } - - catch (...) - { - std::cout << "Unknown error." << std::endl; + // Restore std::cout. + std::cout.rdbuf (original); } + else + throw std::string ("Could not write to '") + shadowFile + "'."; } + else + throw std::string ("Internal error (TDB/Config)."); + } + + catch (std::string& error) + { + std::cout << error << std::endl; + } + + catch (...) + { + std::cout << "Unknown error." << std::endl; } }