From d121abac4f8cde0a8ef2419c6bdfb52e7c4dcb6d Mon Sep 17 00:00:00 2001 From: kennyballou Date: Fri, 31 May 2013 17:48:01 -0600 Subject: Update Documentation * Move all documentation out of Task Reference Use ``autofunction`` to include the docstring of the appropriate function * Update docstrings of all functions in ``xnt.tasks``, ``xnt.build``, ``xnt.vcs`` --- docs/source/taskreference.rst | 137 +++++++++++------------------------------- 1 file changed, 34 insertions(+), 103 deletions(-) (limited to 'docs') diff --git a/docs/source/taskreference.rst b/docs/source/taskreference.rst index 2ffbfcb..16c41b5 100644 --- a/docs/source/taskreference.rst +++ b/docs/source/taskreference.rst @@ -20,92 +20,47 @@ Overview of Tasks File Tasks ========== -.. _xnt.tasks.expandpath: -.. function:: expandpath(path) +.. autofunction:: xnt.tasks.expandpath + :noindex: - Return a generator for glob expansion of *path* +.. autofunction:: xnt.tasks.cp + :noindex: -.. _xnt.tasks.cp: -.. function:: cp(src="", dst="", files=None) +.. autofunction:: xnt.tasks.mv + :noindex: - Copy the source file or directory (*src*) OR files/folders (*files*) to - destination file or directory (*dst*) +.. autofunction:: xnt.tasks.mkdir + :noindex: -.. _xnt.tasks.mv: -.. function:: mv(src, dst) - - Move the source file or directory (*src*) to destination file or - directory (*dst*) - -.. _xnt.tasks.mkdir: -.. function:: mkdir(dir, mode=0o777) - - Create a directory specified by *dir* with default mode (where supported) - or with the specified mode - - Notice, if the directory already exists, *mkdir* will not attempt to - create it again (or change the mode) - -.. _xnt.tasks.rm: -.. function:: rm(*fileset) - - Attempt to remove all the directories given in fileset. Before *rm* tries - to delete each element of fileset, it attempts to expand it first, thus - allowing the passing of glob elements. +.. autofunction:: xnt.tasks.rm + :noindex: Archive Tasks ============= -.. _xnt.tasks.create_zip: -.. function:: create_zip(directory, zipfilename) - - Zip the specified *directory* into the zip file specified by *zipfilename* +.. autofunction:: xnt.tasks.create_zip + :noindex: Miscellaneous Tasks =================== -.. _xnt.tasks.echo: -.. function:: echo(msg, tofile) - - Write the given message to a file - - *echo* will handle opening and closing the file - -.. _xnt.tasks.log: -.. function:: log(msg="", lvl=logging.INFO) - - Write the message (*msg*) to the *xnt.tasks* logger using either the - default log level (*INFO*) or any other valid specified value - -.. _xnt.tasks.call: -.. function:: call(command, stdout=None, stderr=None) +.. autofunction:: xnt.tasks.echo + :noindex: - Invoke the command specified, redirecting standard output and standard - error as specified. +.. autofunction:: xnt.tasks.log + :noindex: - *command* must be in the form of a list for :mod:`subprocess` +.. autofunction:: xnt.tasks.call + :noindex: - *stdout* and *stderr* must be an open file handle. [However, that may - change; I'm not sure how I feel about that yet.] - -.. _xnt.tasks.xntcall: -.. function:: xntcall(buildfile, targets=None, props=None) - - Invoke the *target(s)* of a build file in a different *path*. - - *target* is the name of the target to invoke (similar to *target* of a - regular invocation. - - *buildfile* is the path (relative or full) and build file to use +.. autofunction:: xnt.tasks.xntcall + :noindex: Compile Tasks ============= -.. _xnt.tasks.setup: -.. function:: setup(commands, directory="") - - Invoke Python setup.py given the list of *commands* (or options) in the - current directory or in a different directory, specified by *directory*. +.. autofunction:: xnt.tasks.setup + :noindex: SCM Tasks ========= @@ -115,54 +70,30 @@ SCM Tasks Mercurial Tasks --------------- -.. _xnt.vcs.hg.hgclone: -.. function:: hgclone(url, dest=None, rev=None, branch=None) - - Clone the Mercurial repository at *url* (This can be any valid URI, Local, - SSH, HTTP(S)...) into either the default destination or a specified - directory (relative to the current working directory). +.. autofunction:: xnt.vcs.hg.hgclone + :noindex: - *rev* and *branch* can be used to clone a specific revision or a specific - branch of the repository, respectively. - -.. _xnt.vcs.hg.hgfetch: -.. function:: hgfetch(path, source='default') - - Fetch any updates from either the default source or a specified source for - the repository specified by *path* +.. autofunction:: xnt.vcs.hg.hgfetch + :noindex: .. _xnt.vcs.git: Git Tasks --------- -.. _xnt.vcs.git.gitclone: -.. function:: gitclone(url, dest=None, branch=None) - - Clone the Git repository at *url* (This can be any valid URI: Local, SSH, - Git, HTTP(S)...) into either the default destination or specified directory - (relative to the current working directory). +.. autofunction:: xnt.vcs.git.gitclone + :noindex: -.. _xnt.vcs.git.gitpull: -.. function:: gitpull(path, source="origin", branch="master") - - Pull any updates from either the default source and/ or specified branch - into the existing Git repository located at *path*. +.. autofunction:: xnt.vcs.git.gitpull + :noindex: .. _xnt.vcs.cvs: CVS Tasks --------- -.. _xnt.vcs.cvs.cvsco: -.. function:: cvsco(module, rev="", dest="") - - Checkout the CVS module specified by *module*; getting the HEAD revision or - any valid revision specified by *rev* and putting it into the default - directory or the specified directory, *dest* (relative to the current - working directory). - -.. _xnt.vcs.cvs.cvsupdate: -.. function:: cvsupdate(path) +.. autofunction:: xnt.vcs.cvs.cvsco + :noindex: - Update the CVS module located at *path*. +.. autofunction:: xnt.vcs.cvs.cvsupdate + :noindex: -- cgit v1.2.1