From a7c3858729c5ed112ca3afabaecf04d9cf1c0d1e Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 24 Apr 2011 12:40:50 -0400 Subject: [PATCH] Extensions - Clarification in the extensions document. --- ChangeLog | 2 ++ scripts/extensions/README | 12 +++++++++--- scripts/extensions/uda.lua | 11 +++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43a247965..ce3f0d442 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,8 @@ + Added feature #714, including Belarus holidays (thanks to Alexei Romanoff). # Tracked Bugs, sorted by ID. + + Fixed bug #594, which broke the 'all' report with a combination of bad regex + handling and a formatting bug (thanks to Steve Rader). + Fixed bug #605, which gave misleading project completion percentages under certain circumstances (thanks to Steve Rader). + Fixed bug #703, where global substitutions didn't make all expected diff --git a/scripts/extensions/README b/scripts/extensions/README index 1b7e24e74..98dcd0314 100644 --- a/scripts/extensions/README +++ b/scripts/extensions/README @@ -7,8 +7,8 @@ invoked have access to taskwarrior internals through a Lua API. There are several types of extension. Each type has different requirements, and is called in different ways. -All extensions must be installed, which means they must implement the 'install' -function, which provides: +All extensions must be installed using the 'install' command, which means they +must implement the 'install' function, which returns a set of string values for: - Type One of: program, task, uda, command, format, dom - Name Single word name @@ -19,6 +19,11 @@ function, which provides: - License Distribution License - Copyright Copyright notice +All extensions, on installation, will be copied into ~/.task/extensions, and the +corresponding configuration entry will be created: + + extension.= + Program Hooks ------------- @@ -63,6 +68,7 @@ extensions must provide: - Custom types must implement a compare function for sorting - Default format rendering - Allowed value checking + - Urgency calculation term Command @@ -75,7 +81,7 @@ provide: - Declaration as read-only or write command, which allows taskwarrior to allow this command when the database is read-only - Declaration of whether the command displays ID values, which instructs - taskwarrior to run a GC beforehan + taskwarrior to run a GC beforehand Format diff --git a/scripts/extensions/uda.lua b/scripts/extensions/uda.lua index 8ef19b0e4..1ecd76042 100644 --- a/scripts/extensions/uda.lua +++ b/scripts/extensions/uda.lua @@ -59,3 +59,14 @@ function format (value) return value end +-- Arguments: Value +-- Returns: Urgency Term +-- Note: Should reference rc.urgency..coefficient +function urgency (value) + coefficient = task_get ('urgency..coefficient') + + -- TODO Urgency calculation here + + return coefficient * 1.0 +end +