sigmavirus24/Todo.txt-python — Issue #15: Add-on/Built-in Override Capabilities
Author: sigmavirus24
Created: 2012-02-10 17:22:02+00:00
State: open
Labels: Enhancement, RFC

# Allow Users to Create "Add-ons" For todo.py

Enhancement/RFC

## Adding Functionality to the Script

If a user wanted to, they could create a separate python script which they could import and would be able to add new functions to the script so they could add their own functionality.

## Overriding Existing (Built-in) Functions

If a user so desired, they could rewrite any of the essential functions to perform extra operations (or fewer) and include them in this directory.

## Design

We could either follow [todo.txt-cli](https://github.com/ginatrapani/todo.txt-cli/wiki/Creating-and-Installing-Add-ons) and have a directory called `~/.todo.actions.d/` or we could make this a bit more logical (in the sense of python) and have it as a sub-directory of `~/.todo/`, i.e. `~/.todo/actions/`.

Benefits of using `~/.todo.actions.d/`:

* Maintain todo.txt-cli design/functionality similarities
* Easier transition for todo.txt-cli users to this project

Benefits of switching to `~/.todo/actions/`:

* Simpler for python to handle (we could extend the path to '..' and then import `~/.todo.actions.d/`, if we have to)
* Cleaner (in my opinion) directory structure.

***More can and will be added to these lists***

### Design Examples
```python
# actions/__init__.py
import foo
import bar

__all__ = ('addon1', 'addon2' )
```

```python
# todo.py

from actions import *

# Some way of updating the commands dictionary which
# would add the commands to the accepted list.
```