- Tweaks to the Lua and extension API.  Note that this is a documentation-only
  change, meaning the design is being honed.  No support exists yet.
This commit is contained in:
Paul Beckingham 2012-01-15 11:39:53 -05:00
parent 15030599fd
commit 15d25d4fdf
5 changed files with 10 additions and 13 deletions

View file

@ -21,13 +21,6 @@ function usage ()
return 'task random'
end
-- Arguments: None
-- Returns: Valid Taskwarrior BNF, minimally defining a production rule that
-- has the same name as the command itself
function syntax ()
return 'random ::= "random" ;'
end
-- Arguments: None
-- Returns: 1 --> command does not modify data
-- 0 --> command modifies data

View file

@ -18,6 +18,9 @@ end
-- Arguments: The DOM reference to evaluate
-- Returns: The value from the DOM lookup
function lookup (name)
if name == 'system.load.average'
then
return 1.23 -- Fake load average
end
end

View file

@ -23,7 +23,7 @@ end
-- Arguments: None
-- Returns: 0 --> success only
function goodbye ()
function execute ()
print ('Goodbye.')
end

View file

@ -24,7 +24,7 @@ end
-- Arguments: None
-- Returns: 1 --> failure
-- 0 --> success
function encourage ()
function execute (uuid)
-- Only provide encouragement if the verbosity settings allow it.
verbosity = task_get ('rc.verbose')
if string.find (verbosity, 'encourage') ~= nil

View file

@ -45,7 +45,8 @@ end
-- Arguments: Raw data
-- Returns: Formatted data
-- Note: Shown here is a pass-through format, doing no formatting. This is
-- the default behavior if the format function is not implemented.
-- also the default behavior if the format function is not
-- implemented.
function format (value)
return value
end
@ -53,8 +54,8 @@ end
-- Arguments: Value
-- Returns: Urgency Term
-- Note: Should reference rc.urgency.<field>.coefficient
function urgency (value)
coefficient = task_get ('urgency.priority.coefficient')
function urgency (uuid)
coefficient = task_get ('rc.urgency.priority.coefficient')
-- TODO Urgency calculation here