mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Removed the incomplete support for the Lua extensions.
This commit is contained in:
parent
c7df1f7acc
commit
7db5377d3b
27 changed files with 17 additions and 928 deletions
|
@ -1,45 +0,0 @@
|
|||
-- Command Extension.
|
||||
-- Implementing 'random'.
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: An 8-element list of installation details. Only called once, on
|
||||
-- installation of the extension.
|
||||
function install ()
|
||||
return 'command', -- Type
|
||||
'random', -- Name
|
||||
'1.0', -- Version
|
||||
'Displays a random pending task', -- Description
|
||||
'Paul Beckingham', -- Author
|
||||
'paul@beckingham.net', -- Contact
|
||||
'MIT', -- License
|
||||
'© 2013, Göteborg Bit Factory' -- Copyright
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: Usage syntax, such as "task random"
|
||||
function usage ()
|
||||
return 'task random'
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: 1 --> command does not modify data
|
||||
-- 0 --> command modifies data
|
||||
function read_only ()
|
||||
return true
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: 1 --> command displays task ID
|
||||
-- 0 --> no ID displayed
|
||||
function display_id ()
|
||||
return true
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: 1 --> command failed
|
||||
-- 0 --> success
|
||||
function execute (command_line)
|
||||
task_footnote_message ('Not implemented')
|
||||
return 1
|
||||
end
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
-- DOM Extension.
|
||||
-- Implementing 'system.load.average'.
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: An 8-element list of installation details. Only called once, on
|
||||
-- installation of the extension.
|
||||
function install ()
|
||||
return 'dom', -- Type
|
||||
'system.load.average', -- Name
|
||||
'1.0', -- Version
|
||||
'Provides access to system load', -- Description
|
||||
'Paul Beckingham', -- Author
|
||||
'paul@beckingham.net', -- Contact
|
||||
'MIT', -- License
|
||||
'© 2013, Göteborg Bit Factory' -- Copyright
|
||||
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
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
-- Format Extension.
|
||||
-- Implementing 'uuid.short'
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: An 8-element list of installation details. Only called once, on
|
||||
-- installation of the extension.
|
||||
function install ()
|
||||
return 'format', -- Type
|
||||
'uuid.short', -- Name
|
||||
'1.0', -- Version
|
||||
'Provides short formatted UUIDs', -- Description
|
||||
'Paul Beckingham', -- Author
|
||||
'paul@beckingham.net', -- Contact
|
||||
'MIT', -- License
|
||||
'© 2013, Göteborg Bit Factory' -- Copyright
|
||||
end
|
||||
|
||||
-- Argument: Value to be formatted
|
||||
-- Returns: Formatted value
|
||||
function format (value)
|
||||
return string.sub (value, 0, 8)
|
||||
end
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
-- Program Hook Extension.
|
||||
-- Implementing goodbye message.
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: An 8-element list of installation details. Only called once, on
|
||||
-- installation of the extension.
|
||||
function install ()
|
||||
return 'program', -- Type
|
||||
'goodbye', -- Name
|
||||
'1.0', -- Version
|
||||
'Simply says goodbye', -- Description
|
||||
'Paul Beckingham', -- Author
|
||||
'paul@beckingham.net', -- Contact
|
||||
'MIT', -- License
|
||||
'© 2013, Göteborg Bit Factory' -- Copyright
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: String identifying valid program hook
|
||||
function hook ()
|
||||
return 'on-exit'
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: 0 --> success only
|
||||
function execute ()
|
||||
print ('Goodbye.')
|
||||
end
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
-- Task Hook Extension.
|
||||
-- Implementing encouragement message.
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: An 8-element list of installation details. Only called once, on
|
||||
-- installation of the extension.
|
||||
function install ()
|
||||
return 'task', -- Type
|
||||
'encourage', -- Name
|
||||
'1.0', -- Version
|
||||
'Positive feedback', -- Description
|
||||
'Paul Beckingham', -- Author
|
||||
'paul@beckingham.net', -- Contact
|
||||
'MIT', -- License
|
||||
'© 2013, Göteborg Bit Factory' -- Copyright
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: String identifying valid program hook
|
||||
function hook ()
|
||||
return 'on-task-complete'
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: 1 --> failure
|
||||
-- 0 --> success
|
||||
function execute (uuid)
|
||||
-- Only provide encouragement if the verbosity settings allow it.
|
||||
verbosity = task_get ('rc.verbose')
|
||||
if string.find (verbosity, 'encourage') ~= nil
|
||||
then
|
||||
task_footnote_message ('Good work.')
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
-- User Defined Attribute Extension.
|
||||
-- Implementing 'priority'.
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: An 8-element list of installation details. Only called once, on
|
||||
-- installation of the extension.
|
||||
function install ()
|
||||
return 'uda', -- Type
|
||||
'priority', -- Name
|
||||
'1.0', -- Version
|
||||
'Implements priority attribute', -- Description
|
||||
'Paul Beckingham', -- Author
|
||||
'paul@beckingham.net', -- Contact
|
||||
'MIT', -- License
|
||||
'© 2013, Göteborg Bit Factory' -- Copyright
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: Data type
|
||||
function type ()
|
||||
return 'custom'
|
||||
end
|
||||
|
||||
-- Arguments: None
|
||||
-- Returns: List of allowable values
|
||||
function allowed ()
|
||||
return 'H', 'M', 'L', ''
|
||||
end
|
||||
|
||||
-- Arguments: Left and right values to compare
|
||||
-- Returns: 1 --> left < right
|
||||
-- 0 --> left >= right
|
||||
function compare (left, right)
|
||||
if left == 'M' && right == 'H' then
|
||||
return 1
|
||||
elseif left == 'L' && (right == 'H' || right == 'M') then
|
||||
return 1
|
||||
elseif left == '' then
|
||||
return 1
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
-- Arguments: Raw data
|
||||
-- Returns: Formatted data
|
||||
-- Note: Shown here is a pass-through format, doing no formatting. This is
|
||||
-- also the default behavior if the format function is not
|
||||
-- implemented.
|
||||
function format (value)
|
||||
return value
|
||||
end
|
||||
|
||||
-- Arguments: Value
|
||||
-- Returns: Urgency Term
|
||||
-- Note: Should reference rc.urgency.<field>.coefficient
|
||||
function urgency (uuid)
|
||||
coefficient = task_get ('rc.urgency.priority.coefficient')
|
||||
|
||||
-- TODO Urgency calculation here
|
||||
|
||||
return coefficient * 1.0
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue