Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
View
2  CHANGES
@@ -7,7 +7,7 @@ Changes
==========
- fix: `strace` raises `InvalidCommand` instead of using `assert`
- - #28: task `uptotade` support string to be executed as shell command
+ - #28: task `uptodate` support string to be executed as shell command
- DEPRECATED `tools.InteractiveAction` renamed to `tools.LongRunning`
- added `tools.Interactive` for use with interactive commands
- BACKWARD INCOMPATIBLE: use function `doit.get_initial_workdir()`
View
2  LICENSE
@@ -2,7 +2,7 @@
The MIT License
-Copyright (c) 2008-2011 Eduardo Naufel Schettino
+Copyright (c) 2008-2014 Eduardo Naufel Schettino
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
44 doc/dictionary.txt
@@ -1,4 +1,5 @@
'
+'0
'a'
'actions'
'b'
@@ -22,6 +23,7 @@
'library'
'main'
'make'
+'minversion'
'my
'myscript'
'name'
@@ -38,12 +40,14 @@
'version'
'x'
'y'
+0'
2to3
API
BaseAction
CFEngine
CMake
CmdAction
+CmdAction's
CmdActions
Config
ConsoleReporter
@@ -52,12 +56,15 @@ DoitMain
Gliwinski
Guo
InteractiveAction
+InvalidCommand
JSON
KeyboardInterrupt
+LongRunning
MD5
ModuleTaskLoader
MyCustomTask2
PDB
+Popen
PyPi
PythonAction
PythonInteractiveAction
@@ -69,13 +76,18 @@ Subclassing
TODO
TaskLoader
UptodateCalculator
+Uz
+WORDBREAKS
Waf
ZeroReporter
abc
+api
+app
args
atime
attr
autoclass
+autoload
backend
backends
bar'
@@ -90,8 +102,10 @@ cmd
cmp
codebase
compFile
+compinit
compressed1
config
+cp
cproject
cron
ctime
@@ -121,12 +135,14 @@ fnmatch
folderXXX
foo
foo'
+fpath
gdbm
genstandalone
getargs
gif
gmail
google
+hardcode
hashlib
hello2
helloworld
@@ -136,6 +152,7 @@ init
inotify
interactiveaction
internet
+isatty
iteritems
iterkeys
java
@@ -153,10 +170,12 @@ makedirs
maxdepth
md5
metadata
+minversion
msg
mtime
mycmd
mygroup
+namespace
once'
os
outfile
@@ -165,12 +184,13 @@ param2
params
pdb
perl
+popen
pre
prev
programmatically
py
-py3
py'
+py3
pyFiles
pychecker
pyflakes
@@ -202,6 +222,7 @@ strace
t1
t2
t3
+tabcompletion
task1
taskorder
taskresult
@@ -218,30 +239,13 @@ txt'
unicode
unix
uptodate
+utf8
wget
wildcard
withenvX
withenvY
+workdir
x'
xxx
xyz
-utf8
-WORDBREAKS
-Popen
-popen
-CmdAction's
-workdir
-isatty
-'minversion'
-minversion
-tabcompletion
zsh
-autoload
-fpath
-cp
-app
-hardcode
-Uz
-compinit
-'0
-0'
View
11 doc/extending.rst
@@ -7,11 +7,14 @@ Extending `doit`
`doit` is built to be extended and this can be done in several levels.
So far we have seen:
-1) Task creator functions can be placed in a "lib" and then imported in a dodo.py
-2) User's can create new ways to define when a task is up-to-date using
- the `uptodate` task parameter
-3) The output can be configured by creating custom reports
+1) User's can create new ways to define when a task is up-to-date using
+ the `uptodate` task parameter (:ref:`more <uptodate_api>`)
+2) Tasks can be created in different styles by creating a custom
+ task creators (:ref:`more <create-doit-tasks>`)
+3) The output can be configured by creating custom
+ reports (:ref:`more <reporter>`)
4) You can customize how tasks are executed by creating new Action types
+ (:ref:`more <custom-actions>`)
Apart from those `doit` also expose it's internal API so you can create
new applications on top of `doit`.
View
39 doc/tasks.rst
@@ -145,6 +145,7 @@ If the process exits with the value `0` it is successful.
Any other value means the task failed.
+.. _custom-actions:
custom actions
^^^^^^^^^^^^^^^^^^^
@@ -444,11 +445,12 @@ If task name starts with an underscore '_', it will not be included in the outpu
.. _create-doit-tasks:
+
custom task definition
------------------------
Apart from collect functions that start with the name `task_`.
-The *doit* loader will also execute the `create_doit_tasks`
+The *doit* loader will also execute the ``create_doit_tasks``
callable from any object that contains this attribute.
@@ -457,4 +459,37 @@ callable from any object that contains this attribute.
The `project letsdoit <https://bitbucket.org/takluyver/letsdoit>`_
has some real-world implementations.
-For simple examples to help you create your own check this `blog post <http://blog.schettino72.net/posts/doit-task-creation.html>`_.
+For simple examples to help you create your own check this
+`blog post <http://blog.schettino72.net/posts/doit-task-creation.html>`_.
+
+
+importing tasks
+---------------
+
+The *doit* loader will look at **all** objects in the namespace of the *dodo*.
+It will look for functions staring with ``task_`` and objects with
+``create_doit_tasks``.
+So it is also possible to load task definitions from other
+modules just by importing them into your *dodo* file.
+
+.. literalinclude:: tutorial/import_tasks.py
+
+.. code-block:: console
+
+ $ doit list
+ echo
+ hello
+ sample
+
+
+.. note::
+
+ Importing tasks from different modules is useful if you want to split
+ your task definitions in different modules.
+
+ The best way to create re-usable tasks that can be used in several projects
+ is to call functions that return task dict's.
+ For example take a look at a reusable *pyflakes*
+ `task generator <https://github.com/pydoit/doit-py/blob/master/doitpy/pyflakes.py>`_.
+ Check the project `doit-py <https://github.com/pydoit/doit-py>`_
+ for more examples.
View
10 doc/tutorial/import_tasks.py
@@ -0,0 +1,10 @@
+# import task_ functions
+from get_var import task_echo
+
+# import tasks with create_doit_tasks callable
+from custom_task_def import sample
+
+
+def task_hello():
+ return {'actions': ['echo hello']}
+
View
1  doc/uptodate.rst
@@ -123,6 +123,7 @@ If a file is a target of another task you should probably add
.. literalinclude:: tutorial/check_timestamp_unchanged.py
+.. _uptodate_api:
uptodate API
--------------

No commit comments for this range

Something went wrong with that request. Please try again.