From 5e453555e365014d3c6ed016aa0434399b80ec9f Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Wed, 7 Mar 2012 11:35:18 -0500 Subject: [PATCH] Let me upgrade your docs --- .gitignore | 6 + .gitmodules | 3 + Makefile | 28 + _config.yml | 2 - _layouts/default.html | 58 - _layouts/post.html | 7 - ansible | 1 + build-site.py | 83 ++ conf.py | 200 ++++ html/.buildinfo | 4 + html/YAMLScripts.html | 188 ++++ html/_modules/index.html | 95 ++ html/_modules/taboot/output.html | 618 +++++++++++ html/_modules/taboot/runner.html | 369 +++++++ html/_modules/taboot/tasks.html | 263 +++++ html/_modules/taboot/tasks/command.html | 129 +++ html/_modules/taboot/tasks/mod_jk.html | 190 ++++ html/_modules/taboot/tasks/nagios.html | 284 +++++ html/_modules/taboot/tasks/poller.html | 149 +++ html/_modules/taboot/tasks/puppet.html | 196 ++++ html/_modules/taboot/tasks/rpm.html | 189 ++++ html/_modules/taboot/tasks/service.html | 149 +++ html/_modules/taboot/tasks/sleep.html | 181 ++++ html/_modules/taboot/tasks/yum.html | 166 +++ html/_sources/YAMLScripts.txt | 82 ++ html/_sources/api.txt | 55 + html/_sources/code.txt | 78 ++ html/_sources/communicate.txt | 55 + html/_sources/development.txt | 98 ++ html/_sources/examples.txt | 71 ++ html/_sources/gettingstarted.txt | 67 ++ html/_sources/index.txt | 89 ++ html/_sources/install.txt | 56 + html/_sources/man.txt | 16 + html/_sources/modules.txt | 55 + html/_sources/patterns.txt | 55 + html/_sources/playbooks.txt | 55 + html/_sources/tasks.txt | 16 + html/_static/basic.css | 528 +++++++++ html/_static/default.css | 256 +++++ html/_static/doctools.js | 247 +++++ html/_static/file.png | Bin 0 -> 392 bytes html/_static/jquery.js | 154 +++ html/_static/minus.png | Bin 0 -> 199 bytes html/_static/plus.png | Bin 0 -> 199 bytes html/_static/pygments.css | 62 ++ html/_static/searchtools.js | 518 +++++++++ html/_static/sidebar.js | 148 +++ html/_static/underscore.js | 16 + html/api.html | 158 +++ html/code.html | 853 +++++++++++++++ html/communicate.html | 158 +++ html/development.html | 216 ++++ html/examples.html | 185 ++++ html/genindex.html | 91 ++ html/gettingstarted.html | 177 +++ html/index.html | 204 ++++ html/install.html | 158 +++ html/man.html | 118 ++ html/man/ansible-modules.5.html | 81 ++ html/man/ansible-playbook.5.html | 36 + html/man/ansible.1.html | 30 + html/modules.html | 158 +++ html/objects.inv | Bin 0 -> 222 bytes html/patterns.html | 158 +++ html/playbooks.html | 158 +++ html/py-modindex.html | 169 +++ html/search.html | 97 ++ html/searchindex.js | 1 + html/tasks.html | 1304 +++++++++++++++++++++++ rst/YAMLScripts.rst | 82 ++ rst/api.rst | 55 + rst/communicate.rst | 55 + rst/examples.rst | 71 ++ rst/gettingstarted.rst | 67 ++ rst/index.rst | 89 ++ rst/man.rst | 16 + rst/modules.rst | 55 + rst/patterns.rst | 55 + rst/playbooks.rst | 55 + 80 files changed, 11378 insertions(+), 67 deletions(-) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 Makefile delete mode 100644 _config.yml delete mode 100644 _layouts/default.html delete mode 100644 _layouts/post.html create mode 160000 ansible create mode 100755 build-site.py create mode 100644 conf.py create mode 100644 html/.buildinfo create mode 100644 html/YAMLScripts.html create mode 100644 html/_modules/index.html create mode 100644 html/_modules/taboot/output.html create mode 100644 html/_modules/taboot/runner.html create mode 100644 html/_modules/taboot/tasks.html create mode 100644 html/_modules/taboot/tasks/command.html create mode 100644 html/_modules/taboot/tasks/mod_jk.html create mode 100644 html/_modules/taboot/tasks/nagios.html create mode 100644 html/_modules/taboot/tasks/poller.html create mode 100644 html/_modules/taboot/tasks/puppet.html create mode 100644 html/_modules/taboot/tasks/rpm.html create mode 100644 html/_modules/taboot/tasks/service.html create mode 100644 html/_modules/taboot/tasks/sleep.html create mode 100644 html/_modules/taboot/tasks/yum.html create mode 100644 html/_sources/YAMLScripts.txt create mode 100644 html/_sources/api.txt create mode 100644 html/_sources/code.txt create mode 100644 html/_sources/communicate.txt create mode 100644 html/_sources/development.txt create mode 100644 html/_sources/examples.txt create mode 100644 html/_sources/gettingstarted.txt create mode 100644 html/_sources/index.txt create mode 100644 html/_sources/install.txt create mode 100644 html/_sources/man.txt create mode 100644 html/_sources/modules.txt create mode 100644 html/_sources/patterns.txt create mode 100644 html/_sources/playbooks.txt create mode 100644 html/_sources/tasks.txt create mode 100644 html/_static/basic.css create mode 100644 html/_static/default.css create mode 100644 html/_static/doctools.js create mode 100644 html/_static/file.png create mode 100644 html/_static/jquery.js create mode 100644 html/_static/minus.png create mode 100644 html/_static/plus.png create mode 100644 html/_static/pygments.css create mode 100644 html/_static/searchtools.js create mode 100644 html/_static/sidebar.js create mode 100644 html/_static/underscore.js create mode 100644 html/api.html create mode 100644 html/code.html create mode 100644 html/communicate.html create mode 100644 html/development.html create mode 100644 html/examples.html create mode 100644 html/genindex.html create mode 100644 html/gettingstarted.html create mode 100644 html/index.html create mode 100644 html/install.html create mode 100644 html/man.html create mode 100644 html/man/ansible-modules.5.html create mode 100644 html/man/ansible-playbook.5.html create mode 100644 html/man/ansible.1.html create mode 100644 html/modules.html create mode 100644 html/objects.inv create mode 100644 html/patterns.html create mode 100644 html/playbooks.html create mode 100644 html/py-modindex.html create mode 100644 html/search.html create mode 100644 html/searchindex.js create mode 100644 html/tasks.html create mode 100644 rst/YAMLScripts.rst create mode 100644 rst/api.rst create mode 100644 rst/communicate.rst create mode 100644 rst/examples.rst create mode 100644 rst/gettingstarted.rst create mode 100644 rst/index.rst create mode 100644 rst/man.rst create mode 100644 rst/modules.rst create mode 100644 rst/patterns.rst create mode 100644 rst/playbooks.rst diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..d53b672c222 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*.py[co] +build +# Emacs backup files... +*~ +.\#* +.doctrees diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..f3814032abf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "ansible"] + path = ansible + url = git://github.com/ansible/ansible.git diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..6f59a6dde81 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +#!/usr/bin/make +ASCII2HTMLMAN = a2x -D html/man/ -d manpage -f xhtml +SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") + +all: clean docs + +docs: htmlman htmldocs + +htmlman: + mkdir -p html/man + $(ASCII2HTMLMAN) ansible/docs/man/man1/ansible.1.asciidoc + $(ASCII2HTMLMAN) ansible/docs/man/man5/ansible-modules.5.asciidoc + $(ASCII2HTMLMAN) ansible/docs/man/man5/ansible-playbook.5.asciidoc + +htmldocs: + ./build-site.py + +clean: + @echo "Cleaning up byte compiled python stuff" + find . -regex ".*\.py[co]$$" -delete + @echo "Cleaning up editor backup files" + find . -type f \( -name "*~" -or -name "#*" \) -delete + find . -type f \( -name "*.swp" \) -delete + +.PHONEY: docs manual clean +vpath %.asciidoc docs/man/man1 + + diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 6d67c09ede6..00000000000 --- a/_config.yml +++ /dev/null @@ -1,2 +0,0 @@ -markdown: rdiscount -pygments: true diff --git a/_layouts/default.html b/_layouts/default.html deleted file mode 100644 index da6c5140a9f..00000000000 --- a/_layouts/default.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - {{ page.title }} - - - - - - - - - - - - - - - - - - -
- - - {{ content }} - - -
- -Fork me on GitHub - - - - - - - diff --git a/_layouts/post.html b/_layouts/post.html deleted file mode 100644 index 155e67bd38f..00000000000 --- a/_layouts/post.html +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: default ---- -
-{{ content }} -
- diff --git a/ansible b/ansible new file mode 160000 index 00000000000..8e20ed3714b --- /dev/null +++ b/ansible @@ -0,0 +1 @@ +Subproject commit 8e20ed3714b7a43279ecfd38a7812b28e1533f03 diff --git a/build-site.py b/build-site.py new file mode 100755 index 00000000000..25c5d22807e --- /dev/null +++ b/build-site.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# (c) 2012, Michael DeHaan +# +# This file is part of the Ansible Documentation +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see . + +__docformat__ = 'restructuredtext' + +import os +import sys +from sphinx.application import Sphinx +from os import path + + +class SphinxBuilder(object): + """ + Creates HTML documentation using Sphinx. + """ + + def __init__(self): + """ + Run the DocCommand. + """ + print "Creating html documentation ..." + + try: + buildername = 'html' + + outdir = path.abspath(path.join('html')) + # Create the output directory if it doesn't exist + if not os.access(outdir, os.F_OK): + os.mkdir(outdir) + + doctreedir = os.path.join('./', '.doctrees') + + confdir = path.abspath('./') + srcdir = path.abspath('rst') + freshenv = False + + # Create the builder + app = Sphinx(srcdir, + confdir, + outdir, + doctreedir, + buildername, + {}, + sys.stdout, + sys.stderr, + freshenv) + + app.builder.build_all() + # We also have the HTML man pages to handle now as well + #if os.system("make htmlman"): + # print "There was an error while building the HTML man pages." + # print "Run 'make htmlman' to recreate the problem." + #print "Your docs are now in %s" % outdir + except ImportError, ie: + print >> sys.stderr, "You don't seem to have the following which" + print >> sys.stderr, "are required to make documentation:" + print >> sys.stderr, "\tsphinx.application.Sphinx" + print >> sys.stderr, "This is usually available from the python-sphinx package" + except Exception, ex: + print >> sys.stderr, "FAIL! exiting ... (%s)" % ex + + def build_docs(self): + self.app.builder.build_all() + + +if __name__ == '__main__': + docgen = SphinxBuilder() +# docgen.build_docs() diff --git a/conf.py b/conf.py new file mode 100644 index 00000000000..95a65dc7075 --- /dev/null +++ b/conf.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- +# +# documentation build configuration file, created by +# sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# The contents of this file are pickled, so don't put values in the namespace +# that aren't pickleable (module imports are okay, they're removed +# automatically). +# +# All configuration values have a default value; values that are commented out +# serve to show the default value. + +import sys +import os + +# If your extensions are in another directory, add it here. If the directory +# is relative to the documentation root, use os.path.abspath to make it +# absolute, like shown here. +#sys.path.append(os.path.abspath('some/directory')) + +sys.path.insert(0, os.path.join('ansible', 'lib')) + +from ansible import __version__, __author__ + + +# General configuration +# --------------------- + +# Add any Sphinx extension module names here, as strings. +# They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc'] + +# Later on, add 'sphinx.ext.viewcode' to the list if you want to have +# colorized code generated too for references. + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['.templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General substitutions. +project = 'Ansible' +copyright = "2012 Michael DeHaan" + +# The default replacements for |version| and |release|, also used in various +# other places throughout the built documents. +# +# The short X.Y version. +version = __version__ +# The full version, including alpha/beta/rc tags. +release = __version__ + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +today_fmt = '%B %d, %Y' + +# List of documents that shouldn't be included in the build. +#unused_docs = [] + +# List of directories, relative to source directories, that shouldn't be +# searched for source files. +#exclude_dirs = [] + +# A list of glob-style patterns that should be excluded when looking +# for source files. +#exclude_patterns = ['elements', 'tasks', 'tests.rst'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# Options for HTML output +# ----------------------- + +# The style sheet to use for HTML and HTML Help pages. A file of that name +# must exist either in Sphinx' static/ path, or in one of the custom paths +# given in html_static_path. +html_style = 'default.css' + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (within the static path) to place at the top of +# the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +#html_static_path = ['.static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_use_modindex = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, the reST sources are included in the HTML build as _sources/. +#html_copy_source = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = '' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Poseidodoc' + + +# Options for LaTeX output +# ------------------------ + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, document class +# [howto/manual]). +latex_documents = [ + ('index', 'ansible.tex', 'Ansible Documentation', + __author__, 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_use_modindex = True + +autoclass_content = 'both' diff --git a/html/.buildinfo b/html/.buildinfo new file mode 100644 index 00000000000..0885fbe1fb7 --- /dev/null +++ b/html/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: +tags: diff --git a/html/YAMLScripts.html b/html/YAMLScripts.html new file mode 100644 index 00000000000..1d0df432806 --- /dev/null +++ b/html/YAMLScripts.html @@ -0,0 +1,188 @@ + + + + + + + + + YAML Scripts — Ansible v0.0.1 documentation + + + + + + + + + + + + + +
+
+
+
+ +
+

