- Added support for plain text shadow files.

This commit is contained in:
Paul Beckingham 2008-10-09 18:24:35 -04:00
parent a5ec1e4b27
commit 3ed1269753
8 changed files with 98 additions and 52 deletions

View file

@ -17,4 +17,5 @@ With thanks to:
Stas Antons Stas Antons
Vincent Fleuranceau Vincent Fleuranceau
T. Charles Yun T. Charles Yun
ArchiMark

View file

@ -7,6 +7,15 @@ represents a feature release, and the Z represents a patch.
------ current release --------------------------- ------ 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) 1.4.2 (9/18/2008)
+ "task undo" can now retract a "task done" command, provided no reports + "task undo" can now retract a "task done" command, provided no reports
have been run (and therefore TDB::gc run) 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 <string.h> in order to build clean + Bug: Source now properly includes <string.h> in order to build clean
using gcc 4.3 (thanks to H. İbrahim Güngör) using gcc 4.3 (thanks to H. İbrahim Güngör)
------ old releases ------------------------------
1.4.1 (7/18/2008) 1.4.1 (7/18/2008)
+ Bug: Descriptions can not be altered with "task 123 New description" + Bug: Descriptions can not be altered with "task 123 New description"
+ Tweak: For "task calendar" month names are now centered over the month + Tweak: For "task calendar" month names are now centered over the month

2
NEWS
View file

@ -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: Task has been built and tested on the following configurations:

View file

@ -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: extensive online version that can be found at:
http://www.beckingham.net/task.html http://www.beckingham.net/task.html

View file

@ -319,6 +319,7 @@ ID Project Pri Description
in the .taskrc file, then task will record every command that is 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 run. When this command is run, task will display a count of how
many times each command was used. many times each command was used.
</p> </p>
<p> <p>
@ -326,6 +327,10 @@ ID Project Pri Description
actually used. actually used.
</p> </p>
<p>
This command is deprecated, and will be removed in task 1.5.0
</p>
<strong>% task version</strong> <strong>% task version</strong>
<p> <p>
This can be used to show the version number of task, and to display This can be used to show the version number of task, and to display

View file

@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>Task 1.4.2</title> <title>Task 1.4.3</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="task.css" type="text/css" /> <link rel="stylesheet" href="task.css" type="text/css" />
</head> </head>
@ -75,12 +75,12 @@
<table> <table>
<tr> <tr>
<td>Source:</td> <td>Source:</td>
<td><a href="http://www.beckingham.net/task-1.4.2.tar.gz">task-1.4.2.tar.gz</a></td> <td><a href="http://www.beckingham.net/task-1.4.3.tar.gz">task-1.4.3.tar.gz</a></td>
</tr> </tr>
<!-- <!--
<tr> <tr>
<td>Mac OS X 10.5 (Leopard) Intel-only:</td> <td>Mac OS X 10.5 (Leopard) Intel-only:</td>
<td><a href="http://www.beckingham.net/task-1.4.2.pkg">task-1.4.2.pkg</a></td> <td><a href="http://www.beckingham.net/task-1.4.3.pkg">task-1.4.3.pkg</a></td>
</tr> </tr>
--> -->
<!-- <!--
@ -89,35 +89,18 @@
Debian package: Debian package:
(Thanks to <a href="http://blog.rfquerin.org">Richard Querin</a>): (Thanks to <a href="http://blog.rfquerin.org">Richard Querin</a>):
</td> </td>
<td><a href="http://www.beckingham.net/task_1.4.2-1_i386.deb">task_1.4.2-1_i386.deb</a></td> <td><a href="http://www.beckingham.net/task_1.4.3-1_i386.deb">task_1.4.3-1_i386.deb</a></td>
</tr> </tr>
--> -->
</table> </table>
<h4>New in version 1.4.2 (9/18/2008)</h4> <h4>New in version 1.4.3 (9/18/2008)</h4>
<ul> <ul>
<li>"task undo" can now retract a "task done" command, provided no <li>Fixed misleading task count at bottom of "info" report.
reports have been run. <li>Added support for a shadow file that contains a plain text task report,
<li>Task now correctly sorts on entire strings, instead of just the with the "shadow.file" and "shadow.command" configuration variables.
first character (thanks to Andy Lester). The shadow file is automatically updated whenever the task database
<li>Task now uses dashes (-----) to underline column headings when changes. Useful for integrating with "Samurize".
color is disabled (thanks to Vincent Fleuranceau).
<li>Task now allows mixed case attribute names (pri:, PRI:, Pri: ...)
and commands (add, ADD, Add ...) (thanks to Vincent Fleuranceau).
<li>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).
<li>Task supports improved word-wrapping to the terminal width.
<li>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.
<li>Task supports modifying the existing description of a task, with the
following syntax: task &lt;id&gt; "new description ...".
<li>Fixed bug so that relative dates in filters (task list due:eom,
task list due:tomorrow, task list due:23rd ...) are now properly
supported.
<li>Fixed bug so that source now properly includes &lt;string.h&gt; in
order to build clean using gcc 4.3 (thanks to H. İbrahim Güngör)
</ul> </ul>
<p> <p>