YAML Scripts

+

This page provides a basic overview of correct YAML syntax.

+
+

YAML Basics

+

For ansible, every YAML script must be a list at it’s root-most +element. Each item in the list is a dictionary. These dictionaries +represent all the options you can use to write a ansible script. In +addition, all YAML files (regardless of their association with +ansible or not) should start with ---.

+

In YAML a list can be represented in two ways. In one way all members +of a list are lines beginning at the same indentation level starting +with a - character:

+
---
+# A list of tasty fruits
+- Apple
+- Orange
+- Strawberry
+- Mango
+
+

In the second way a list is represented as comma separated elements +surrounded by square brackets. Newlines are permitted between +elements:

+
---
+# A list of tasty fruits
+[apple, orange, banana, mango]
+
+

A dictionary is represented in a simple key: and value form:

+
---
+# An employee record
+name: John Eckersberg
+job: Developer
+skill: Elite
+
+

Like lists, dictionaries can be represented in an abbreviated form:

+
---
+# An employee record
+{name: John Eckersberg, job: Developer, skill: Elite}
+
+

You can specify a boolean value (true/false) in several forms:

+
---
+knows_oop: True
+likes_emacs: TRUE
+uses_cvs: false
+
+

Finally, you can combine these data structures:

+
---
+# An employee record
+name: John Eckersberg
+job: Developer
+skill: Elite
+employed: True
+foods:
+    - Apple
+    - Orange
+    - Strawberry
+    - Mango
+languages:
+    ruby: Elite
+    python: Elite
+    dotnet: Lame
+
+

That’s all you really need to know about YAML to get started writing +Ansible scripts.

+
+

See also

+
+
YAMLLint
+
YAML Lint gets the lint out of your YAML
+
+
+
+
+ + +
+
+
+
+
+

Table Of Contents

+ + +

Previous topic

+

Getting Started

+

Next topic

+

Patterns

+

This Page

+ + + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/index.html b/html/_modules/index.html new file mode 100644 index 00000000000..b75db85e085 --- /dev/null +++ b/html/_modules/index.html @@ -0,0 +1,95 @@ + + + + + + + + + Overview: module code — Taboot v0.4.0 documentation + + + + + + + + + + + +
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/output.html b/html/_modules/taboot/output.html new file mode 100644 index 00000000000..01fd043c44e --- /dev/null +++ b/html/_modules/taboot/output.html @@ -0,0 +1,618 @@ + + + + + + + + + taboot.output — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.output

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009,2011, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from taboot.tasks.puppet import PuppetTaskResult
+from taboot.tasks.rpm import RPMTaskResult
+import re
+
+
+class _FileLikeOutputObject(object):
+    """
+    A file-like parent class.
+    """
+
+    import exceptions
+    import time as _time
+    defaults = None
+    starttime = None
+
+    def __init__(self, *args, **kwargs):
+        """
+        Creates an instance of a file-like object.
+
+        :Parameters:
+           - `args`: all non-keyword arguments.
+           - `kwargs`: all keyword arguments.
+        """
+        import ConfigParser
+        import os.path
+
+        if _FileLikeOutputObject.defaults is None:
+            if os.path.expanduser("~/.taboot.conf"):
+                _FileLikeOutputObject.defaults = ConfigParser.ConfigParser()
+                _FileLikeOutputObject.defaults.read(
+                    os.path.expanduser("~/.taboot.conf"))
+
+        # Only set the start time once, not for each logger instance
+        if _FileLikeOutputObject.starttime is None:
+            import datetime
+            _FileLikeOutputObject.starttime = datetime.datetime.today()
+
+        self._pos = 0L
+        self._closed = False
+        self._setup(*args, **kwargs)
+
+    def _setup(self, *args, **kwargs):
+        """
+        Implementation specific setup.
+
+        :Parameters:
+           - `args`: all non-keyword arguments.
+           - `kwargs`: all keyword arguments.
+        """
+        pass
+
+    def flush(self):
+        """
+        We are not buffering so we always just return None.
+        """
+        return None
+
+    def read(self, *args, **kwargs):
+        """
+        We are an output only file-like object. Raise exception.
+
+        :Parameters:
+           - `args`: all non-keyword arguments.
+           - `kwargs`: all keyword arguments.
+        """
+        raise self.exceptions.NotImplementedError('Object for output only.')
+
+    def tell(self):
+        """
+        Returns the position of the file-like object.
+        """
+        return self._pos
+
+    def truncate(self, size):
+        """
+        We are an output only file-like object. Raise exception.
+
+        :Parameters:
+           - `size`: size to truncate to.
+        """
+        raise self.exceptions.NotImplementedError(
+            'This does not support truncate.')
+
+    def writelines(self, sequence):
+        """
+        Writes a sequence of lines.
+
+        :Parameters:
+           - `sequence`: iterable sequence of data to write.
+        """
+        for item in sequence:
+            self.write(item)
+
+    def write(self, item):
+        """
+        Writer wrapper (not rapper, beav). Simply calls _write which is
+        implementation specific and updates the position.
+
+        :Parameters:
+           - `item`: the item to write.
+        """
+        self._write(item)
+        self._pos += 1
+
+    def _write(self, item):
+        """
+        Implementation of writing data.
+
+        :Parameters:
+           - `item`: the item to write.
+        """
+        raise self.exceptions.NotImplementedError(
+            '_write must be overriden.')
+
+    def close(self):
+        """
+        Close wrapper (again, not rapper, beav). Simply calls _close  which
+        is implementation specific and updates the closed property.
+        """
+        self._close()
+        self._closed = True
+
+    def _close(self):
+        """
+        Implementation of closing the file-like object.
+        By default nothing occurs.
+        """
+        pass
+
+    # Read aliases
+    readline = read
+    readlines = read
+    xreadlines = read
+    seek = read
+
+    # Read-only Properties
+    closed = property(lambda self: self._closed)
+    timestamp = property(lambda self: self._time.strftime(
+            "%Y-%m-%d %H:%M:%S", self._time.localtime()))
+
+
+
[docs]class CLIOutput(_FileLikeOutputObject): + """ + Output a :class:`taboot.tasks.TaskResult` to the command line + with pretty formatting and colors. + """ + + def _setup(self, host, task): + """ + Implementation specific setup for outputting to the CLI. + + :Parameters: + - `host`: name of the host + - `task`: name of the task + """ + import Colors + import sys + self._c = Colors.Colors() + self._sys = sys + self._sys.stdout.write('%s:\n' % ( + self._c.format_string(host, 'blue'))) + self._sys.stdout.write('%s Starting Task[%s]\n' % ( + self.timestamp, self._c.format_string(task, 'white'))) + + def _write(self, result): + """ + Implementation of writing to the CLI. + + :Parameters: + - `result`: result object to inspect and write + """ + import types + + # Set output color + output_color = 'red' + if result.success: + output_color = 'green' + + self._sys.stdout.write("%s:\n" % ( + self._c.format_string(result.host, 'blue'))) + self._sys.stdout.write("%s Finished Task[%s]:\n" % ( + self.timestamp, self._c.format_string( + result.task, output_color))) + + if isinstance(result, PuppetTaskResult): + # If result is an instance of PuppetTaskResult, + # colorize the puppet output + lines = result.output.splitlines() + for line in lines: + if re.match('info:', line): + self._sys.stdout.write("%s\n" % self._c.format_string( + line.strip(), 'green')) + elif re.match('notice:', line): + self._sys.stdout.write("%s\n" % self._c.format_string( + line.strip(), 'blue')) + elif re.match('warning:', line): + self._sys.stdout.write("%s\n" % self._c.format_string( + line.strip(), 'yellow')) + elif re.match('err:', line): + self._sys.stdout.write("%s\n" % self._c.format_string( + line.strip(), 'red')) + else: + self._sys.stdout.write("%s\n" % self._c.format_string( + line.strip(), 'normal')) + elif isinstance(result, RPMTaskResult): + # If result is an instance of RPMTaskResult, + # colorize the rpm.PostManifest output + lines = result.output.splitlines() + for line in lines: + if line.startswith('-'): + self._sys.stdout.write("%s\n" % self._c.format_string( + line.strip(), 'red')) + elif line.startswith('+'): + self._sys.stdout.write("%s\n" % self._c.format_string( + line.strip(), 'green')) + else: + self._sys.stdout.write("%s\n" % self._c.format_string( + line.strip(), 'normal')) + else: + # Use standard pass/fall coloring for output + if isinstance(result.output, types.ListType): + for r in result.output: + self._sys.stdout.write("%s\n" % self._c.format_string( + r.strip(), output_color)) + else: + self._sys.stdout.write("%s\n" % self._c.format_string( + result.output.strip(), output_color)) + +
+
[docs]class LogOutput(_FileLikeOutputObject): + """ + Output a :class:`taboot.tasks.TaskResult` to a logfile. + """ + + def _setup(self, host, task, logfile='taboot.log'): + """ + Implementation specific setup for outputting to a log. + + :Parameters: + - `logfile`: name of the logfile to write to. + """ + self._logfile = logfile + if self._logfile in ('-', 'stdout', '1'): + import sys + self._log_fd = sys.stdout + else: + self._log_fd = open(logfile, 'a') + self._log_fd.write('%s:\n%s Starting Task[%s]\n\n' % ( + host, self.timestamp, task)) + + def _write(self, result): + """ + Implementation of writing to a log. + + :Parameters: + - `result`: result object to inspect and write + """ + import types + + if result.success: + success_str = 'OK' + else: + success_str = 'FAIL' + + self._log_fd.write("%s:\n%s Finished Task[%s]: %s\n" % ( + result.host, self.timestamp, result.task, success_str)) + + if isinstance(result.output, types.ListType): + for r in result.output: + self._log_fd.write("%s\n\n" % r.strip()) + else: + self._log_fd.write("%s\n\n" % result.output.strip()) + +
+
[docs]class EmailOutput(_FileLikeOutputObject): + """ + Output a :class:`taboot.tasks.TaskResult` to a logfile. + """ + + def _setup(self, to_addr, from_addr='taboot@redhat.com'): + """ + Implementation specific setup for outputting to a log. + + :Parameters: + - `to_addr`: who to send the email to. + - `from_addr`: who the email is from. + """ + try: + import cStringIO as StringIO + except ImportError, ie: + import StringIO + self._to_addr = to_addr + self._from_addr = from_addr + self._buffer = StringIO.StringIO() + + def _write(self, result): + """ + Implementation of writing out to an email. + + :Parameters: + - `result`: result object to inspect and write + """ + if result.success: + success_str = 'OK' + else: + success_str = 'FAIL' + + self._buffer.write("%s: %s" % (task_result.task, success_str)) + +
[docs] def flush(self): + """ + Flushing sends the email with the buffer. + """ + import smtplib + from email.mime.text import MIMEText + + self._buffer.flush() + msg = self.MIMEText(self._buffer.read()) + msg['Subject'] = task_result.host + msg['From'] = self._from_addr + msg['To'] = self._to_addr + + smtp = self.smtplib.SMTP() + smtp.connect() + smtp.sendmail(self._from_addr, [self._to_addr], msg.as_string()) + smtp.close() +
+ def __del__(self): + """ + If the buffer is not empty before destroying, flush. + """ + if self._buffer.pos < self._buffer.len: + self.flush() + +
+
[docs]class HTMLOutput(_FileLikeOutputObject): + """ + Output a :class:`taboot.tasks.TaskResult` to the command line + with pretty formatting and colors. + + .. document private functions + .. automethod:: _write + """ + + logfile_path = None + + def _expand_starttime(self, param): + """ + Expand any instances of "%s" in `param` + """ + if '%s' in param: + p = param % HTMLOutput.starttime + return p.replace(" ", "-") + else: + return param + + def _setup(self, host, task, logfile="taboot-%s.html", destdir="."): + """ + Implementation specific setup for outputting to an HTML file. + + :Parameters: + - `host`: name of the host + - `task`: name of the task + - `logfile`: name of the file to log to, '%s' is substituted + with a datestamp + - `destdir`: directory in which to save the log file to + """ + import Colors + import sys + import os.path + import os + + _default_logfile = "taboot-%s.html" + _default_destdir = "." + + # Pick if the parameter is changed + # Pick if above is false and logfile is set in defaults + # Else, use parameter + if not logfile == _default_logfile: + _logfile = logfile + elif HTMLOutput.defaults is not None and \ + HTMLOutput.defaults.has_option("HTMLOutput", "logfile"): + _logfile = HTMLOutput.defaults.get("HTMLOutput", "logfile") + else: + _logfile = logfile + + # Expand %s into a time stamp if necessary + _logfile = self._expand_starttime(_logfile) + + if not destdir == _default_destdir: + _destdir = destdir + elif HTMLOutput.defaults is not None and \ + HTMLOutput.defaults.has_option("HTMLOutput", "destdir"): + _destdir = HTMLOutput.defaults.get("HTMLOutput", "destdir") + else: + _destdir = destdir + + # Figured it all out, now we join them together! + self._logfile_path = os.path.join(_destdir, _logfile) + if not os.path.exists(_destdir): + os.makedirs(_destdir, 0755) + + self._c = Colors.HTMLColors() + self._log_fd = open(self._logfile_path, 'a') + + # Lets only print this when it is set or changed + if HTMLOutput.logfile_path is None or \ + not HTMLOutput.logfile_path == self._logfile_path: + sys.stderr.write("Logging HTML Output to %s\n" % \ + self._logfile_path) + HTMLOutput.logfile_path = self._logfile_path + sys.stderr.flush() + + # Log the start of this task + name = self._fmt_anchor(self._fmt_hostname(host)) + start_msg = """<p><tt>%s:</tt></p> +<p><tt>%s Starting Task[%s]\n</tt>""" % (name, self.timestamp, task) + self._log_fd.write(start_msg) + self._log_fd.flush() + + def _fmt_anchor(self, text): + """ + Format an #anchor and a clickable link to it + """ + h = hash(self.timestamp) + anchor_str = "<a name='%s' href='#%s'>%s</a>" % (h, h, text) + return anchor_str + + def _fmt_hostname(self, n): + """ + Standardize the hostname formatting + """ + return "<b>%s</b>" % self._c.format_string(n, 'blue') + +
[docs] def _write(self, result): + """ + Write a tasks `result` out to HTML. Handles enhanced stylizing + for task results that support such as: + + - :py:mod:`taboot.tasks.puppet.PuppetTaskResult` + - :py:mod:`taboot.tasks.rpm.RPMTaskResult` + """ + import types + import sys + import cgi + + name = self._fmt_hostname(result.host) + + # escape any html in result.output + result.output = cgi.escape(result.output) + + if result.success: + success_str = self._c.format_string('<b>OK</b>', 'green') + else: + success_str = self._c.format_string('<b>FAIL</b>', 'red') + + self._log_fd.write("<p><tt>%s:\n</tt></p>\n<p><tt>%s "\ + "Finished Task[%s]: %s</tt></p>\n" % + (name, self.timestamp, result.task, success_str)) + + if isinstance(result, PuppetTaskResult): + # If result is an instance of PuppetTaskResult, + # colorize the puppet output + lines = result.output.splitlines() + for line in lines: + if re.match('info:', line): + self._log_fd.write("%s<br />\n" % + self._c.format_string(line.strip(), + 'green')) + elif re.match('notice:', line): + self._log_fd.write("%s<br />\n" % + self._c.format_string(line.strip(), + 'blue')) + elif re.match('warning:', line): + self._log_fd.write("%s<br />\n" % + self._c.format_string(line.strip(), + 'yellow')) + elif re.match('err:', line): + self._log_fd.write("%s<br />\n" % + self._c.format_string(line.strip(), + 'red')) + else: + self._log_fd.write("%s<br />\n" % + self._c.format_string(line.strip(), + 'normal')) + self._log_fd.write("<br /><br />\n") + elif isinstance(result, RPMTaskResult): + # If result is an instance of RPMTaskResult, + # colorize the rpm.PostManifest output + lines = result.output.splitlines() + for line in lines: + if line.startswith('-'): + self._log_fd.write("%s<br />\n" % + self._c.format_string(line.strip(), + 'red')) + elif line.startswith('+'): + self._log_fd.write("%s<br />\n" % + self._c.format_string(line.strip(), + 'green')) + else: + self._log_fd.write("%s<br />\n" % + self._c.format_string(line.strip(), + 'normal')) + self._log_fd.write("<br /><br />\n") + else: + # Use standard pass/fall coloring for output + if isinstance(result.output, types.ListType): + for r in result.output: + self._log_fd.write("<pre>%s</pre>\n<br /><br />\n" % + r.strip()) + else: + self._log_fd.write("<pre>%s</pre>\n<br /><br />\n" % + result.output.strip()) + + self._log_fd.flush()
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/runner.html b/html/_modules/taboot/runner.html new file mode 100644 index 00000000000..1cf85daf48d --- /dev/null +++ b/html/_modules/taboot/runner.html @@ -0,0 +1,369 @@ + + + + + + + + + taboot.runner — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.runner

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009-2011, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import threading
+from taboot.util import instantiator
+from log import *
+
+
+
[docs]class Runner(object): + """ + The Runner, responsible for running a taboot job. + """ + + import threading + import taboot.output + + def __init__(self, script, config, expand_globs=True): + """ + :Parameters: + - `script`: an instance of tabootScript + + - `expand_globs`: whether to expand the globs or just leave + them as is. + """ + self._config = config + self._hosts = script.getHosts() + self._tasks = script.getTaskTypes() + self._output = script.getOutputTypes() + self._task_q = [] + self._fail_event = self.threading.Event() + + if expand_globs: + self._hosts = self._expand_globs() + log_debug("Will operate on %s host(s).", len(self._hosts)) + + # Prefight threading + self._preflight_tasks = script.getPreflightTypes() + self._preflight_semaphore = self.threading.Semaphore( + len(self._hosts)) + self._preflight_tasks_q = [] + + # Main task-body threading + if script.getConcurrency() == "all": + self._concurrency = len(self._hosts) + else: + self._concurrency = int(script.getConcurrency()) + log_debug("Setting task-body concurrency to %s.", + self._concurrency) + self._semaphore = self.threading.Semaphore(self._concurrency) + + def _run_preflight(self): + """ + Run the jobs in a prefilght section. + """ + import signal + + rdy_msg = "\nPre-Flight complete, press enter to continue: " + + for host in self._hosts: + t = TaskRunner(host, self._preflight_tasks, + self._preflight_semaphore, + self._output, self._fail_event) + t.start() + self._preflight_tasks_q.append(t) + + signal.signal(signal.SIGINT, self.__sighandler) + + for task in self._task_q: + while task.isAlive(): + task.join(0.1) + + while len(self.threading.enumerate()) > 1: + # Even though all the threads may have been joined we + # should still wait for them to terminate. If we don't + # wait for that we will likely see the 'continue?' prompt + # before the preflight output gets a chance to print. + pass + + if not self._config["onlypreflight"]: + ready = raw_input(rdy_msg) + + if self._fail_event.isSet(): + return False + return True + + def _run_tasks(self): + """ + Run a task body. + """ + import signal + + for host in self._hosts: + t = TaskRunner(host, self._tasks, self._semaphore, self._output, + self._fail_event) + t.start() + self._task_q.append(t) + + signal.signal(signal.SIGINT, self.__sighandler) + + for task in self._task_q: + while task.isAlive(): + task.join(0.1) + + if self._fail_event.isSet(): + return False + return True + +
[docs] def run(self): + """ + Run the preflight/tasks-body + """ + + if len(self._preflight_tasks) > 0: + if not self._run_preflight(): + return False + + if self._config["onlypreflight"]: + return True + else: + return self._run_tasks() +
+ def _expand_globs(self): + """ + Returns the hosts that expand out from globs. + + This is kind of a dirty hack around how Func returns minions + in an arbitrary order. + """ + + import func.overlord.client as fc + + if not self._hosts: + return [] + if isinstance(self._hosts, basestring): + glob = self._hosts + c = fc.Client(glob) + return c.list_minions() + else: + # Iterate over each given item, expand it, and then push + # it onto our list. But only if it doesn't exist already! + found_hosts = [] + for h in self._hosts: + c = fc.Client(h) + new_hosts = filter(lambda h: h not in found_hosts, + c.list_minions()) + found_hosts.extend(new_hosts) + # for found_host in c.list_minions(): + # h = filter + # if not found_host in found_hosts: + # found_hosts.append(found_host) + return found_hosts + + def __sighandler(self, signal, frame): + """ + If we get SIGINT on the CLI, we need to quit all the threads + in our process group + """ + import os + import signal + + os.killpg(os.getpgid(0), signal.SIGQUIT) + +
+
[docs]class TaskRunner(threading.Thread): + """ + TaskRunner is responsible for executing a set of tasks for a + single host in it's own thread. + """ + + from taboot.tasks import TaskResult as _TaskResult + + def __init__(self, host, tasks, semaphore, output, fail_event): + """ + :Parameters: + - `host`: The host to operate on. + - `tasks`: A list of tasks to perform (see :class:`Runner`) + - `semaphore`: The :class:`Runner` semaphore to acquire before + executing + - `output`: A list of outputters to use. (see :class:`Runner`) + - `fail_event`: The :class:`Runner` failure event to check before + executing. If this event is set when the TaskRunner acquires the + semaphore, then the TaskRunner is effectively a no-op. + """ + + threading.Thread.__init__(self) + self._host = host + self._tasks = tasks + self._semaphore = semaphore + self._output = output + self._fail_event = fail_event + self._state = {} + + def __getitem__(self, key): + return self._state[key] + + def __setitem__(self, key, value): + self._state[key] = value + +
[docs] def run(self): + """ + Run the task(s) for the given host. If the fail_event passed + from the invoking :class:`Runner` is set, do nothing. + """ + + self._semaphore.acquire() + + if self._fail_event.isSet(): + # some other host has bombed + self._semaphore.release() + return + + try: + host_success = True + for task in self._tasks: + result = self.run_task(task) + if not result.success and not result.ignore_errors: + host_success = False + break + except: + self._bail_failure() + raise + + if not host_success: + self._bail_failure() + else: + self._semaphore.release() + return host_success +
+ def _bail_failure(self): + """ + Die nicely :) + """ + + self._fail_event.set() + self._semaphore.release() + +
[docs] def run_task(self, task): + """ + Run a single task. Sets task.host and then invokes the run + method for the task. + + :Parameters: + - `task`: The task to run + """ + + ignore_errors = False + if 'ignore_errors' in task: + if task['ignore_errors'] in ('True', 'true', 1): + ignore_errors = True + + task = instantiator(task, 'taboot.tasks', host=self._host) + + outputters = [] + for o in self._output: + instance = instantiator(o, 'taboot.output', + host=self._host, + task=task) + outputters.append(instance) + + try: + result = task.run(self) + except Exception, e: + result = self._TaskResult(task, output=repr(e)) + + for o in outputters: + o.write(result) + + result.ignore_errors = ignore_errors + return result
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/tasks.html b/html/_modules/taboot/tasks.html new file mode 100644 index 00000000000..0f45d649c39 --- /dev/null +++ b/html/_modules/taboot/tasks.html @@ -0,0 +1,263 @@ + + + + + + + + + taboot.tasks — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.tasks

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009-2011, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+
[docs]class BaseTask(object): + """ + Base Task. All tasks should inherit from this. It does the + pretty string representation of a task and allows setting of the + host attribute. + """ + + def __init__(self, *args, **kwargs): + self._name = str(type(self)) + next = self._name.index("'") + 1 + self._name = self._name[next:self._name.rindex("'")] + self._args = args + self.host = kwargs['host'] + self.concurrentFriendly = True + + def __repr__(self): + return "%s%s" % (self._name, self._args) + + def _sethost(self, host): + self._host = host + + def _gethost(self): + if hasattr(self, '_host'): + return self._host + else: + return None + + host = property(_gethost, _sethost) + +
+
[docs]class FuncTask(BaseTask): + """ + A Func-based task. All tasks that utilize Func should inherit + from this. + """ + + import func.jobthing + from taboot.errors import FuncException as _FuncException + + def _func_run(self, func_command, *args): + """ + Execute a command via Func. + + :Paramaters: + - `func_command` String representing func command to run + (e.g. 'command.run') + - `*args` Argument(s) to be used when invoking the func command + """ + + import time + import func.overlord.client + try: + client = func.overlord.client.Client(self._host, async=True) + job_id = reduce(lambda x, y: getattr(x, y), + func_command.split('.'), + client)(*args) + # poll until the job completes + (status, result) = (None, None) + while status != self.func.jobthing.JOB_ID_FINISHED: + (status, result) = client.job_status(job_id) + time.sleep(1) + result = result[self._host] + if result[0] == 'REMOTE_ERROR': + raise self._FuncException(result[1:]) + return (True, result) + except Exception, ex: + return (False, repr(ex)) + +
[docs] def run(self, runner): + """ + Run the FuncTask. + + :Parameters: + - `runner` A :class:`taboot.runner.TaskRunner` instance + """ + + if not hasattr(self, '_command'): + raise Exception("You MUST set self._command when instantiating " + + "a subclass of FuncTask!") + + result = self._func_run(self._command, *(self._args)) + + if result[0]: + # command executed successfully as far as "func success" + return self._process_result(result[1]) + else: + return TaskResult(self, success=False, output=result[1]) + +
+
[docs]class FuncErrorTask(FuncTask): + """ + Explicitly cause a func remote error by calling a bad command. + Used to verify func exception handling works as expected + """ + + def __init__(self, *args, **kwargs): + super(FuncErrorTask, self).__init__(*args, **kwargs) + self._command = 'thiscommand.DoesntExist' + +
+
[docs]class TaskResult(object): + """ + An encapsulation of the results of a task. This is passed to one + or more instances of output classes (derived from BaseOutput) in + order to display to the user. + """ + + def __init__(self, task, success=False, output='', ignore_errors=False): + """ + :Parameters: + - `task`: The task object represented by this result + - `success`: Whether the task completed successfully or not + - `output`: Any text output produced by the task + """ + + if hasattr(task, 'host'): + self._host = task.host + self._task = repr(task) + self._taskObj = task + self._success = success + self._output = output + self._ignore_errors = ignore_errors + + def _gettask(self): + return self._task + + def _gettaskObj(self): + return self._taskObj + + def _settask(self, t): + self._task = repr(t) + + def _getsuccess(self): + return self._success + + def _setsuccess(self, success): + self._success = success + + def _getoutput(self): + return self._output + + def _setoutput(self, output): + self._output = output + + def _getignore_errors(self): + return self._ignore_errors + + def _setignore_errors(self, ignore_errors): + self._ignore_errors = ignore_errors + + def _gethost(self): + return self._host + + task = property(_gettask, _settask) + success = property(_getsuccess, _setsuccess) + output = property(_getoutput, _setoutput) + ignore_errors = property(_getignore_errors, _setignore_errors) + host = property(_gethost) + taskObj = property(_gettaskObj)
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/tasks/command.html b/html/_modules/taboot/tasks/command.html new file mode 100644 index 00000000000..6e045578b1f --- /dev/null +++ b/html/_modules/taboot/tasks/command.html @@ -0,0 +1,129 @@ + + + + + + + + + taboot.tasks.command — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.tasks.command

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009,2010, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from taboot.tasks import FuncTask, TaskResult
+
+
+
[docs]class Run(FuncTask): + """ + Run arbitrary commands via Func. The arguments passed to __init__ + are used to execute func.overlord.Client.command.run(args). + + :Parameters: + - `command`: Command to run on the remote host + """ + + def __init__(self, command, **kwargs): + super(Run, self).__init__(command, **kwargs) + self._command = 'command.run' + + def _process_result(self, result): + t = TaskResult(self) + if result[0] == 0: + t.success = True + else: + t.success = False + t.output = result[1] + return t
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/tasks/mod_jk.html b/html/_modules/taboot/tasks/mod_jk.html new file mode 100644 index 00000000000..b94031b0100 --- /dev/null +++ b/html/_modules/taboot/tasks/mod_jk.html @@ -0,0 +1,190 @@ + + + + + + + + + taboot.tasks.mod_jk — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.tasks.mod_jk

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009-2011, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from taboot.tasks import BaseTask, FuncTask, TaskResult
+
+JK_ENABLE = 0
+JK_DISABLE = 1
+JK_STOP = 2
+
+
+class ToggleHost(FuncTask):
+    def __init__(self, action, proxyhost, **kwargs):
+        super(ToggleHost, self).__init__(proxyhost, **kwargs)
+        self._action = action
+        if action == JK_ENABLE:
+            self._command = 'taboot.modjk.enable_host'
+        elif action == JK_DISABLE:
+            self._command = 'taboot.modjk.disable_host'
+        elif action == JK_STOP:
+            self._command = 'taboot.modjk.stop_host'
+        else:
+            raise Exception("Undefined toggle action")
+
+    def _process_result(self, result):
+        t = TaskResult(self)
+        if len(result) > 0:
+            t.success = True
+            if self._action == JK_ENABLE:
+                verb = 'Enabled'
+            elif self._action == JK_DISABLE:
+                verb = 'Disabled'
+            elif self._action == JK_STOP:
+                verb = 'Stopped'
+
+            t.output = "%s AJP on the following balancer/worker " \
+                "pairs:\n" % verb
+            for balancer, worker in result:
+                t.output += "%s:  %s\n" % (balancer, worker)
+        else:
+            t.success = False
+            t.output = "Failed to find worker host"
+        return t
+
+
+class JKBaseTask(BaseTask):
+    def __init__(self, proxies, action, **kwargs):
+        super(JKBaseTask, self).__init__(**kwargs)
+        from sys import modules
+        self.proxies = proxies
+        self.jkaction = getattr(modules[self.__module__], "JK_%s" %
+                                action.upper())
+
+    def run(self, runner):
+        output = ""
+        success = True
+        for proxy in self.proxies:
+            toggler = ToggleHost(self.jkaction, self._host, host=proxy)
+            result = toggler.run(runner)
+            output += "%s:\n" % proxy
+            output += "%s\n" % result.output
+            if result.success == False:
+                success = False
+                break
+        return TaskResult(self, success=success, output=output)
+
+
+
[docs]class OutOfRotation(JKBaseTask): + """ + Remove an AJP node from rotation on a proxy via modjkapi access on + the proxy with func. + + :Parameters: + - `proxies`: A list of URLs to AJP jkmanage interfaces + """ + def __init__(self, proxies, action="stop", **kwargs): + super(OutOfRotation, self).__init__(proxies, action, **kwargs) + +
+
[docs]class InRotation(JKBaseTask): + """ + Put an AJP node in rotation on a proxy via modjkapi access on + the proxy with func. + + :Parameters: + - `proxies`: A list of URLs to AJP jkmanage interfaces + """ + def __init__(self, proxies, action="enable", **kwargs): + super(InRotation, self).__init__(proxies, action, **kwargs)
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/tasks/nagios.html b/html/_modules/taboot/tasks/nagios.html new file mode 100644 index 00000000000..e21129d18e9 --- /dev/null +++ b/html/_modules/taboot/tasks/nagios.html @@ -0,0 +1,284 @@ + + + + + + + + + taboot.tasks.nagios — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.tasks.nagios

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009-2011, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from taboot.tasks import BaseTask, TaskResult, FuncTask
+import taboot.errors
+import sys
+
+
+
[docs]class NagiosBase(FuncTask): + """ + All subsequent Nagios tasks are subclasses of this. + + Code note: Because a `FuncTask` expects to make connections to + `self.host` we need to switch `nagios_url` with `self.host` and + pass the original `self.host` as an argument. + + .. versionchanged:: 0.2.14 + + The previous version specified the `nagios_url` parameter as a + URL. To facilitate transitions we automatically correct URLs + into hostnames. + + Previously the `service` key was defined as a scalar, like + "HTTP" or "JBOSS". This version accepts that key as a scalar OR + as a list and "does the right thing" in each case. + """ + + def _fix_nagios_url(self, nagios_url): + """ + For backwards compatability we accept a Nagios URL that + identifies an HTTP resource. + + This method will take a string like http://foo.com/nagios/cmd.cgi + and return just the hostname component ("foo.com"). + """ + import re + return re.sub(r'(https?://)([^/]+)(.*)', r'\2', nagios_url) + + def _process_result(self, result): + t = TaskResult(self) + + if result.startswith("Fail: "): + t.success = False + else: + t.sucess = True + t.success = True + t.output = result + return t + +
+
[docs]class DisableAlerts(NagiosBase): + """ + Disable alerts for a host on a nagios instance + """ + + def __init__(self, nagios_url, **kwargs): + """ + :Parameters: + - `nagios_url`: Hostname of the Nagios server. + """ + target_host = kwargs['host'] + kwargs['host'] = self._fix_nagios_url(nagios_url) + super(DisableAlerts, self).__init__(target_host, **kwargs) + self._command = 'nagios.disable_host_notifications' + +
+
[docs]class EnableAlerts(NagiosBase): + """ + Enable alerts for a host on a nagios instance + """ + + def __init__(self, nagios_url, **kwargs): + """ + :Parameters: + - `nagios_url`: Hostname of the Nagios server. + """ + target_host = kwargs['host'] + kwargs['host'] = self._fix_nagios_url(nagios_url) + super(EnableAlerts, self).__init__(target_host, **kwargs) + self._command = 'nagios.enable_host_notifications' + +
+
[docs]class ScheduleDowntime(NagiosBase): + """ + Schedule downtime for services on a host in Nagios + """ + + def __init__(self, nagios_url, service='HOST', minutes=30, **kwargs): + """ + :Parameters: + - `nagios_url`: Hostname of the Nagios server. + - `service`: Service or list of services to schedule down for. + - `minutes`: The number of minutes to schedule downtime + for. Default is 30. + """ + import types + target_host = kwargs['host'] + kwargs['host'] = self._fix_nagios_url(nagios_url) + + if isinstance(service, types.StringTypes): + service = [service] + + if not isinstance(minutes, types.IntType): + if isinstance(minutes, types.FloatType): + minutes = int(minutes) + else: + raise TypeError("Invalid data given for minutes.", + "Expecting int type.", + "Got '%s'." % minutes) + + super(ScheduleDowntime, self).__init__(target_host, service, + minutes, **kwargs) + + if service == 'HOST': + self._command = "nagios.schedule_host_downtime" + else: + self._command = 'nagios.schedule_svc_downtime' + + def _process_result(self, result): + t = TaskResult(self) + t.success = True + for r in result: + if r.startswith("Fail: "): + t.success = t.success & False + else: + t.sucess = t.success & True + t.output = result + return t + +
+
[docs]class SilenceHost(NagiosBase): + """ + Silence all notifications for a given host + """ + + def __init__(self, nagios_url, **kwargs): + """ + :Parameters: + - `nagios_url`: Hostname of the Nagios server. + """ + target_host = kwargs['host'] + kwargs['host'] = self._fix_nagios_url(nagios_url) + super(SilenceHost, self).__init__(target_host, **kwargs) + self._command = 'nagios.silence_host' + + def _process_result(self, result): + t = TaskResult(self) + t.success = True + for r in result: + if r.startswith("Fail: "): + t.success = t.success & False + else: + t.sucess = t.success & True + t.output = result + return t + +
+
[docs]class UnsilenceHost(NagiosBase): + """ + Unsilence all notifications for a given host + """ + + def __init__(self, nagios_url, **kwargs): + """ + :Parameters: + - `nagios_url`: Hostname of the Nagios server. + """ + target_host = kwargs['host'] + kwargs['host'] = self._fix_nagios_url(nagios_url) + super(UnsilenceHost, self).__init__(target_host, **kwargs) + self._command = 'nagios.unsilence_host' + + def _process_result(self, result): + t = TaskResult(self) + t.success = True + for r in result: + if r.startswith("Fail: "): + t.success = t.success & False + else: + t.sucess = t.success & True + t.output = result + return t
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/tasks/poller.html b/html/_modules/taboot/tasks/poller.html new file mode 100644 index 00000000000..6dc8165cb7c --- /dev/null +++ b/html/_modules/taboot/tasks/poller.html @@ -0,0 +1,149 @@ + + + + + + + + + taboot.tasks.poller — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.tasks.poller

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from taboot.tasks import BaseTask
+from taboot.tasks import TaskResult
+import time
+
+
+
[docs]class PollTask(BaseTask): + """ + PollTask. A task that will poll a particular task until the task + succeeds or until max_attempts is reached. + + :Parameters: + - `task` The task to poll. + - `sleep_interval` The number of seconds to wait before trying + the task again. + - `max_attempts` The maximum number of attempts that the task + should be run. + - `fail_task` The task to run when max_attempts has been exhausted. + If no fail_task is provided, then a simple TaskResult + indicating failure is returned. + """ + + def __init__(self, task, sleep_interval=5, max_attempts=6, + fail_task=None, **kwargs): + super(PollTask, self).__init__(**kwargs) + self._task = task + self._sleep_interval = sleep_interval + self._max_attempts = max_attempts + self._fail_task = fail_task + + def run(self, runner): + for x in range(self._max_attempts): + result = runner.run_task(self._task) + if result.success: + return result + time.sleep(self._sleep_interval) + + # exhausted max_attempts + if self._fail_task != None: + return runner.run_task(self._fail_task) + else: + # return a "failed" TaskResult, stop executing further tasks + return TaskResult(self, success=False, + output="Max attempts of %s reached running %s" % + (self._max_attempts, repr(self._task)))
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/tasks/puppet.html b/html/_modules/taboot/tasks/puppet.html new file mode 100644 index 00000000000..ffb49ee3ec2 --- /dev/null +++ b/html/_modules/taboot/tasks/puppet.html @@ -0,0 +1,196 @@ + + + + + + + + + taboot.tasks.puppet — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.tasks.puppet

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009-2011, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from taboot.tasks import command, TaskResult
+import puppet
+
+
+
[docs]class PuppetBase(command.Run): + """ + Base class for puppet commands + """ + + def __init__(self, pcmd, **kwargs): + super(PuppetBase, self).__init__(pcmd, **kwargs) + +
+
[docs]class Run(PuppetBase): + """ + Run 'puppetd --test || true' + + :Optional Parameters: + - `server`: Puppetmaster to run against + - `noop`: If this should be a noop run (Boolean) + - `safe`: Abort if puppet errors (Boolean) + + See also: :py:meth:`taboot.tasks.Puppet.SafeRun` + """ + + def __init__(self, server="", noop=False, safe=False, **kwargs): + pcmd = "puppetd --test --color=false" + if server != "": + pcmd += " --server=%s" % server + if noop == True: + pcmd += " --noop" + if safe == False: + # If safe is False, ignore the return code of the puppet run + pcmd += " || true" + super(Run, self).__init__(pcmd, **kwargs) + + def run(self, runner): + result = super(Run, self).run(runner) + return PuppetTaskResult(result.taskObj, result.success, + result.output, result.ignore_errors) + +
+
[docs]class SafeRun(puppet.Run): + """ + Run 'puppetd --test'. + + How is this different from Run? Simple, it will abort everything + if puppet returns with a non-zero exit status. + """ + + def __init__(self, server="", **kwargs): + super(SafeRun, self).__init__(server, safe=True, **kwargs) + +
+
[docs]class Enable(PuppetBase): + """ + Run 'puppetd --enable'. + """ + + def __init__(self, **kwargs): + super(Enable, self).__init__('puppetd --enable', **kwargs) + +
+
[docs]class Disable(PuppetBase): + """ + Run 'puppetd --disable'. + """ + + def __init__(self, **kwargs): + super(Disable, self).__init__('puppetd --disable', **kwargs) + +
+
[docs]class DeleteLockfile(PuppetBase): + """ + Remove the puppet lock file. + """ + + def __init__(self, **kwargs): + PUPPET_LOCKFILE = "/var/lib/puppet/state/puppetdlock" + super(DeleteLockfile, self).__init__("rm -f %s" % PUPPET_LOCKFILE, + **kwargs) + +
+
[docs]class PuppetTaskResult(TaskResult): + """ + Wrapper around TaskResult to be able to differentiate in output class + """ + + def __init__(self, task, success=False, output='', ignore_errors=False): + super(PuppetTaskResult, self).__init__(task, success, output, + ignore_errors)
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/tasks/rpm.html b/html/_modules/taboot/tasks/rpm.html new file mode 100644 index 00000000000..69b629eaafb --- /dev/null +++ b/html/_modules/taboot/tasks/rpm.html @@ -0,0 +1,189 @@ + + + + + + + + + taboot.tasks.rpm — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.tasks.rpm

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009,2010, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from taboot.tasks import command, TaskResult
+
+
+
[docs]class RPMBase(command.Run): + """ + Base class for rpm commands + """ + + def __init__(self, pcmd, **kwargs): + super(RPMBase, self).__init__(pcmd, **kwargs) + +
+
[docs]class PreManifest(command.Run): + """ + Gather list of installed RPMs. A later invocation of :class:`PostManifest` + is then used to output the RPMs changed during intermediate tasks. + """ + + def __init__(self, **kwargs): + super(PreManifest, self).__init__('rpm -qa | sort', **kwargs) + +
[docs] def run(self, runner): + """ + Override the default :class:`command.Run` to strip the output + from the result because we're really not interested in the + contents of the pre-manifest; we just want to collect it to + compare later on with PostManifest. + """ + + result = super(PreManifest, self).run(runner) + runner['rpm.PreManifest'] = result.output + result.output = '' + return result + +
+
[docs]class PostManifest(command.Run): + """ + Gather list of installed RPMs and compare against a previously + taken :class:`PreManifest` + """ + + from difflib import Differ as _Differ + + def __init__(self, **kwargs): + super(PostManifest, self).__init__('rpm -qa | sort', **kwargs) + +
[docs] def run(self, runner): + """ + The runner that gets passed in contains state that can be + access via dict-like access. PreManifest uses this to write + to the rpm.Premanifest field. So we'll check to make sure the + pre-manifest is there by looking for that state. + """ + try: + pre_manifest = runner['rpm.PreManifest'] + except: + return TaskResult(self, success=False, + output="You must use PreManifest before PostManifest") + + # ok, so now we have something to compare against so we get + # new state... + result = super(command.Run, self).run(runner) + + old_list = pre_manifest.splitlines(1) + new_list = result.output.splitlines(1) + + differ = self._Differ() + diff_output = list(differ.compare(old_list, new_list)) + diff_output = [line for line in diff_output if line[0] in ('+', '-')] + + result.output = ''.join(diff_output) + + return RPMTaskResult(result.taskObj, result.success, + result.output, result.ignore_errors) + +
+
[docs]class RPMTaskResult(TaskResult): + """ + Wrapper around TaskResult to be able to differentiate in output class + """ + + def __init__(self, task, success=False, output='', ignore_errors=False): + super(RPMTaskResult, self).__init__(task, success, output, + ignore_errors)
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/tasks/service.html b/html/_modules/taboot/tasks/service.html new file mode 100644 index 00000000000..98e238d47d9 --- /dev/null +++ b/html/_modules/taboot/tasks/service.html @@ -0,0 +1,149 @@ + + + + + + + + + taboot.tasks.service — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.tasks.service

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009,2011, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from taboot.tasks import command
+
+
+
[docs]class ServiceBase(command.Run): + """ + Base Class for system service tasks + """ + pass + +
+
[docs]class Start(ServiceBase): + """ + Start a service. + + Arguments: + - ``service`` - The service to start. + """ + + def __init__(self, service, **kwargs): + super(Start, self).__init__('service %s start' % service, **kwargs) + +
+
[docs]class Stop(ServiceBase): + """ + Stop a service. + + Arguments: + - ``service`` - The service to stop. + """ + + def __init__(self, service, **kwargs): + super(Stop, self).__init__('service %s stop' % service, **kwargs) + +
+
[docs]class Restart(ServiceBase): + """ + Restart a service. + + Arguments: + - ``service`` - The service to restart. + """ + + def __init__(self, service, **kwargs): + super(Restart, self).__init__('service %s restart' % service, **kwargs)
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/tasks/sleep.html b/html/_modules/taboot/tasks/sleep.html new file mode 100644 index 00000000000..a6274052935 --- /dev/null +++ b/html/_modules/taboot/tasks/sleep.html @@ -0,0 +1,181 @@ + + + + + + + + + taboot.tasks.sleep — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.tasks.sleep

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2011, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from taboot.tasks import BaseTask, TaskResult
+from termios import tcflush, TCIFLUSH
+import sys
+
+
+
[docs]class SleepBase(BaseTask): + """ + Base class for task-queue pausing classes. + """ + + def __init__(self, **kwargs): + super(SleepBase, self).__init__(**kwargs) + +
+
[docs]class Seconds(SleepBase): + """ + Halt task processing on a node for a certain number of seconds. + + :Parameters: + - `seconds`: Number of seconds to halt execution for. + """ + + def __init__(self, seconds=60, **kwargs): + super(Seconds, self).__init__(**kwargs) + self._seconds = seconds + + def run(self, runner): + import time + time.sleep(self._seconds) + return TaskResult(self, success=True, + output="Paused for %s seconds" % + self._seconds) + +
+
[docs]class Minutes(SleepBase): + """ + Halt task processing on a node for a certain number of minutes. + + :Parameters: + - `minutes`: Number of minutes to halt execution for. + """ + + def __init__(self, minutes=1, **kwargs): + super(Minutes, self).__init__(**kwargs) + self._minutes = minutes + self._seconds = minutes * 60 + + def run(self, runner): + import time + time.sleep(self._seconds) + return TaskResult(self, success=True, + output="Paused for %s minutes" % + self._minutes) + +
+
[docs]class WaitOnInput(SleepBase): + """ + Halt task processing on a node until the user presses enter. + + :Parameters: + - `message`: The message to prompt on the CLI. + """ + + def __init__(self, message="Press enter to continue\n", **kwargs): + super(WaitOnInput, self).__init__(**kwargs) + self._message = message + self.concurrentFriendly = False + + def run(self, runner): + import time + start = time.time() + tcflush(sys.stdin, TCIFLUSH) + raw_input(self._message) + return TaskResult(self, success=True, + output="Paused for %s seconds" % + (time.time() - start))
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_modules/taboot/tasks/yum.html b/html/_modules/taboot/tasks/yum.html new file mode 100644 index 00000000000..49945efa7a1 --- /dev/null +++ b/html/_modules/taboot/tasks/yum.html @@ -0,0 +1,166 @@ + + + + + + + + + taboot.tasks.yum — Taboot v0.4.0 documentation + + + + + + + + + + + + +
+
+
+
+ +