View file

@ -35,12 +35,51 @@
<br /> <br />
<div class="content"> <div class="content">
<p>
<h4>New in version 1.4.2 (9/18/2008)</h4>
<a href="http://www.beckingham.net/task-1.4.2.tar.gz">task-1.4.2.tar.gz</a>
<br />
Mac OS X 10.5 (Leopard) Intel-only:
<a href="http://www.beckingham.net/task-1.4.2.pkg">task-1.4.2.pkg</a>
<br />
Debian package: <a href="http://www.beckingham.net/task_1.4.2-1_i386.deb">task_1.4.2-1_i386.deb</a>
(Thanks to <a href="http://blog.rfquerin.org">Richard Querin</a>)
</p>
<ul>
<li>"task undo" can now retract a "task done" command, provided no
reports have been run.
<li>Task now correctly sorts on entire strings, instead of just the
first character (thanks to Andy Lester).
<li>Task now uses dashes (-----) to underline column headings when
color is disabled (thanks to Vincent Fleuranceau).
<li>Task now allows mixed case attribute names (pri:, PRI:, Pri: ...)
and commands (add, ADD, Add ...) (thanks to Vincent Fleuranceau).
<li>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).
<li>Task supports improved word-wrapping to the terminal width.
<li>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.
<li>Task supports modifying the existing description of a task, with the
following syntax: task &lt;id&gt; "new description ...".
<li>Fixed bug so that relative dates in filters (task list due:eom,
task list due:tomorrow, task list due:23rd ...) are now properly
supported.
<li>Fixed bug so that source now properly includes &lt;string.h&gt; in
order to build clean using gcc 4.3 (thanks to H. İbrahim Güngör)
</ul>
<p> <p>
<h4>New in version 1.4.1 (7/18/2008)</h4> <h4>New in version 1.4.1 (7/18/2008)</h4>
<a href="http://www.beckingham.net/task-1.4.1.tar.gz">task-1.4.1.tar.gz</a> <a href="http://www.beckingham.net/task-1.4.1.tar.gz">task-1.4.1.tar.gz</a>
<br /> <br />
Mac OS X 10.5 (Leopard) Intel-only: Mac OS X 10.5 (Leopard) Intel-only:
<a href="http://www.beckingham.net/task-1.4.1.pkg">task-1.4.1.pkg</a> <a href="http://www.beckingham.net/task-1.4.1.pkg">task-1.4.1.pkg</a>
<br />
Debian package: <a href="http://www.beckingham.net/task_1.4.1-1_i386.deb">task_1.4.1-1_i386.deb</a>
(Thanks to <a href="http://blog.rfquerin.org">Richard Querin</a>)
</p> </p>
<ul> <ul>
@ -54,7 +93,7 @@
<h4>New in version 1.4.0 (7/10/2008)</h4> <h4>New in version 1.4.0 (7/10/2008)</h4>
Source: <a href="http://www.beckingham.net/task-1.4.0.tar.gz">task-1.4.0.tar.gz</a> Source: <a href="http://www.beckingham.net/task-1.4.0.tar.gz">task-1.4.0.tar.gz</a>
<br /> <br />
Debian package: <a href="http://www.beckingham.net/task_1.4.1-1_i386.deb">task_1.4.1-1_i386.deb</a> Debian package: <a href="http://www.beckingham.net/task_1.4.0-1_i386.deb">task_1.4.0-1_i386.deb</a>
(Thanks to <a href="http://blog.rfquerin.org">Richard Querin</a>) (Thanks to <a href="http://blog.rfquerin.org">Richard Querin</a>)
</p> </p>

View file

@ -666,36 +666,47 @@ void updateRecurrenceMask (
// Using gTdb and gConf, generate a report. // Using gTdb and gConf, generate a report.
void onChangeCallback () void onChangeCallback ()
{ {
if (gConf && gTdb) try
{ {
gConf->set ("curses", "off"); if (gConf && gTdb)
gConf->set ("color", "off");
// Determine if shadow file is enabled.
std::string shadowFile = expandPath (gConf->get ("shadow.file"));
if (shadowFile != "")
{ {
std::string command = gConf->get ("shadow.command", "list"); gConf->set ("curses", "off");
int width = gConf->get ("shadow.width", 80); gConf->set ("color", "off");
// Run report. // Determine if shadow file is enabled.
try 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 <std::string> args; std::vector <std::string> args;
split (args, command, ' '); split (args, command, ' ');
runTaskCommand (args, *gTdb, *gConf); runTaskCommand (args, *gTdb, *gConf);
}
catch (std::string& error) // Restore std::cout.
{ std::cout.rdbuf (original);
std::cout << error << std::endl;
}
catch (...)
{
std::cout << "Unknown error." << std::endl;
} }
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;
} }
} }