Source code for taboot.tasks.yum

+# -*- coding: utf-8 -*-
+# Taboot - Client utility for performing deployments with Func.
+# Copyright © 2009, Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from taboot.tasks import command, BaseTask
+
+
+
[docs]class YumBase(BaseTask): + """ + Base class for all Yum-related tasks. + """ + + def __init__(self, packages): + if isinstance(packages, list): + self._packages = packages + self._packages_str = ' '.join(packages) + else: + self._packages = [packages] + self._packages_str = packages + +
+
[docs]class Install(YumBase, command.Run): + """ + Install one or more packages. + """ + + def __init__(self, packages, **kwargs): + """ + :Parameters: + - `packages`: A list of packages to install + """ + YumBase.__init__(self, packages) + command.Run.__init__(self, 'yum install -y %s' % self._packages_str, + **kwargs) + +
+
[docs]class Update(YumBase, command.Run): + """ + Update one or more packages. + """ + + def __init__(self, packages=[], **kwargs): + """ + :Parameters: + - `packages`: A list of packages to update. If `packages` is empty, + update all packages on the system. + """ + YumBase.__init__(self, packages) + command.Run.__init__(self, 'yum update -y %s' % self._packages_str, + **kwargs) + +
+
[docs]class Remove(YumBase, command.Run): + """ + Remove one or more packages. + """ + + def __init__(self, packages, **kwargs): + """ + :Parameters: + - `packages`: A list of packages to remove. + """ + YumBase.__init__(self, packages) + command.Run.__init__(self, 'yum remove -y %s' % self._packages_str, + **kwargs)
+
+ +
+
+
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/html/_sources/YAMLScripts.txt b/html/_sources/YAMLScripts.txt new file mode 100644 index 00000000000..de59528b785 --- /dev/null +++ b/html/_sources/YAMLScripts.txt @@ -0,0 +1,82 @@ +YAML Scripts +============ + +This page provides a basic overview of correct YAML syntax. + + +YAML Basics +----------- + +For `ansible`, every YAML script must be a list at it's root-most +element. Each item in the list is a dictionary. These dictionaries +represent all the options you can use to write a `ansible` script. In +addition, all YAML files (regardless of their association with +`ansible` or not) should start with ``---``. + +In YAML a list can be represented in two ways. In one way all members +of a list are lines beginning at the same indentation level starting +with a ``-`` character:: + + --- + # A list of tasty fruits + - Apple + - Orange + - Strawberry + - Mango + +In the second way a list is represented as comma separated elements +surrounded by square brackets. Newlines are permitted between +elements:: + + --- + # A list of tasty fruits + [apple, orange, banana, mango] + +A dictionary is represented in a simple ``key:`` and ``value`` form:: + + --- + # An employee record + name: John Eckersberg + job: Developer + skill: Elite + +Like lists, dictionaries can be represented in an abbreviated form:: + + --- + # An employee record + {name: John Eckersberg, job: Developer, skill: Elite} + +.. _truthiness: + +You can specify a boolean value (true/false) in several forms:: + + --- + knows_oop: True + likes_emacs: TRUE + uses_cvs: false + +Finally, you can combine these data structures:: + + --- + # An employee record + name: John Eckersberg + job: Developer + skill: Elite + employed: True + foods: + - Apple + - Orange + - Strawberry + - Mango + languages: + ruby: Elite + python: Elite + dotnet: Lame + +That's all you really need to know about YAML to get started writing +`Ansible` scripts. + +.. seealso:: + + `YAMLLint `_ + YAML Lint gets the lint out of your YAML diff --git a/html/_sources/api.txt b/html/_sources/api.txt new file mode 100644 index 00000000000..1cc8454a67d --- /dev/null +++ b/html/_sources/api.txt @@ -0,0 +1,55 @@ +API +=== + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim +placerat nibh, non feugiat risus varius vitae. Donec eu libero +lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in +magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, +dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus +mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae +luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis +ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, +rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies +tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis +egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna +sem. Donec arcu felis, faucibus et malesuada non, blandit vitae +metus. Fusce nec sapien dolor. + +Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, +pretium quis sapien. Duis felis metus, sodales sit amet gravida in, +pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin +eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, +suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada +molestie, nisi nunc placerat libero, vel vulputate elit tellus et +augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat +egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan +lorem eget leo dictum viverra. + +Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean +ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar +quam. Suspendisse nec massa vel augue laoreet ultricies in convallis +dolor. Mauris sodales porta enim, non ultricies dolor luctus +in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, +erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra +arcu sem a ante. Praesent nec metus vestibulum augue eleifend +suscipit. In feugiat, sem nec dignissim consequat, velit tortor +scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh +turpis. Proin ac nisi ligula, a pretium augue. + +In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed +ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, +eget lobortis mi magna sed metus. Cras justo est, tempus quis +adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et +luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae +nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc +sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet +lacus. Maecenas interdum viverra laoreet. Quisque elementum +sollicitudin ullamcorper. + +Pellentesque mauris sem, malesuada at lobortis in, porta eget +urna. Duis aliquet quam eget risus elementum quis auctor ligula +gravida. Phasellus et ullamcorper libero. Nam elementum ultricies +tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat +tristique lobortis. Suspendisse est enim, tristique eu convallis id, +rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin +hendrerit mi tincidunt dui fermentum placerat. diff --git a/html/_sources/code.txt b/html/_sources/code.txt new file mode 100644 index 00000000000..4a12e449d60 --- /dev/null +++ b/html/_sources/code.txt @@ -0,0 +1,78 @@ +Code +==== + +Taboot +------ +.. automodule:: taboot + :members: + :undoc-members: + +Taboot runner +------------- +.. automodule:: taboot.runner + :members: + :undoc-members: + +.. _taboot.tasks: + +Taboot tasks +------------ +.. automodule:: taboot.tasks + :members: + +AJP Tasks +^^^^^^^^^ +.. automodule:: taboot.tasks.mod_jk + :members: + +Command tasks +^^^^^^^^^^^^^ +.. automodule:: taboot.tasks.command + :members: + +Misc tasks +^^^^^^^^^^ +.. automodule:: taboot.tasks.misc + :members: + +Nagios tasks +^^^^^^^^^^^^ +.. automodule:: taboot.tasks.nagios + :members: + +Polling tasks +^^^^^^^^^^^^^ +.. automodule:: taboot.tasks.poller + :members: + +Puppet tasks +^^^^^^^^^^^^ +.. automodule:: taboot.tasks.puppet + :members: + +RPM tasks +^^^^^^^^^ +.. automodule:: taboot.tasks.rpm + :members: + +Service tasks +^^^^^^^^^^^^^ +.. automodule:: taboot.tasks.service + :members: + +Sleep tasks +^^^^^^^^^^^ +.. automodule:: taboot.tasks.sleep + :members: + +Yum tasks +^^^^^^^^^ +.. automodule:: taboot.tasks.yum + :members: + +Taboot output +------------- +.. automodule:: taboot.output + :members: + :undoc-members: + diff --git a/html/_sources/communicate.txt b/html/_sources/communicate.txt new file mode 100644 index 00000000000..8e4d12a3b0b --- /dev/null +++ b/html/_sources/communicate.txt @@ -0,0 +1,55 @@ +Communicate +=========== + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim +placerat nibh, non feugiat risus varius vitae. Donec eu libero +lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in +magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, +dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus +mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae +luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis +ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, +rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies +tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis +egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna +sem. Donec arcu felis, faucibus et malesuada non, blandit vitae +metus. Fusce nec sapien dolor. + +Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, +pretium quis sapien. Duis felis metus, sodales sit amet gravida in, +pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin +eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, +suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada +molestie, nisi nunc placerat libero, vel vulputate elit tellus et +augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat +egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan +lorem eget leo dictum viverra. + +Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean +ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar +quam. Suspendisse nec massa vel augue laoreet ultricies in convallis +dolor. Mauris sodales porta enim, non ultricies dolor luctus +in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, +erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra +arcu sem a ante. Praesent nec metus vestibulum augue eleifend +suscipit. In feugiat, sem nec dignissim consequat, velit tortor +scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh +turpis. Proin ac nisi ligula, a pretium augue. + +In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed +ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, +eget lobortis mi magna sed metus. Cras justo est, tempus quis +adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et +luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae +nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc +sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet +lacus. Maecenas interdum viverra laoreet. Quisque elementum +sollicitudin ullamcorper. + +Pellentesque mauris sem, malesuada at lobortis in, porta eget +urna. Duis aliquet quam eget risus elementum quis auctor ligula +gravida. Phasellus et ullamcorper libero. Nam elementum ultricies +tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat +tristique lobortis. Suspendisse est enim, tristique eu convallis id, +rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin +hendrerit mi tincidunt dui fermentum placerat. diff --git a/html/_sources/development.txt b/html/_sources/development.txt new file mode 100644 index 00000000000..cb74b86da44 --- /dev/null +++ b/html/_sources/development.txt @@ -0,0 +1,98 @@ +Development +=========== + +Tools +----- + +Taboot uses what is becoming a pretty standard and a quite simple +toolset. + + +Required Tools +`````````````` + #. `python `_ - The python programming language + #. `distutils `_ - Python building and packaging library + #. `git `_ - Source code management + #. `Func `_ - The Fedora Unified Network Controller + #. `an `_ `editor `_ or `ide `_ `that `_ doesn't suck + + + +Optional Tools +`````````````` +These should be available via your package manager: + + #. `rpm-build `_ - Should be packaged in your RPM distribution + #. `pep8 `_ - Check your patches for pep8 compliance with ``make pep8`` + + +Source +------ +You can clone the repo via :program:`git` through the following command::: + + $ git clone git://git.fedorahosted.org/Taboot.git + + +:pep:`0008` should be followed. This outlines the highlights that we +require above and beyond. Your code must follow this (or note why it +can't) before patches will be accepted. + + * global variables should be in ALLCAPPS + * attributes should be all lowercase + * classes should be ``CamelCased``, filenames should be ``lowercase``. + * functions and methods should be lowercase with spaces replaced with _'s:: + + def a_test_method(self): + pass + + * classes should subclass ``object`` unless it subclasses a different object:: + + class Person(object): + pass + + class Steve(Person): + pass + + * 4 spaces per indent level + * max length is 79 chars. + * single quotes preferred over double quotes. + * avoid ``from x import *`` imports unless a must use + * modules, functions, classes, and methods all must have docstrings - doc strings should be descriptive of what objects, functions, and methods do + * document any potentially confusing sections of code + * functions and methods should be broken down in such a way as to be easily understood and self contained + * use descriptive variable names, only use things like x, y, etc.. when doing integer loops and even then see if you can use more descriptive names + +.. note:: + The ``Makefile`` included in the root of the source distribution + includes a target called ``pep8``. Run ``make pep8`` to + automatically scan the ``taboot/`` subdirectory for violations. + + + +Git +--- + +The best way to develop on Taboot is to branch feature sets. For +instance, if you were to add xml deserialization you would want to +branch locally and work on that branch.:: + + $ git branch + * master + $ git status + # On branch master + nothing to commit (working directory clean) + $ git branch xmldeserialization + $ git checkout xmldeserialization + +Now we pretend you are all finished and have done at least one commit to the xmldeserialization branch.:: + + + $ git-format-patch master + 0001-created-initial-classes.patch + 0002-added-in-documentation.patch + $ + + +You now have patch sets which you can send in for perusal and +acceptance. Open a new ticket in our issue tracker or attach them to +an existing ticket. diff --git a/html/_sources/examples.txt b/html/_sources/examples.txt new file mode 100644 index 00000000000..44194c9ff0b --- /dev/null +++ b/html/_sources/examples.txt @@ -0,0 +1,71 @@ +Examples +======== + +Examples 1 +`````````` + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim +placerat nibh, non feugiat risus varius vitae. Donec eu libero +lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in +magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, +dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus +mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae +luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis +ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, +rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies +tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis +egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna +sem. Donec arcu felis, faucibus et malesuada non, blandit vitae +metus. Fusce nec sapien dolor. + + +Examples 2 +`````````` + +Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, +pretium quis sapien. Duis felis metus, sodales sit amet gravida in, +pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin +eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, +suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada +molestie, nisi nunc placerat libero, vel vulputate elit tellus et +augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat +egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan +lorem eget leo dictum viverra. + +Examples 3 +`````````` + +Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean +ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar +quam. Suspendisse nec massa vel augue laoreet ultricies in convallis +dolor. Mauris sodales porta enim, non ultricies dolor luctus +in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, +erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra +arcu sem a ante. Praesent nec metus vestibulum augue eleifend +suscipit. In feugiat, sem nec dignissim consequat, velit tortor +scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh +turpis. Proin ac nisi ligula, a pretium augue. + +Examples 3 +`````````` + +In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed +ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, +eget lobortis mi magna sed metus. Cras justo est, tempus quis +adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et +luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae +nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc +sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet +lacus. Maecenas interdum viverra laoreet. Quisque elementum +sollicitudin ullamcorper. + +Examples 4 +`````````` + +Pellentesque mauris sem, malesuada at lobortis in, porta eget +urna. Duis aliquet quam eget risus elementum quis auctor ligula +gravida. Phasellus et ullamcorper libero. Nam elementum ultricies +tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat +tristique lobortis. Suspendisse est enim, tristique eu convallis id, +rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin +hendrerit mi tincidunt dui fermentum placerat. diff --git a/html/_sources/gettingstarted.txt b/html/_sources/gettingstarted.txt new file mode 100644 index 00000000000..247faf96c03 --- /dev/null +++ b/html/_sources/gettingstarted.txt @@ -0,0 +1,67 @@ +Getting Started +=============== + +How to ansible + + +.. seealso:: + + :doc:`YAMLScripts` + Complete documentation of the YAML syntax `ansible` understands. + + +What you need +------------- + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim +placerat nibh, non feugiat risus varius vitae. Donec eu libero +lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in +magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, +dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus +mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae +luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis +ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, +rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies +tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis +egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna +sem. Donec arcu felis, faucibus et malesuada non, blandit vitae +metus. Fusce nec sapien dolor. + +Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, +pretium quis sapien. Duis felis metus, sodales sit amet gravida in, +pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin +eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, +suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada +molestie, nisi nunc placerat libero, vel vulputate elit tellus et +augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat +egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan +lorem eget leo dictum viverra. + +Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean +ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar +quam. Suspendisse nec massa vel augue laoreet ultricies in convallis +dolor. Mauris sodales porta enim, non ultricies dolor luctus +in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, +erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra +arcu sem a ante. Praesent nec metus vestibulum augue eleifend +suscipit. In feugiat, sem nec dignissim consequat, velit tortor +scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh +turpis. Proin ac nisi ligula, a pretium augue. + +In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed +ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, +eget lobortis mi magna sed metus. Cras justo est, tempus quis +adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et +luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae +nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc +sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet +lacus. Maecenas interdum viverra laoreet. Quisque elementum +sollicitudin ullamcorper. + +Pellentesque mauris sem, malesuada at lobortis in, porta eget +urna. Duis aliquet quam eget risus elementum quis auctor ligula +gravida. Phasellus et ullamcorper libero. Nam elementum ultricies +tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat +tristique lobortis. Suspendisse est enim, tristique eu convallis id, +rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin +hendrerit mi tincidunt dui fermentum placerat. diff --git a/html/_sources/index.txt b/html/_sources/index.txt new file mode 100644 index 00000000000..30d8bb14e2c --- /dev/null +++ b/html/_sources/index.txt @@ -0,0 +1,89 @@ +.. Director documentation master file, created by sphinx-quickstart on Sat Sep 27 13:23:22 2008. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Ansible +======= + +Ansible is a extra-simple tool/API for doing 'parallel remote things' +over SSH -- whether executing commands, running "modules", or +executing larger 'playbooks' that can serve as a configuration +management or deployment system. + +While `Func installation `_ which I +co-wrote, aspired to avoid using SSH and have it's own daemon +infrastructure, Ansible aspires to be quite different and more +minimal, but still able to grow more modularly over time. This is +based on talking to a lot of users of various tools and wishing to +eliminate problems with connectivity and long running daemons, or not +picking tool X because they preferred to code in Y. Further, playbooks +take things a whole step further, building the config and deployment +system I always wanted to build. + +Why use Ansible versus something else? (Fabric, Capistrano, +mCollective, Func, SaltStack, etc?) It will have far less code, it +will be more correct, and it will be the easiest thing to hack on and +use you'll ever see -- regardless of your favorite language of choice. +Want to only code plugins in bash or clojure? Ansible doesn't care. +The docs will fit on one page and the source will be blindingly +obvious. + + +Design Principles +````````````````` + +* Dead simple setup +* Super fast & parallel by default +* No server or client daemons; use existing SSHd +* No additional software required on client boxes +* Modules can be written in ANY language +* Awesome API for creating very powerful distributed scripts +* Be usable as non-root +* Create the easiest config management system to use, ever. + + +Requirements +```````````` + +Requirements are extremely minimal. + +If you are running python 2.6 on the **overlord** machine, you will +need: + +* paramiko +* python-jinja2 +* PyYAML (if using playbooks) + +If you are running less than Python 2.6, you will also need + +* the Python 2.4 or 2.5 backport of the multiprocessing module +* simplejson + +On the managed nodes, to use templating, you will need: + +* python-jinja2 (you can install this with ansible) + + + +Contents: + +.. toctree:: + :maxdepth: 3 + + gettingstarted + YAMLScripts + patterns + modules + playbooks + api + communicate + examples + man + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/html/_sources/install.txt b/html/_sources/install.txt new file mode 100644 index 00000000000..6fa077a5490 --- /dev/null +++ b/html/_sources/install.txt @@ -0,0 +1,56 @@ +Install +======= + + +From Yum +-------- + +Taboot is in the Fedora package repositories. Installing it should be as simple as:: + + sudo yum install python-taboot + + +From Source +----------- + +You'll need these dependencies to build/install: + + #. `python `_ - The python programming language along with python-setuptools + #. `distutils `_ - Python building and packaging library + +Building documentation requires some more deps. These are **required** +if you're building RPMs, and optional if you're installing manually: + + #. python-sphinx + #. asciidoc + #. libxslt + + +Building RPMs from source +````````````````````````` + +This is the recommended installation method if you're pulling Taboot +from source:: + + make rpm + sudo yum localinstall /path/to/rpm + + +Installing From source +`````````````````````` + +I **don't** recommend this. But if you're dead set on installing +directly from source you still can. This calls the python +``distutils`` installer directly:: + + sudo make install + +If you wish to build and install the optional documentation you'll +need some additional packages so it can be built fully. Install the +documentation with this command:: + + sudo make installdocs + +Uninstall everything with:: + + sudo make uninstall diff --git a/html/_sources/man.txt b/html/_sources/man.txt new file mode 100644 index 00000000000..6c6497fc930 --- /dev/null +++ b/html/_sources/man.txt @@ -0,0 +1,16 @@ +.. _man: + +Man Pages +========= + +Ansile ships with a handfull of manpages to help you on your journey. + +taboot(1) +--------- + +`View taboot.1 `_ + +taboot-tasks(5) +--------------- + +`View taboot-tasks.5 `_ diff --git a/html/_sources/modules.txt b/html/_sources/modules.txt new file mode 100644 index 00000000000..b303ee6ccb2 --- /dev/null +++ b/html/_sources/modules.txt @@ -0,0 +1,55 @@ +Modules +======= + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim +placerat nibh, non feugiat risus varius vitae. Donec eu libero +lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in +magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, +dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus +mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae +luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis +ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, +rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies +tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis +egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna +sem. Donec arcu felis, faucibus et malesuada non, blandit vitae +metus. Fusce nec sapien dolor. + +Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, +pretium quis sapien. Duis felis metus, sodales sit amet gravida in, +pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin +eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, +suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada +molestie, nisi nunc placerat libero, vel vulputate elit tellus et +augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat +egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan +lorem eget leo dictum viverra. + +Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean +ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar +quam. Suspendisse nec massa vel augue laoreet ultricies in convallis +dolor. Mauris sodales porta enim, non ultricies dolor luctus +in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, +erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra +arcu sem a ante. Praesent nec metus vestibulum augue eleifend +suscipit. In feugiat, sem nec dignissim consequat, velit tortor +scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh +turpis. Proin ac nisi ligula, a pretium augue. + +In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed +ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, +eget lobortis mi magna sed metus. Cras justo est, tempus quis +adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et +luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae +nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc +sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet +lacus. Maecenas interdum viverra laoreet. Quisque elementum +sollicitudin ullamcorper. + +Pellentesque mauris sem, malesuada at lobortis in, porta eget +urna. Duis aliquet quam eget risus elementum quis auctor ligula +gravida. Phasellus et ullamcorper libero. Nam elementum ultricies +tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat +tristique lobortis. Suspendisse est enim, tristique eu convallis id, +rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin +hendrerit mi tincidunt dui fermentum placerat. diff --git a/html/_sources/patterns.txt b/html/_sources/patterns.txt new file mode 100644 index 00000000000..d0ae6b5d37d --- /dev/null +++ b/html/_sources/patterns.txt @@ -0,0 +1,55 @@ +Patterns +======== + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim +placerat nibh, non feugiat risus varius vitae. Donec eu libero +lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in +magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, +dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus +mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae +luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis +ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, +rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies +tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis +egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna +sem. Donec arcu felis, faucibus et malesuada non, blandit vitae +metus. Fusce nec sapien dolor. + +Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, +pretium quis sapien. Duis felis metus, sodales sit amet gravida in, +pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin +eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, +suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada +molestie, nisi nunc placerat libero, vel vulputate elit tellus et +augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat +egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan +lorem eget leo dictum viverra. + +Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean +ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar +quam. Suspendisse nec massa vel augue laoreet ultricies in convallis +dolor. Mauris sodales porta enim, non ultricies dolor luctus +in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, +erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra +arcu sem a ante. Praesent nec metus vestibulum augue eleifend +suscipit. In feugiat, sem nec dignissim consequat, velit tortor +scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh +turpis. Proin ac nisi ligula, a pretium augue. + +In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed +ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, +eget lobortis mi magna sed metus. Cras justo est, tempus quis +adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et +luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae +nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc +sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet +lacus. Maecenas interdum viverra laoreet. Quisque elementum +sollicitudin ullamcorper. + +Pellentesque mauris sem, malesuada at lobortis in, porta eget +urna. Duis aliquet quam eget risus elementum quis auctor ligula +gravida. Phasellus et ullamcorper libero. Nam elementum ultricies +tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat +tristique lobortis. Suspendisse est enim, tristique eu convallis id, +rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin +hendrerit mi tincidunt dui fermentum placerat. diff --git a/html/_sources/playbooks.txt b/html/_sources/playbooks.txt new file mode 100644 index 00000000000..677403b5bc6 --- /dev/null +++ b/html/_sources/playbooks.txt @@ -0,0 +1,55 @@ +Playbooks +========= + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In dignissim +placerat nibh, non feugiat risus varius vitae. Donec eu libero +lectus. Ut non orci felis, eget mattis mauris. Etiam ut tellus in +magna porta venenatis. Quisque scelerisque, sem non ultrices bibendum, +dolor diam rutrum lectus, sed luctus neque neque vitae eros. Vivamus +mattis, ipsum ut bibendum gravida, lectus arcu venenatis elit, vitae +luctus diam leo sit amet ligula. Nunc egestas justo in nulla sagittis +ut suscipit sapien gravida. Morbi id dui nibh. Nullam diam massa, +rhoncus a dignissim non, adipiscing vel arcu. Quisque ultricies +tincidunt purus ut sodales. Quisque scelerisque dapibus purus quis +egestas. Maecenas sagittis porttitor adipiscing. Duis eu magna +sem. Donec arcu felis, faucibus et malesuada non, blandit vitae +metus. Fusce nec sapien dolor. + +Aenean ac fermentum nisl. Integer leo sem, rutrum nec dictum at, +pretium quis sapien. Duis felis metus, sodales sit amet gravida in, +pretium ut arcu. Nulla ligula quam, aliquam sit amet sollicitudin +eget, molestie tincidunt ipsum. Nulla leo nunc, mattis sed auctor at, +suscipit ut metus. Suspendisse hendrerit, justo sagittis malesuada +molestie, nisi nunc placerat libero, vel vulputate elit tellus et +augue. Phasellus tempor lectus ac nisi aliquam faucibus. Donec feugiat +egestas nibh id mattis. In hac habitasse platea dictumst. Ut accumsan +lorem eget leo dictum viverra. + +Quisque egestas lorem sit amet felis tincidunt adipiscing. Aenean +ornare fermentum accumsan. Aenean eu mauris arcu, id pulvinar +quam. Suspendisse nec massa vel augue laoreet ultricies in convallis +dolor. Mauris sodales porta enim, non ultricies dolor luctus +in. Phasellus eu tortor lectus, vel porttitor nulla. Mauris vulputate, +erat id scelerisque lobortis, nibh ipsum tristique elit, ac viverra +arcu sem a ante. Praesent nec metus vestibulum augue eleifend +suscipit. In feugiat, sem nec dignissim consequat, velit tortor +scelerisque metus, sit amet mollis nisl sem eu nibh. Quisque in nibh +turpis. Proin ac nisi ligula, a pretium augue. + +In nibh eros, laoreet id interdum vel, sodales sed tortor. Sed +ullamcorper, sem vel mattis consectetur, nibh turpis molestie nisl, +eget lobortis mi magna sed metus. Cras justo est, tempus quis +adipiscing ut, hendrerit convallis sem. Mauris ullamcorper, sapien et +luctus iaculis, urna elit egestas ipsum, et tristique enim risus vitae +nunc. Vivamus aliquet lorem eu urna pulvinar hendrerit malesuada nunc +sollicitudin. Cras in mi rhoncus quam egestas dignissim vel sit amet +lacus. Maecenas interdum viverra laoreet. Quisque elementum +sollicitudin ullamcorper. + +Pellentesque mauris sem, malesuada at lobortis in, porta eget +urna. Duis aliquet quam eget risus elementum quis auctor ligula +gravida. Phasellus et ullamcorper libero. Nam elementum ultricies +tellus, in sagittis magna aliquet quis. Ut sit amet tellus id erat +tristique lobortis. Suspendisse est enim, tristique eu convallis id, +rutrum nec lacus. Fusce iaculis diam non felis rutrum lobortis. Proin +hendrerit mi tincidunt dui fermentum placerat. diff --git a/html/_sources/tasks.txt b/html/_sources/tasks.txt new file mode 100644 index 00000000000..bf644a9174f --- /dev/null +++ b/html/_sources/tasks.txt @@ -0,0 +1,16 @@ +.. _tasks: + +Tasks +----- + +All the built-in tasks are documented here. + +.. include:: tasks/command.rst +.. include:: tasks/service.rst +.. include:: tasks/puppet.rst +.. include:: tasks/nagios.rst +.. include:: tasks/sleep.rst +.. include:: tasks/yum.rst +.. include:: tasks/rpm.rst +.. include:: tasks/mod_jk.rst +.. include:: tasks/misc.rst diff --git a/html/_static/basic.css b/html/_static/basic.css new file mode 100644 index 00000000000..32630d54c9f --- /dev/null +++ b/html/_static/basic.css @@ -0,0 +1,528 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +img { + border: 0; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable dl, table.indextable dd { + margin-top: 0; + margin-bottom: 0; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- general body styles --------------------------------------------------- */ + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.field-list ul { + padding-left: 1em; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + clear: both; + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.field-list td, table.field-list th { + border: 0 !important; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, .highlighted { + background-color: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.refcount { + color: #060; +} + +.optional { + font-size: 1.3em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +tt.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +tt.descclassname { + background-color: transparent; +} + +tt.xref, a tt { + background-color: transparent; + font-weight: bold; +} + +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} diff --git a/html/_static/default.css b/html/_static/default.css new file mode 100644 index 00000000000..21f3f5098d7 --- /dev/null +++ b/html/_static/default.css @@ -0,0 +1,256 @@ +/* + * default.css_t + * ~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- default theme. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: sans-serif; + font-size: 100%; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + background-color: #1c4e63; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +div.body { + background-color: #ffffff; + color: #000000; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #133f52; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { +} + +div.sphinxsidebar h3 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar h4 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #ffffff; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #ffffff; +} + +div.sphinxsidebar a { + color: #98dbcc; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + + + +/* -- hyperlink styles ------------------------------------------------------ */ + +a { + color: #355f7c; + text-decoration: none; +} + +a:visited { + color: #355f7c; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + + + +/* -- body styles ----------------------------------------------------------- */ + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Trebuchet MS', sans-serif; + background-color: #f2f2f2; + font-weight: normal; + color: #20435c; + border-bottom: 1px solid #ccc; + margin: 20px -20px 10px -20px; + padding: 3px 0 3px 10px; +} + +div.body h1 { margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 160%; } +div.body h3 { font-size: 140%; } +div.body h4 { font-size: 120%; } +div.body h5 { font-size: 110%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li { + text-align: justify; + line-height: 130%; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.admonition p { + margin-bottom: 5px; +} + +div.admonition pre { + margin-bottom: 5px; +} + +div.admonition ul, div.admonition ol { + margin-bottom: 5px; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 5px; + background-color: #eeffcc; + color: #333333; + line-height: 120%; + border: 1px solid #ac9; + border-left: none; + border-right: none; +} + +tt { + background-color: #ecf0f3; + padding: 0 1px 0 1px; + font-size: 0.95em; +} + +th { + background-color: #ede; +} + +.warning tt { + background: #efc2c2; +} + +.note tt { + background: #d6d6d6; +} + +.viewcode-back { + font-family: sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} \ No newline at end of file diff --git a/html/_static/doctools.js b/html/_static/doctools.js new file mode 100644 index 00000000000..8b9bd2c0e9c --- /dev/null +++ b/html/_static/doctools.js @@ -0,0 +1,247 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for all documentation. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +} + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s == 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * small function to check if an array contains + * a given item. + */ +jQuery.contains = function(arr, item) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] == item) + return true; + } + return false; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node) { + if (node.nodeType == 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { + var span = document.createElement("span"); + span.className = className; + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this); + }); + } + } + return this.each(function() { + highlight(this); + }); +}; + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated == 'undefined') + return string; + return (typeof translated == 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated == 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('') + .appendTo($('.sidebar .this-page-menu')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) == 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this == '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); diff --git a/html/_static/file.png b/html/_static/file.png new file mode 100644 index 0000000000000000000000000000000000000000..d18082e397e7e54f20721af768c4c2983258f1b4 GIT binary patch literal 392 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP$HyOL$D9)yc9|lc|nKf<9@eUiWd>3GuTC!a5vdfWYEazjncPj5ZQX%+1 zt8B*4=d)!cdDz4wr^#OMYfqGz$1LDFF>|#>*O?AGil(WEs?wLLy{Gj2J_@opDm%`dlax3yA*@*N$G&*ukFv>P8+2CBWO(qz zD0k1@kN>hhb1_6`&wrCswzINE(evt-5C1B^STi2@PmdKI;Vst0PQB6!2kdN literal 0 HcmV?d00001 diff --git a/html/_static/jquery.js b/html/_static/jquery.js new file mode 100644 index 00000000000..7c243080233 --- /dev/null +++ b/html/_static/jquery.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, +CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, +text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, +setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== +"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, +serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), +function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, +global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| +c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/html/_static/minus.png b/html/_static/minus.png new file mode 100644 index 0000000000000000000000000000000000000000..da1c5620d10c047525a467a425abe9ff5269cfc2 GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^+#t-s1SHkYJtzcHoCO|{#XvD(5N2eUHAey{$X?>< z>&kweokM_|(Po{+Q=kw>iEBiObAE1aYF-J$w=>iB1I2R$WLpMkF=>bh=@O1TaS?83{1OVknK< z>&kweokM`jkU7Va11Q8%;u=xnoS&PUnpeW`?aZ|OK(QcC7sn8Z%gHvy&v=;Q4jejg zV8NnAO`-4Z@2~&zopr02WF_WB>pF literal 0 HcmV?d00001 diff --git a/html/_static/pygments.css b/html/_static/pygments.css new file mode 100644 index 00000000000..1a14f2ae1ab --- /dev/null +++ b/html/_static/pygments.css @@ -0,0 +1,62 @@ +.highlight .hll { background-color: #ffffcc } +.highlight { background: #eeffcc; } +.highlight .c { color: #408090; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #303030 } /* Generic.Output */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0040D0 } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #208050 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #208050 } /* Literal.Number.Float */ +.highlight .mh { color: #208050 } /* Literal.Number.Hex */ +.highlight .mi { color: #208050 } /* Literal.Number.Integer */ +.highlight .mo { color: #208050 } /* Literal.Number.Oct */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/html/_static/searchtools.js b/html/_static/searchtools.js new file mode 100644 index 00000000000..dae92b5e5a6 --- /dev/null +++ b/html/_static/searchtools.js @@ -0,0 +1,518 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for the full-text search. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words, hlwords is the list of normal, unstemmed + * words. the first one is used to find the occurance, the + * latter for highlighting it. + */ + +jQuery.makeSearchSummary = function(text, keywords, hlwords) { + var textLower = text.toLowerCase(); + var start = 0; + $.each(keywords, function() { + var i = textLower.indexOf(this.toLowerCase()); + if (i > -1) + start = i; + }); + start = Math.max(start - 120, 0); + var excerpt = ((start > 0) ? '...' : '') + + $.trim(text.substr(start, 240)) + + ((start + 240 - text.length) ? '...' : ''); + var rv = $('
').text(excerpt); + $.each(hlwords, function() { + rv = rv.highlightText(this, 'highlighted'); + }); + return rv; +} + +/** + * Porter Stemmer + */ +var PorterStemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + + +/** + * Search Module + */ +var Search = { + + _index : null, + _queued_query : null, + _pulse_status : -1, + + init : function() { + var params = $.getQueryParameters(); + if (params.q) { + var query = params.q[0]; + $('input[name="q"]')[0].value = query; + this.performSearch(query); + } + }, + + loadIndex : function(url) { + $.ajax({type: "GET", url: url, data: null, success: null, + dataType: "script", cache: true}); + }, + + setIndex : function(index) { + var q; + this._index = index; + if ((q = this._queued_query) !== null) { + this._queued_query = null; + Search.query(q); + } + }, + + hasIndex : function() { + return this._index !== null; + }, + + deferQuery : function(query) { + this._queued_query = query; + }, + + stopPulse : function() { + this._pulse_status = 0; + }, + + startPulse : function() { + if (this._pulse_status >= 0) + return; + function pulse() { + Search._pulse_status = (Search._pulse_status + 1) % 4; + var dotString = ''; + for (var i = 0; i < Search._pulse_status; i++) + dotString += '.'; + Search.dots.text(dotString); + if (Search._pulse_status > -1) + window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something + */ + performSearch : function(query) { + // create the required interface elements + this.out = $('#search-results'); + this.title = $('

' + _('Searching') + '

').appendTo(this.out); + this.dots = $('').appendTo(this.title); + this.status = $('

').appendTo(this.out); + this.output = $('