[pywps] 05/08: Imported Upstream version 4.0.0~rc2+ds
Bas Couwenberg
sebastic at debian.org
Sun Sep 4 13:44:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch experimental
in repository pywps.
commit 032143c4607d601bddc2d9bedc9ecc67c8ad01aa
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Sun Sep 4 10:56:08 2016 +0200
Imported Upstream version 4.0.0~rc2+ds
---
docs/_build/doctrees/api.doctree | Bin 139472 -> 0 bytes
docs/_build/doctrees/configuration.doctree | Bin 46056 -> 0 bytes
docs/_build/doctrees/deployment.doctree | Bin 30060 -> 0 bytes
docs/_build/doctrees/development.doctree | Bin 25259 -> 0 bytes
docs/_build/doctrees/environment.pickle | Bin 342716 -> 0 bytes
docs/_build/doctrees/exceptions.doctree | Bin 24153 -> 0 bytes
docs/_build/doctrees/external_tools.doctree | Bin 3682 -> 0 bytes
docs/_build/doctrees/index.doctree | Bin 11006 -> 0 bytes
docs/_build/doctrees/install.doctree | Bin 18095 -> 0 bytes
docs/_build/doctrees/migration.doctree | Bin 2578 -> 0 bytes
docs/_build/doctrees/process.doctree | Bin 89444 -> 0 bytes
docs/_build/doctrees/pywps.doctree | Bin 12328 -> 0 bytes
docs/_build/doctrees/wps.doctree | Bin 58230 -> 0 bytes
docs/_build/html/.buildinfo | 4 -
docs/_build/html/_modules/index.html | 104 -
docs/_build/html/_modules/pywps/app/Process.html | 491 -
.../_build/html/_modules/pywps/app/WPSRequest.html | 736 --
.../html/_modules/pywps/app/WPSResponse.html | 309 -
docs/_build/html/_modules/pywps/exceptions.html | 255 -
docs/_build/html/_modules/pywps/inout/basic.html | 724 --
docs/_build/html/_modules/pywps/inout/formats.html | 295 -
docs/_build/html/_modules/pywps/inout/inputs.html | 466 -
.../html/_modules/pywps/inout/literaltypes.html | 414 -
docs/_build/html/_modules/pywps/inout/outputs.html | 388 -
.../_modules/pywps/validator/complexvalidator.html | 361 -
.../_build/html/_modules/pywps/validator/mode.html | 106 -
docs/_build/html/_sources/api.txt | 101 -
docs/_build/html/_sources/configuration.txt | 196 -
docs/_build/html/_sources/deployment.txt | 168 -
docs/_build/html/_sources/development.txt | 120 -
docs/_build/html/_sources/exceptions.txt | 29 -
docs/_build/html/_sources/external_tools.txt | 10 -
docs/_build/html/_sources/index.txt | 54 -
docs/_build/html/_sources/install.txt | 81 -
docs/_build/html/_sources/migration.txt | 5 -
docs/_build/html/_sources/process.txt | 395 -
docs/_build/html/_sources/pywps.txt | 46 -
docs/_build/html/_sources/wps.txt | 228 -
docs/_build/html/_static/ajax-loader.gif | Bin 673 -> 0 bytes
docs/_build/html/_static/basic.css | 599 --
docs/_build/html/_static/classic.css | 261 -
docs/_build/html/_static/comment-bright.png | Bin 3500 -> 0 bytes
docs/_build/html/_static/comment-close.png | Bin 3578 -> 0 bytes
docs/_build/html/_static/comment.png | Bin 3445 -> 0 bytes
docs/_build/html/_static/default.css | 1 -
docs/_build/html/_static/doctools.js | 263 -
docs/_build/html/_static/down-pressed.png | Bin 347 -> 0 bytes
docs/_build/html/_static/down.png | Bin 347 -> 0 bytes
docs/_build/html/_static/file.png | Bin 358 -> 0 bytes
docs/_build/html/_static/jquery.js | 10351 -------------------
docs/_build/html/_static/minus.png | Bin 173 -> 0 bytes
docs/_build/html/_static/plus.png | Bin 173 -> 0 bytes
docs/_build/html/_static/pygments.css | 65 -
docs/_build/html/_static/pywps.png | Bin 135853 -> 0 bytes
docs/_build/html/_static/searchtools.js | 651 --
docs/_build/html/_static/sidebar.js | 159 -
docs/_build/html/_static/underscore.js | 1415 ---
docs/_build/html/_static/up-pressed.png | Bin 345 -> 0 bytes
docs/_build/html/_static/up.png | Bin 345 -> 0 bytes
docs/_build/html/_static/websupport.js | 808 --
docs/_build/html/api.html | 604 --
docs/_build/html/configuration.html | 340 -
docs/_build/html/deployment.html | 322 -
docs/_build/html/development.html | 232 -
docs/_build/html/exceptions.html | 166 -
docs/_build/html/external_tools.html | 138 -
docs/_build/html/genindex.html | 430 -
docs/_build/html/index.html | 227 -
docs/_build/html/install.html | 205 -
docs/_build/html/migration.html | 123 -
docs/_build/html/objects.inv | Bin 874 -> 0 bytes
docs/_build/html/process.html | 651 --
docs/_build/html/py-modindex.html | 118 -
docs/_build/html/pywps.html | 169 -
docs/_build/html/search.html | 109 -
docs/_build/html/searchindex.js | 1 -
docs/_build/html/wps.html | 354 -
77 files changed, 24848 deletions(-)
diff --git a/docs/_build/doctrees/api.doctree b/docs/_build/doctrees/api.doctree
deleted file mode 100644
index dd66ba6..0000000
Binary files a/docs/_build/doctrees/api.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/configuration.doctree b/docs/_build/doctrees/configuration.doctree
deleted file mode 100644
index 8065e31..0000000
Binary files a/docs/_build/doctrees/configuration.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/deployment.doctree b/docs/_build/doctrees/deployment.doctree
deleted file mode 100644
index 8f7f11c..0000000
Binary files a/docs/_build/doctrees/deployment.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/development.doctree b/docs/_build/doctrees/development.doctree
deleted file mode 100644
index d2b5bfd..0000000
Binary files a/docs/_build/doctrees/development.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle
deleted file mode 100644
index 4bdcc67..0000000
Binary files a/docs/_build/doctrees/environment.pickle and /dev/null differ
diff --git a/docs/_build/doctrees/exceptions.doctree b/docs/_build/doctrees/exceptions.doctree
deleted file mode 100644
index cddfbb6..0000000
Binary files a/docs/_build/doctrees/exceptions.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/external_tools.doctree b/docs/_build/doctrees/external_tools.doctree
deleted file mode 100644
index b846dc7..0000000
Binary files a/docs/_build/doctrees/external_tools.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree
deleted file mode 100644
index a0d56f6..0000000
Binary files a/docs/_build/doctrees/index.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/install.doctree b/docs/_build/doctrees/install.doctree
deleted file mode 100644
index 69b78f3..0000000
Binary files a/docs/_build/doctrees/install.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/migration.doctree b/docs/_build/doctrees/migration.doctree
deleted file mode 100644
index 2f2b039..0000000
Binary files a/docs/_build/doctrees/migration.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/process.doctree b/docs/_build/doctrees/process.doctree
deleted file mode 100644
index 6e5199f..0000000
Binary files a/docs/_build/doctrees/process.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/pywps.doctree b/docs/_build/doctrees/pywps.doctree
deleted file mode 100644
index a2d0692..0000000
Binary files a/docs/_build/doctrees/pywps.doctree and /dev/null differ
diff --git a/docs/_build/doctrees/wps.doctree b/docs/_build/doctrees/wps.doctree
deleted file mode 100644
index a09fe69..0000000
Binary files a/docs/_build/doctrees/wps.doctree and /dev/null differ
diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo
deleted file mode 100644
index 12b4932..0000000
--- a/docs/_build/html/.buildinfo
+++ /dev/null
@@ -1,4 +0,0 @@
-# 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: 701a737652e562c2360dcb914c990cf8
-tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/_build/html/_modules/index.html b/docs/_build/html/_modules/index.html
deleted file mode 100644
index 7aedcec..0000000
--- a/docs/_build/html/_modules/index.html
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Overview: module code — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../_static/jquery.js"></script>
- <script type="text/javascript" src="../_static/underscore.js"></script>
- <script type="text/javascript" src="../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>All modules for which code is available</h1>
-<ul><li><a href="pywps/app/Process.html">pywps.app.Process</a></li>
-<li><a href="pywps/app/WPSRequest.html">pywps.app.WPSRequest</a></li>
-<li><a href="pywps/app/WPSResponse.html">pywps.app.WPSResponse</a></li>
-<li><a href="pywps/exceptions.html">pywps.exceptions</a></li>
-<li><a href="pywps/inout/basic.html">pywps.inout.basic</a></li>
-<li><a href="pywps/inout/formats.html">pywps.inout.formats</a></li>
-<li><a href="pywps/inout/inputs.html">pywps.inout.inputs</a></li>
-<li><a href="pywps/inout/literaltypes.html">pywps.inout.literaltypes</a></li>
-<li><a href="pywps/inout/outputs.html">pywps.inout.outputs</a></li>
-<li><a href="pywps/validator/complexvalidator.html">pywps.validator.complexvalidator</a></li>
-<li><a href="pywps/validator/mode.html">pywps.validator.mode</a></li>
-</ul>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../index.html">
- <img class="logo" src="../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/app/Process.html b/docs/_build/html/_modules/pywps/app/Process.html
deleted file mode 100644
index 72815c4..0000000
--- a/docs/_build/html/_modules/pywps/app/Process.html
+++ /dev/null
@@ -1,491 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.app.Process — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../../index.html" />
- <link rel="up" title="Module code" href="../../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.app.Process</h1><div class="highlight"><pre>
-<span class="c1">###############################################################################</span>
-<span class="c1">#</span>
-<span class="c1"># Copyright (C) 2014-2016 PyWPS Development Team, represented by</span>
-<span class="c1"># PyWPS Project Steering Committee</span>
-<span class="c1">#</span>
-<span class="c1"># Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="c1"># of this software and associated documentation files (the "Software"), to</span>
-<span class="c1"># deal in the Software without restriction, including without limitation the</span>
-<span class="c1"># rights to use, copy, modify, merge, publish, distribute, sublicense, and/or</span>
-<span class="c1"># sell copies of the Software, and to permit persons to whom the Software is</span>
-<span class="c1"># furnished to do so, subject to the following conditions:</span>
-<span class="c1">#</span>
-<span class="c1"># The above copyright notice and this permission notice shall be included in</span>
-<span class="c1"># all copies or substantial portions of the Software.</span>
-<span class="c1">#</span>
-<span class="c1"># THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="c1"># IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="c1"># FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="c1"># AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="c1"># LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
-<span class="c1"># FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS</span>
-<span class="c1"># IN THE SOFTWARE.</span>
-<span class="c1">#</span>
-<span class="c1">###############################################################################</span>
-
-<span class="kn">import</span> <span class="nn">logging</span>
-<span class="kn">import</span> <span class="nn">os</span>
-<span class="kn">import</span> <span class="nn">sys</span>
-<span class="kn">import</span> <span class="nn">traceback</span>
-<span class="kn">import</span> <span class="nn">json</span>
-<span class="kn">import</span> <span class="nn">shutil</span>
-<span class="kn">import</span> <span class="nn">tempfile</span>
-
-<span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">WPS</span><span class="p">,</span> <span class="n">OWS</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">dblog</span>
-<span class="kn">from</span> <span class="nn">pywps.app.WPSResponse</span> <span class="kn">import</span> <span class="n">WPSResponse</span>
-<span class="kn">from</span> <span class="nn">pywps.app.WPSResponse</span> <span class="kn">import</span> <span class="n">STATUS</span>
-<span class="kn">from</span> <span class="nn">pywps.app.WPSRequest</span> <span class="kn">import</span> <span class="n">WPSRequest</span>
-<span class="kn">import</span> <span class="nn">pywps.configuration</span> <span class="kn">as</span> <span class="nn">config</span>
-<span class="kn">from</span> <span class="nn">pywps._compat</span> <span class="kn">import</span> <span class="n">PY2</span>
-<span class="kn">from</span> <span class="nn">pywps.exceptions</span> <span class="kn">import</span> <span class="n">StorageNotSupported</span><span class="p">,</span> <span class="n">OperationNotSupported</span><span class="p">,</span> \
- <span class="n">ServerBusy</span><span class="p">,</span> <span class="n">NoApplicableCode</span>
-
-
-<span class="n">LOGGER</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"PYWPS"</span><span class="p">)</span>
-
-<div class="viewcode-block" id="Process"><a class="viewcode-back" href="../../../api.html#pywps.Process">[docs]</a><span class="k">class</span> <span class="nc">Process</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> :param handler: A callable that gets invoked for each incoming</span>
-<span class="sd"> request. It should accept a single</span>
-<span class="sd"> :class:`pywps.app.WPSRequest` argument and return a</span>
-<span class="sd"> :class:`pywps.app.WPSResponse` object.</span>
-<span class="sd"> :param identifier: Name of this process.</span>
-<span class="sd"> :param inputs: List of inputs accepted by this process. They</span>
-<span class="sd"> should be :class:`~LiteralInput` and :class:`~ComplexInput`</span>
-<span class="sd"> and :class:`~BoundingBoxInput`</span>
-<span class="sd"> objects.</span>
-<span class="sd"> :param outputs: List of outputs returned by this process. They</span>
-<span class="sd"> should be :class:`~LiteralOutput` and :class:`~ComplexOutput`</span>
-<span class="sd"> and :class:`~BoundingBoxOutput`</span>
-<span class="sd"> objects.</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="s1">''</span><span class="p">,</span> <span class="n">profile</span><span class="o">=</span><span class="p">[] [...]
- <span class="n">outputs</span><span class="o">=</span><span class="p">[],</span> <span class="n">version</span><span class="o">=</span><span class="s1">'None'</span><span class="p">,</span> <span class="n">store_supported</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">status_supported</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">grass_location</span><span c [...]
- <span class="bp">self</span><span class="o">.</span><span class="n">identifier</span> <span class="o">=</span> <span class="n">identifier</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">handler</span> <span class="o">=</span> <span class="n">handler</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">title</span> <span class="o">=</span> <span class="n">title</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span> <span class="o">=</span> <span class="n">abstract</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="n">metadata</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">profile</span> <span class="o">=</span> <span class="n">profile</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">version</span> <span class="o">=</span> <span class="n">version</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">inputs</span> <span class="o">=</span> <span class="n">inputs</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">outputs</span> <span class="o">=</span> <span class="n">outputs</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">uuid</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">status_location</span> <span class="o">=</span> <span class="s1">''</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">status_url</span> <span class="o">=</span> <span class="s1">''</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_grass_mapset</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">grass_location</span> <span class="o">=</span> <span class="n">grass_location</span>
-
-
- <span class="k">if</span> <span class="n">store_supported</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">store_supported</span> <span class="o">=</span> <span class="s1">'true'</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">store_supported</span> <span class="o">=</span> <span class="s1">'false'</span>
-
- <span class="k">if</span> <span class="n">status_supported</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">status_supported</span> <span class="o">=</span> <span class="s1">'true'</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">status_supported</span> <span class="o">=</span> <span class="s1">'false'</span>
-
-
-
- <span class="k">def</span> <span class="nf">capabilities_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Process</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
- <span class="c1"># TODO: See Table 32 Metadata in OGC 06-121r3</span>
- <span class="c1">#for m in self.metadata:</span>
- <span class="c1"># doc.append(OWS.Metadata(m))</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">profile</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Profile</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">profile</span><span class="p">))</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">version</span> <span class="o">!=</span> <span class="s1">'None'</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{http://www.opengis.net/wps/1.0.0}processVersion'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">version</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{http://www.opengis.net/wps/1.0.0}processVersion'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'undefined'</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">describe_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">input_elements</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">()</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">inputs</span><span class="p">]</span>
- <span class="n">output_elements</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">()</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">outputs</span><span class="p">]</span>
-
- <span class="n">doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">ProcessDescription</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{http://www.opengis.net/wps/1.0.0}processVersion'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">version</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">store_supported</span> <span class="o">==</span> <span class="s1">'true'</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'storeSupported'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">store_supported</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status_supported</span> <span class="o">==</span> <span class="s1">'true'</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'statusSupported'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">status_supported</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Metadata</span><span class="p">({</span><span class="s1">'{http://www.w3.org/1999/xlink}title'</span><span class="p">:</span> <span class="n">m</span><span class="p">}))</span>
-
- <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">profile</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">WPS</span><span class="o">.</span><span class="n">Profile</span><span class="p">(</span><span class="n">p</span><span class="p">))</span>
-
- <span class="k">if</span> <span class="n">input_elements</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">E</span><span class="o">.</span><span class="n">DataInputs</span><span class="p">(</span><span class="o">*</span><span class="n">input_elements</span><span class="p">))</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">E</span><span class="o">.</span><span class="n">ProcessOutputs</span><span class="p">(</span><span class="o">*</span><span class="n">output_elements</span><span class="p">))</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">execute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wps_request</span><span class="p">,</span> <span class="n">uuid</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_set_uuid</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">async</span> <span class="o">=</span> <span class="bp">False</span>
- <span class="n">wps_response</span> <span class="o">=</span> <span class="n">WPSResponse</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wps_request</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">uuid</span><span class="p">)</span>
-
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">'Check if status storage and updating are supported by this process'</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">wps_request</span><span class="o">.</span><span class="n">store_execute</span> <span class="o">==</span> <span class="s1">'true'</span><span class="p">:</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">store_supported</span> <span class="o">!=</span> <span class="s1">'true'</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">StorageNotSupported</span><span class="p">(</span><span class="s1">'Process does not support the storing of the execute response'</span><span class="p">)</span>
-
-
- <span class="k">if</span> <span class="n">wps_request</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="s1">'true'</span><span class="p">:</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status_supported</span> <span class="o">!=</span> <span class="s1">'true'</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">OperationNotSupported</span><span class="p">(</span><span class="s1">'Process does not support the updating of status'</span><span class="p">)</span>
-
- <span class="n">wps_response</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">STATUS</span><span class="o">.</span><span class="n">STORE_AND_UPDATE_STATUS</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">async</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">wps_response</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">STATUS</span><span class="o">.</span><span class="n">STORE_STATUS</span>
-
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">'Check if updating of status is not required then no need to spawn a process'</span><span class="p">)</span>
-
- <span class="n">wps_response</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_execute_process</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">async</span><span class="p">,</span> <span class="n">wps_request</span><span class="p">,</span> <span class="n">wps_response</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">wps_response</span>
-
- <span class="k">def</span> <span class="nf">_set_uuid</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">uuid</span><span class="p">):</span>
- <span class="sd">"""Set uuid and status ocation apth and url</span>
-<span class="sd"> """</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">uuid</span> <span class="o">=</span> <span class="n">uuid</span>
-
- <span class="n">file_path</span> <span class="o">=</span> <span class="n">config</span><span class="o">.</span><span class="n">get_config_value</span><span class="p">(</span><span class="s1">'server'</span><span class="p">,</span> <span class="s1">'outputpath'</span><span class="p">)</span>
-
- <span class="n">file_url</span> <span class="o">=</span> <span class="n">config</span><span class="o">.</span><span class="n">get_config_value</span><span class="p">(</span><span class="s1">'server'</span><span class="p">,</span> <span class="s1">'outputurl'</span><span class="p">)</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">status_location</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">file_path</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">uuid</span><span class="p">))</span> <spa [...]
- <span class="bp">self</span><span class="o">.</span><span class="n">status_url</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">file_url</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">uuid</span><span class="p">))</span> <span clas [...]
-
- <span class="k">def</span> <span class="nf">_execute_process</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">async</span><span class="p">,</span> <span class="n">wps_request</span><span class="p">,</span> <span class="n">wps_response</span><span class="p">):</span>
- <span class="sd">"""Uses :module:`multiprocessing` module for sending process to</span>
-<span class="sd"> background BUT first, check for maxprocesses configuration value</span>
-
-<span class="sd"> :param async: run in asynchronous mode</span>
-<span class="sd"> :return: wps_response or None</span>
-<span class="sd"> """</span>
-
- <span class="n">maxparalel</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">config</span><span class="o">.</span><span class="n">get_config_value</span><span class="p">(</span><span class="s1">'server'</span><span class="p">,</span> <span class="s1">'parallelprocesses'</span><span class="p">))</span>
- <span class="n">running</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">dblog</span><span class="o">.</span><span class="n">get_running</span><span class="p">())</span>
- <span class="n">stored</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">dblog</span><span class="o">.</span><span class="n">get_stored</span><span class="p">())</span>
-
- <span class="c1"># async</span>
- <span class="k">if</span> <span class="n">async</span><span class="p">:</span>
-
- <span class="c1"># run immedietly</span>
- <span class="k">if</span> <span class="n">running</span> <span class="o"><</span> <span class="n">maxparalel</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_run_async</span><span class="p">(</span><span class="n">wps_request</span><span class="p">,</span> <span class="n">wps_response</span><span class="p">)</span>
-
- <span class="c1"># try to store for later usage</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">wps_response</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_store_process</span><span class="p">(</span><span class="n">stored</span><span class="p">,</span>
- <span class="n">wps_request</span><span class="p">,</span> <span class="n">wps_response</span><span class="p">)</span>
-
- <span class="c1"># not async</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">if</span> <span class="n">running</span> <span class="o"><</span> <span class="n">maxparalel</span><span class="p">:</span>
- <span class="n">wps_response</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_run_process</span><span class="p">(</span><span class="n">wps_request</span><span class="p">,</span> <span class="n">wps_response</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">ServerBusy</span><span class="p">(</span><span class="s1">'Maximum number of parallel running processes reached. Please try later.'</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">wps_response</span>
-
- <span class="k">def</span> <span class="nf">_run_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wps_request</span><span class="p">,</span> <span class="n">wps_response</span><span class="p">):</span>
- <span class="kn">import</span> <span class="nn">multiprocessing</span>
- <span class="n">process</span> <span class="o">=</span> <span class="n">multiprocessing</span><span class="o">.</span><span class="n">Process</span><span class="p">(</span>
- <span class="n">target</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_run_process</span><span class="p">,</span>
- <span class="n">args</span><span class="o">=</span><span class="p">(</span><span class="n">wps_request</span><span class="p">,</span> <span class="n">wps_response</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="n">process</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
-
-
- <span class="k">def</span> <span class="nf">_store_process</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">stored</span><span class="p">,</span> <span class="n">wps_request</span><span class="p">,</span> <span class="n">wps_response</span><span class="p">):</span>
- <span class="sd">"""Try to store given requests</span>
-<span class="sd"> """</span>
-
- <span class="n">maxprocesses</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">config</span><span class="o">.</span><span class="n">get_config_value</span><span class="p">(</span><span class="s1">'server'</span><span class="p">,</span> <span class="s1">'maxprocesses'</span><span class="p">))</span>
-
- <span class="k">if</span> <span class="n">stored</span> <span class="o"><</span> <span class="n">maxprocesses</span><span class="p">:</span>
- <span class="n">dblog</span><span class="o">.</span><span class="n">store_process</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">uuid</span><span class="p">,</span> <span class="n">wps_request</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">ServerBusy</span><span class="p">(</span><span class="s1">'Maximum number of parallel running processes reached. Please try later.'</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">wps_response</span>
-
- <span class="k">def</span> <span class="nf">_run_process</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wps_request</span><span class="p">,</span> <span class="n">wps_response</span><span class="p">):</span>
- <span class="k">try</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_set_grass</span><span class="p">()</span>
- <span class="n">wps_response</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">handler</span><span class="p">(</span><span class="n">wps_request</span><span class="p">,</span> <span class="n">wps_response</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="p">(</span><span class="ow">not</span> <span class="n">wps_response</span><span class="o">.</span><span class="n">status_percentage</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="n">wps_response</span><span class="o">.</span><span class="n">status_percentage</span> <span class="o">!=</span> <span class="mi">100</span><span class="p">):</span>
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">'Updating process status to 100</span><span class="si">% i</span><span class="s1">f everything went correctly'</span><span class="p">)</span>
- <span class="n">wps_response</span><span class="o">.</span><span class="n">update_status</span><span class="p">(</span><span class="s1">'PyWPS Process finished'</span><span class="p">,</span> <span class="mi">100</span><span class="p">,</span>
- <span class="n">STATUS</span><span class="o">.</span><span class="n">DONE_STATUS</span><span class="p">,</span> <span class="n">clean</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">async</span><span class="p">)</span>
- <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
- <span class="n">traceback</span><span class="o">.</span><span class="n">print_exc</span><span class="p">()</span>
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">'Retrieving file and line number where exception occurred'</span><span class="p">)</span>
- <span class="n">exc_type</span><span class="p">,</span> <span class="n">exc_obj</span><span class="p">,</span> <span class="n">exc_tb</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">exc_info</span><span class="p">()</span>
- <span class="n">found</span> <span class="o">=</span> <span class="bp">False</span>
- <span class="k">while</span> <span class="ow">not</span> <span class="n">found</span><span class="p">:</span>
- <span class="c1"># search for the _handler method</span>
- <span class="n">m_name</span> <span class="o">=</span> <span class="n">exc_tb</span><span class="o">.</span><span class="n">tb_frame</span><span class="o">.</span><span class="n">f_code</span><span class="o">.</span><span class="n">co_name</span>
- <span class="k">if</span> <span class="n">m_name</span> <span class="o">==</span> <span class="s1">'_handler'</span><span class="p">:</span>
- <span class="n">found</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">if</span> <span class="n">exc_tb</span><span class="o">.</span><span class="n">tb_next</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
- <span class="n">exc_tb</span> <span class="o">=</span> <span class="n">exc_tb</span><span class="o">.</span><span class="n">tb_next</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="c1"># if not found then take the first</span>
- <span class="n">exc_tb</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">exc_info</span><span class="p">()[</span><span class="mi">2</span><span class="p">]</span>
- <span class="k">break</span>
- <span class="n">fname</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">exc_tb</span><span class="o">.</span><span class="n">tb_frame</span><span class="o">.</span><span class="n">f_code</span><span class="o">.</span><span class="n">co_filename</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span>
- <span class="n">method_name</span> <span class="o">=</span> <span class="n">exc_tb</span><span class="o">.</span><span class="n">tb_frame</span><span class="o">.</span><span class="n">f_code</span><span class="o">.</span><span class="n">co_name</span>
-
- <span class="c1"># update the process status to display process failed</span>
- <span class="n">msg</span> <span class="o">=</span> <span class="s1">'Process error: </span><span class="si">%s</span><span class="s1">.</span><span class="si">%s</span><span class="s1"> Line </span><span class="si">%i</span><span class="s1"> </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span><span class="n">fname</span><span class="p">,</span> <span class="n">method_name</span><span class="p">,</span> <span cla [...]
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="ow">not</span> <span class="n">wps_response</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">NoApplicableCode</span><span class="p">(</span><span class="s1">'Response is empty. Make sure the _handler method is returning a valid object.'</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">wps_response</span><span class="o">.</span><span class="n">update_status</span><span class="p">(</span><span class="n">msg</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
-
- <span class="c1"># tr</span>
- <span class="n">stored_requests</span> <span class="o">=</span> <span class="n">dblog</span><span class="o">.</span><span class="n">get_first_stored</span><span class="p">()</span>
- <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">stored_requests</span><span class="p">)</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
- <span class="p">(</span><span class="n">uuid</span><span class="p">,</span> <span class="n">request_json</span><span class="p">)</span> <span class="o">=</span> <span class="n">stored_requests</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
- <span class="n">new_wps_request</span> <span class="o">=</span> <span class="n">WPSRequest</span><span class="p">()</span>
- <span class="n">new_wps_request</span><span class="o">.</span><span class="n">json</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">request_json</span><span class="p">)</span>
- <span class="n">new_wps_response</span> <span class="o">=</span> <span class="n">WPSResponse</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">new_wps_request</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
- <span class="n">new_wps_response</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">STATUS</span><span class="o">.</span><span class="n">STORE_AND_UPDATE_STATUS</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_set_uuid</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_run_async</span><span class="p">(</span><span class="n">new_wps_request</span><span class="p">,</span> <span class="n">new_wps_response</span><span class="p">)</span>
- <span class="n">dblog</span><span class="o">.</span><span class="n">remove_stored</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span>
-
-
- <span class="k">return</span> <span class="n">wps_response</span>
-
- <span class="k">def</span> <span class="nf">clean</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Clean the process working dir and other temporary files</span>
-<span class="sd"> """</span>
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Removing temporary working directory: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">):</span>
- <span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">)</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_grass_mapset</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_grass_mapset</span><span class="p">):</span>
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Removing temporary GRASS GIS mapset: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">_grass_mapset</span><span class="p">)</span>
- <span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_grass_mapset</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">set_workdir</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdir</span><span class="p">):</span>
- <span class="sd">"""Set working dir for all inputs and outputs</span>
-
-<span class="sd"> this is the directory, where all the data are being stored to</span>
-<span class="sd"> """</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span> <span class="o">=</span> <span class="n">workdir</span>
- <span class="k">for</span> <span class="n">inpt</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">inputs</span><span class="p">:</span>
- <span class="n">inpt</span><span class="o">.</span><span class="n">workdir</span> <span class="o">=</span> <span class="n">workdir</span>
-
- <span class="k">for</span> <span class="n">outpt</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">outputs</span><span class="p">:</span>
- <span class="n">outpt</span><span class="o">.</span><span class="n">workdir</span> <span class="o">=</span> <span class="n">workdir</span>
-
- <span class="k">def</span> <span class="nf">_set_grass</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Handle given grass_location parameter of the constructor</span>
-
-<span class="sd"> location is either directory name or 'epsg:1234' form</span>
-
-<span class="sd"> in the first case, new temporary mapset within the location will be</span>
-<span class="sd"> created</span>
-
-<span class="sd"> in the second case, location will be created in self.workdir</span>
-
-<span class="sd"> the mapset should be deleted automatically using self.clean() method</span>
-<span class="sd"> """</span>
-
- <span class="k">if</span> <span class="ow">not</span> <span class="n">PY2</span><span class="p">:</span>
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s1">'Seems PyWPS is running in Python-3 '</span> <span class="o">+</span>
- <span class="s1">'environment, but GRASS GIS supports Python-2 only'</span><span class="p">)</span>
- <span class="k">return</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grass_location</span><span class="p">:</span>
-
- <span class="kn">from</span> <span class="nn">grass.script</span> <span class="kn">import</span> <span class="n">core</span> <span class="k">as</span> <span class="n">grass</span>
- <span class="kn">import</span> <span class="nn">grass.script.setup</span> <span class="kn">as</span> <span class="nn">gsetup</span>
-
- <span class="n">dbase</span> <span class="o">=</span> <span class="s1">''</span>
- <span class="n">location</span> <span class="o">=</span> <span class="s1">''</span>
-
- <span class="c1"># HOME needs to be set - and that is usually not the case for httpd</span>
- <span class="c1"># server</span>
- <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s1">'HOME'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span>
-
- <span class="c1"># GISRC envvariable needs to be set</span>
- <span class="n">gisrc</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">,</span> <span class="s1">'GISRC'</span><span class="p">),</span> <span class="s1">'w'</span><span class="p"> [...]
- <span class="n">gisrc</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"GISDBASE: </span><span class="si">%s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">)</span>
- <span class="n">gisrc</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"GUI: txt</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
- <span class="n">gisrc</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
- <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s1">'GISRC'</span><span class="p">]</span> <span class="o">=</span> <span class="n">gisrc</span><span class="o">.</span><span class="n">name</span>
-
- <span class="c1"># create new location from epsg code</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">grass_location</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">'epsg:'</span><span class="p">):</span>
- <span class="n">epsg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grass_location</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s1">'epsg:'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">dbase</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span>
- <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s1">'GISDBASE'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span>
- <span class="n">location</span> <span class="o">=</span> <span class="s1">'pywps_location'</span>
- <span class="n">grass</span><span class="o">.</span><span class="n">run_command</span><span class="p">(</span><span class="s1">'g.gisenv'</span><span class="p">,</span> <span class="nb">set</span><span class="o">=</span><span class="s2">"GISDBASE=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">dbase</span><span class="p">)</span>
- <span class="n">grass</span><span class="o">.</span><span class="n">run_command</span><span class="p">(</span><span class="s1">'g.proj'</span><span class="p">,</span> <span class="n">flags</span><span class="o">=</span><span class="s2">"t"</span><span class="p">,</span> <span class="n">location</span><span class="o">=</span><span class="n">location</span><span class="p">,</span> <span class="n">epsg</span><span class="o">=</span><span class="n">epsg</spa [...]
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">'GRASS location based on EPSG code created'</span><span class="p">)</span>
-
- <span class="c1"># create temporary mapset within existing location</span>
- <span class="k">elif</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grass_location</span><span class="p">):</span>
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">'Temporary mapset will be created'</span><span class="p">)</span>
- <span class="n">dbase</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grass_location</span><span class="p">)</span>
- <span class="n">location</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grass_location</span><span class="p">)</span>
- <span class="n">grass</span><span class="o">.</span><span class="n">run_command</span><span class="p">(</span><span class="s1">'g.gisenv'</span><span class="p">,</span> <span class="nb">set</span><span class="o">=</span><span class="s2">"GISDBASE=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">dbase</span><span class="p">)</span>
-
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">NoApplicableCode</span><span class="p">(</span>
- <span class="s1">'Location does exists or does not seem to be in "EPSG:XXXX" form nor is it existing directory: </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="n">location</span><span class="p">)</span>
-
- <span class="c1"># copy projection files from PERMAMENT mapset to temporary mapset</span>
- <span class="n">mapset_name</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkdtemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s1">'pywps_'</span><span class="p">,</span> <span class="nb">dir</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p" [...]
- <span class="n">shutil</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">dbase</span><span class="p">,</span> <span class="n">location</span><span class="p">,</span> <span class="s1">'PERMANENT'</span><span class="p">,</span>
- <span class="s1">'DEFAULT_WIND'</span><span class="p">),</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">mapset_name</span><span class="p">,</span> <span class="s1">'WIND'</span><span class="p">))</span>
- <span class="n">shutil</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">dbase</span><span class="p">,</span> <span class="n">location</span><span class="p">,</span> <span class="s1">'PERMANENT'</span><span class="p">,</span>
- <span class="s1">'PROJ_EPSG'</span><span class="p">),</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">mapset_name</span><span class="p">,</span> <span class="s1">'PROJ_EPSG'</span><span class="p">))</span>
- <span class="n">shutil</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">dbase</span><span class="p">,</span> <span class="n">location</span><span class="p">,</span> <span class="s1">'PERMANENT'</span><span class="p">,</span>
- <span class="s1">'PROJ_INFO'</span><span class="p">),</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">mapset_name</span><span class="p">,</span> <span class="s1">'PROJ_INFO'</span><span class="p">))</span>
- <span class="n">shutil</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">dbase</span><span class="p">,</span> <span class="n">location</span><span class="p">,</span> <span class="s1">'PERMANENT'</span><span class="p">,</span>
- <span class="s1">'PROJ_UNITS'</span><span class="p">),</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">mapset_name</span><span class="p">,</span> <span class="s1">'PROJ_UNITS'</span><span class="p">))</span>
-
- <span class="c1"># set _grass_mapset attribute - will be deleted once handler ends</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_grass_mapset</span> <span class="o">=</span> <span class="n">mapset_name</span>
-
- <span class="c1"># final initialization</span>
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">'GRASS Mapset set to </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="n">mapset_name</span><span class="p">)</span>
- <span class="n">grass</span><span class="o">.</span><span class="n">run_command</span><span class="p">(</span><span class="s1">'g.gisenv'</span><span class="p">,</span> <span class="nb">set</span><span class="o">=</span><span class="s2">"LOCATION_NAME=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">location</span><span class="p">)</span>
- <span class="n">grass</span><span class="o">.</span><span class="n">run_command</span><span class="p">(</span><span class="s1">'g.gisenv'</span><span class="p">,</span> <span class="nb">set</span><span class="o">=</span><span class="s2">"MAPSET=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><s [...]
-
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span>
- <span class="s1">'GRASS environment initialised with GISRC {}, GISBASE {}, GISDBASE {}, LOCATION {}, MAPSET {}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
- <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'GISRC'</span><span class="p">),</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'GISBASE'</span><span class="p">),</span>
- <span class="n">dbase</span><span class="p">,</span> <span class="n">location</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">mapset_name</span><span class="p">)))</span></div>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../../index.html">
- <img class="logo" src="../../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/app/WPSRequest.html b/docs/_build/html/_modules/pywps/app/WPSRequest.html
deleted file mode 100644
index 70d1af7..0000000
--- a/docs/_build/html/_modules/pywps/app/WPSRequest.html
+++ /dev/null
@@ -1,736 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.app.WPSRequest — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../../index.html" />
- <link rel="up" title="Module code" href="../../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.app.WPSRequest</h1><div class="highlight"><pre>
-<span class="kn">import</span> <span class="nn">lxml</span>
-<span class="kn">import</span> <span class="nn">lxml.etree</span>
-<span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">MethodNotAllowed</span>
-<span class="kn">import</span> <span class="nn">base64</span>
-<span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">WPS</span>
-<span class="kn">from</span> <span class="nn">pywps._compat</span> <span class="kn">import</span> <span class="n">text_type</span><span class="p">,</span> <span class="n">PY2</span>
-<span class="kn">from</span> <span class="nn">pywps.app.basic</span> <span class="kn">import</span> <span class="n">xpath_ns</span>
-<span class="kn">from</span> <span class="nn">pywps.inout.basic</span> <span class="kn">import</span> <span class="n">LiteralInput</span><span class="p">,</span> <span class="n">ComplexInput</span><span class="p">,</span> <span class="n">BBoxInput</span>
-<span class="kn">from</span> <span class="nn">pywps.exceptions</span> <span class="kn">import</span> <span class="n">NoApplicableCode</span><span class="p">,</span> <span class="n">OperationNotSupported</span><span class="p">,</span> <span class="n">MissingParameterValue</span><span class="p">,</span> <span class="n">VersionNegotiationFailed</span><span class="p">,</span> \
- <span class="n">InvalidParameterValue</span><span class="p">,</span> <span class="n">FileSizeExceeded</span>
-<span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">configuration</span>
-<span class="kn">from</span> <span class="nn">pywps._compat</span> <span class="kn">import</span> <span class="n">PY2</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.base</span> <span class="kn">import</span> <span class="n">emptyvalidator</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.mode</span> <span class="kn">import</span> <span class="n">MODE</span>
-<span class="kn">from</span> <span class="nn">pywps.inout.literaltypes</span> <span class="kn">import</span> <span class="n">AnyValue</span><span class="p">,</span> <span class="n">NoValue</span><span class="p">,</span> <span class="n">ValuesReference</span><span class="p">,</span> <span class="n">AllowedValue</span>
-
-<span class="kn">from</span> <span class="nn">pywps.inout.formats</span> <span class="kn">import</span> <span class="n">Format</span>
-
-<span class="kn">import</span> <span class="nn">json</span>
-
-
-<div class="viewcode-block" id="WPSRequest"><a class="viewcode-back" href="../../../api.html#pywps.app.WPSRequest">[docs]</a><span class="k">class</span> <span class="nc">WPSRequest</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">http_request</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">http_request</span> <span class="o">=</span> <span class="n">http_request</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">operation</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">version</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">language</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">identifiers</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">store_execute</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">lineage</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">inputs</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">outputs</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">raw</span> <span class="o">=</span> <span class="bp">None</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">http_request</span><span class="p">:</span>
- <span class="n">request_parser</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_request_parser_method</span><span class="p">(</span><span class="n">http_request</span><span class="o">.</span><span class="n">method</span><span class="p">)</span>
- <span class="n">request_parser</span><span class="p">()</span>
-
- <span class="k">def</span> <span class="nf">_get_request_parser_method</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">method</span><span class="p">):</span>
-
- <span class="k">if</span> <span class="n">method</span> <span class="o">==</span> <span class="s1">'GET'</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_request</span>
- <span class="k">elif</span> <span class="n">method</span> <span class="o">==</span> <span class="s1">'POST'</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_post_request</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">MethodNotAllowed</span><span class="p">()</span>
-
- <span class="k">def</span> <span class="nf">_get_request</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""HTTP GET request parser</span>
-<span class="sd"> """</span>
-
- <span class="c1"># service shall be WPS</span>
- <span class="n">service</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'service'</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">service</span><span class="p">:</span>
- <span class="k">if</span> <span class="nb">str</span><span class="p">(</span><span class="n">service</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">!=</span> <span class="s1">'wps'</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">InvalidParameterValue</span><span class="p">(</span>
- <span class="s1">'parameter SERVICE [</span><span class="si">%s</span><span class="s1">] not supported'</span> <span class="o">%</span> <span class="n">service</span><span class="p">,</span> <span class="s1">'service'</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">MissingParameterValue</span><span class="p">(</span><span class="s1">'service'</span><span class="p">,</span> <span class="s1">'service'</span><span class="p">)</span>
-
- <span class="n">operation</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'request'</span><span class="p">)</span>
-
- <span class="n">request_parser</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_request_parser</span><span class="p">(</span><span class="n">operation</span><span class="p">)</span>
- <span class="n">request_parser</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">http_request</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">_post_request</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""HTTP GET request parser</span>
-<span class="sd"> """</span>
- <span class="c1"># check if input file size was not exceeded</span>
- <span class="n">maxsize</span> <span class="o">=</span> <span class="n">configuration</span><span class="o">.</span><span class="n">get_config_value</span><span class="p">(</span><span class="s1">'server'</span><span class="p">,</span> <span class="s1">'maxrequestsize'</span><span class="p">)</span>
- <span class="n">maxsize</span> <span class="o">=</span> <span class="n">configuration</span><span class="o">.</span><span class="n">get_size_mb</span><span class="p">(</span><span class="n">maxsize</span><span class="p">)</span> <span class="o">*</span> <span class="mi">1024</span> <span class="o">*</span> <span class="mi">1024</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">http_request</span><span class="o">.</span><span class="n">content_length</span> <span class="o">></span> <span class="n">maxsize</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">FileSizeExceeded</span><span class="p">(</span><span class="s1">'File size for input exceeded.'</span>
- <span class="s1">' Maximum request size allowed: </span><span class="si">%i</span><span class="s1"> megabytes'</span> <span class="o">%</span> <span class="n">maxsize</span> <span class="o">/</span> <span class="mi">1024</span> <span class="o">/</span> <span class="mi">1024</span><span class="p">)</span>
-
- <span class="k">try</span><span class="p">:</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">lxml</span><span class="o">.</span><span class="n">etree</span><span class="o">.</span><span class="n">fromstring</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">http_request</span><span class="o">.</span><span class="n">get_data</span><span class="p">())</span>
- <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
- <span class="k">if</span> <span class="n">PY2</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">NoApplicableCode</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">message</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">NoApplicableCode</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">msg</span><span class="p">)</span>
-
- <span class="n">operation</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="n">tag</span>
- <span class="n">request_parser</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_post_request_parser</span><span class="p">(</span><span class="n">operation</span><span class="p">)</span>
- <span class="n">request_parser</span><span class="p">(</span><span class="n">doc</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">_get_request_parser</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">operation</span><span class="p">):</span>
- <span class="sd">"""Factory function returing propper parsing function</span>
-<span class="sd"> """</span>
-
- <span class="n">wpsrequest</span> <span class="o">=</span> <span class="bp">self</span>
-
- <span class="k">def</span> <span class="nf">parse_get_getcapabilities</span><span class="p">(</span><span class="n">http_request</span><span class="p">):</span>
- <span class="sd">"""Parse GET GetCapabilities request</span>
-<span class="sd"> """</span>
-
- <span class="n">acceptedversions</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'acceptversions'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">check_accepted_versions</span><span class="p">(</span><span class="n">acceptedversions</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">parse_get_describeprocess</span><span class="p">(</span><span class="n">http_request</span><span class="p">):</span>
- <span class="sd">"""Parse GET DescribeProcess request</span>
-<span class="sd"> """</span>
- <span class="n">version</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'version'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">check_and_set_version</span><span class="p">(</span><span class="n">version</span><span class="p">)</span>
-
- <span class="n">language</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'language'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">check_and_set_language</span><span class="p">(</span><span class="n">language</span><span class="p">)</span>
-
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">identifiers</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span>
- <span class="n">http_request</span><span class="p">,</span> <span class="s1">'identifier'</span><span class="p">,</span> <span class="n">aslist</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">parse_get_execute</span><span class="p">(</span><span class="n">http_request</span><span class="p">):</span>
- <span class="sd">"""Parse GET Execute request</span>
-<span class="sd"> """</span>
- <span class="n">version</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'version'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">check_and_set_version</span><span class="p">(</span><span class="n">version</span><span class="p">)</span>
-
- <span class="n">language</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'language'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">check_and_set_language</span><span class="p">(</span><span class="n">language</span><span class="p">)</span>
-
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">identifier</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'identifier'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">store_execute</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span>
- <span class="n">http_request</span><span class="p">,</span> <span class="s1">'storeExecuteResponse'</span><span class="p">,</span> <span class="s1">'false'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'status'</span><span class="p">,</span> <span class="s1">'false'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">lineage</span> <span class="o">=</span> <span class="n">_get_get_param</span><span class="p">(</span>
- <span class="n">http_request</span><span class="p">,</span> <span class="s1">'lineage'</span><span class="p">,</span> <span class="s1">'false'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">inputs</span> <span class="o">=</span> <span class="n">get_data_from_kvp</span><span class="p">(</span>
- <span class="n">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'DataInputs'</span><span class="p">),</span> <span class="s1">'DataInputs'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">outputs</span> <span class="o">=</span> <span class="p">{}</span>
-
- <span class="c1"># take responseDocument preferably</span>
- <span class="n">resp_outputs</span> <span class="o">=</span> <span class="n">get_data_from_kvp</span><span class="p">(</span>
- <span class="n">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'ResponseDocument'</span><span class="p">))</span>
- <span class="n">raw_outputs</span> <span class="o">=</span> <span class="n">get_data_from_kvp</span><span class="p">(</span>
- <span class="n">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="s1">'RawDataOutput'</span><span class="p">))</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">raw</span> <span class="o">=</span> <span class="bp">False</span>
- <span class="k">if</span> <span class="n">resp_outputs</span><span class="p">:</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">outputs</span> <span class="o">=</span> <span class="n">resp_outputs</span>
- <span class="k">elif</span> <span class="n">raw_outputs</span><span class="p">:</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">outputs</span> <span class="o">=</span> <span class="n">raw_outputs</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">raw</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="c1"># executeResponse XML will not be stored and no updating of</span>
- <span class="c1"># status</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">store_execute</span> <span class="o">=</span> <span class="s1">'false'</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s1">'false'</span>
-
- <span class="k">if</span> <span class="ow">not</span> <span class="n">operation</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">MissingParameterValue</span><span class="p">(</span><span class="s1">'Missing request value'</span><span class="p">,</span> <span class="s1">'request'</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">operation</span> <span class="o">=</span> <span class="n">operation</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">operation</span> <span class="o">==</span> <span class="s1">'getcapabilities'</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">parse_get_getcapabilities</span>
- <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">operation</span> <span class="o">==</span> <span class="s1">'describeprocess'</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">parse_get_describeprocess</span>
- <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">operation</span> <span class="o">==</span> <span class="s1">'execute'</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">parse_get_execute</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">OperationNotSupported</span><span class="p">(</span>
- <span class="s1">'Unknown request </span><span class="si">%r</span><span class="s1">'</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">operation</span><span class="p">,</span> <span class="n">operation</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">_post_request_parser</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">tagname</span><span class="p">):</span>
- <span class="sd">"""Factory function returing propper parsing function</span>
-<span class="sd"> """</span>
-
- <span class="n">wpsrequest</span> <span class="o">=</span> <span class="bp">self</span>
-
- <span class="k">def</span> <span class="nf">parse_post_getcapabilities</span><span class="p">(</span><span class="n">doc</span><span class="p">):</span>
- <span class="sd">"""Parse POST GetCapabilities request</span>
-<span class="sd"> """</span>
- <span class="n">acceptedversions</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span>
- <span class="n">doc</span><span class="p">,</span> <span class="s1">'/wps:GetCapabilities/ows:AcceptVersions/ows:Version'</span><span class="p">)</span>
- <span class="n">acceptedversions</span> <span class="o">=</span> <span class="s1">','</span><span class="o">.</span><span class="n">join</span><span class="p">(</span>
- <span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">v</span><span class="p">:</span> <span class="n">v</span><span class="o">.</span><span class="n">text</span><span class="p">,</span> <span class="n">acceptedversions</span><span class="p">))</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">check_accepted_versions</span><span class="p">(</span><span class="n">acceptedversions</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">parse_post_describeprocess</span><span class="p">(</span><span class="n">doc</span><span class="p">):</span>
- <span class="sd">"""Parse POST DescribeProcess request</span>
-<span class="sd"> """</span>
-
- <span class="n">version</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'version'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">check_and_set_version</span><span class="p">(</span><span class="n">version</span><span class="p">)</span>
-
- <span class="n">language</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'language'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">check_and_set_language</span><span class="p">(</span><span class="n">language</span><span class="p">)</span>
-
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">operation</span> <span class="o">=</span> <span class="s1">'describeprocess'</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">identifiers</span> <span class="o">=</span> <span class="p">[</span><span class="n">identifier_el</span><span class="o">.</span><span class="n">text</span> <span class="k">for</span> <span class="n">identifier_el</span> <span class="ow">in</span>
- <span class="n">xpath_ns</span><span class="p">(</span><span class="n">doc</span><span class="p">,</span> <span class="s1">'./ows:Identifier'</span><span class="p">)]</span>
-
- <span class="k">def</span> <span class="nf">parse_post_execute</span><span class="p">(</span><span class="n">doc</span><span class="p">):</span>
- <span class="sd">"""Parse POST Execute request</span>
-<span class="sd"> """</span>
-
- <span class="n">version</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'version'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">check_and_set_version</span><span class="p">(</span><span class="n">version</span><span class="p">)</span>
-
- <span class="n">language</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'language'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">check_and_set_language</span><span class="p">(</span><span class="n">language</span><span class="p">)</span>
-
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">operation</span> <span class="o">=</span> <span class="s1">'execute'</span>
-
- <span class="n">identifier</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">doc</span><span class="p">,</span> <span class="s1">'./ows:Identifier'</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="ow">not</span> <span class="n">identifier</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">MissingParameterValue</span><span class="p">(</span>
- <span class="s1">'Process identifier not set'</span><span class="p">,</span> <span class="s1">'Identifier'</span><span class="p">)</span>
-
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">identifier</span> <span class="o">=</span> <span class="n">identifier</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">text</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">lineage</span> <span class="o">=</span> <span class="s1">'false'</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">store_execute</span> <span class="o">=</span> <span class="s1">'false'</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s1">'false'</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">inputs</span> <span class="o">=</span> <span class="n">get_inputs_from_xml</span><span class="p">(</span><span class="n">doc</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">outputs</span> <span class="o">=</span> <span class="n">get_output_from_xml</span><span class="p">(</span><span class="n">doc</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">raw</span> <span class="o">=</span> <span class="bp">False</span>
- <span class="k">if</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">doc</span><span class="p">,</span> <span class="s1">'/wps:Execute/wps:ResponseForm/wps:RawDataOutput'</span><span class="p">):</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">raw</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="c1"># executeResponse XML will not be stored</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">store_execute</span> <span class="o">=</span> <span class="s1">'false'</span>
-
- <span class="c1"># check if response document tag has been set then retrieve</span>
- <span class="n">response_document</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span>
- <span class="n">doc</span><span class="p">,</span> <span class="s1">'./wps:ResponseForm/wps:ResponseDocument'</span><span class="p">)</span>
- <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">response_document</span><span class="p">)</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">lineage</span> <span class="o">=</span> <span class="n">response_document</span><span class="p">[</span>
- <span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'lineage'</span><span class="p">,</span> <span class="s1">'false'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">store_execute</span> <span class="o">=</span> <span class="n">response_document</span><span class="p">[</span>
- <span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'storeExecuteResponse'</span><span class="p">,</span> <span class="s1">'false'</span><span class="p">)</span>
- <span class="n">wpsrequest</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">response_document</span><span class="p">[</span>
- <span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'status'</span><span class="p">,</span> <span class="s1">'false'</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="n">tagname</span> <span class="o">==</span> <span class="n">WPS</span><span class="o">.</span><span class="n">GetCapabilities</span><span class="p">()</span><span class="o">.</span><span class="n">tag</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">operation</span> <span class="o">=</span> <span class="s1">'getcapabilities'</span>
- <span class="k">return</span> <span class="n">parse_post_getcapabilities</span>
- <span class="k">elif</span> <span class="n">tagname</span> <span class="o">==</span> <span class="n">WPS</span><span class="o">.</span><span class="n">DescribeProcess</span><span class="p">()</span><span class="o">.</span><span class="n">tag</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">operation</span> <span class="o">=</span> <span class="s1">'describeprocess'</span>
- <span class="k">return</span> <span class="n">parse_post_describeprocess</span>
- <span class="k">elif</span> <span class="n">tagname</span> <span class="o">==</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Execute</span><span class="p">()</span><span class="o">.</span><span class="n">tag</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">operation</span> <span class="o">=</span> <span class="s1">'execute'</span>
- <span class="k">return</span> <span class="n">parse_post_execute</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">InvalidParameterValue</span><span class="p">(</span>
- <span class="s1">'Unknown request </span><span class="si">%r</span><span class="s1">'</span> <span class="o">%</span> <span class="n">tagname</span><span class="p">,</span> <span class="s1">'request'</span><span class="p">)</span>
-
-<div class="viewcode-block" id="WPSRequest.check_accepted_versions"><a class="viewcode-back" href="../../../api.html#pywps.app.WPSRequest.check_accepted_versions">[docs]</a> <span class="k">def</span> <span class="nf">check_accepted_versions</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">acceptedversions</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> :param acceptedversions: string</span>
-<span class="sd"> """</span>
-
- <span class="n">version</span> <span class="o">=</span> <span class="bp">None</span>
-
- <span class="k">if</span> <span class="n">acceptedversions</span><span class="p">:</span>
- <span class="n">acceptedversions_array</span> <span class="o">=</span> <span class="n">acceptedversions</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">','</span><span class="p">)</span>
- <span class="k">for</span> <span class="n">aversion</span> <span class="ow">in</span> <span class="n">acceptedversions_array</span><span class="p">:</span>
- <span class="k">if</span> <span class="n">_check_version</span><span class="p">(</span><span class="n">aversion</span><span class="p">):</span>
- <span class="n">version</span> <span class="o">=</span> <span class="n">aversion</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">version</span> <span class="o">=</span> <span class="s1">'1.0.0'</span>
-
- <span class="k">if</span> <span class="n">version</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">check_and_set_version</span><span class="p">(</span><span class="n">version</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">VersionNegotiationFailed</span><span class="p">(</span>
- <span class="s1">'The requested version "</span><span class="si">%s</span><span class="s1">" is not supported by this server'</span> <span class="o">%</span> <span class="n">acceptedversions</span><span class="p">,</span> <span class="s1">'version'</span><span class="p">)</span></div>
-
-<div class="viewcode-block" id="WPSRequest.check_and_set_version"><a class="viewcode-back" href="../../../api.html#pywps.app.WPSRequest.check_and_set_version">[docs]</a> <span class="k">def</span> <span class="nf">check_and_set_version</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">version</span><span class="p">):</span>
- <span class="sd">"""set this.version</span>
-<span class="sd"> """</span>
-
- <span class="k">if</span> <span class="ow">not</span> <span class="n">version</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">MissingParameterValue</span><span class="p">(</span><span class="s1">'Missing version'</span><span class="p">,</span> <span class="s1">'version'</span><span class="p">)</span>
- <span class="k">elif</span> <span class="ow">not</span> <span class="n">_check_version</span><span class="p">(</span><span class="n">version</span><span class="p">):</span>
- <span class="k">raise</span> <span class="n">VersionNegotiationFailed</span><span class="p">(</span>
- <span class="s1">'The requested version "</span><span class="si">%s</span><span class="s1">" is not supported by this server'</span> <span class="o">%</span> <span class="n">version</span><span class="p">,</span> <span class="s1">'version'</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">version</span> <span class="o">=</span> <span class="n">version</span></div>
-
-<div class="viewcode-block" id="WPSRequest.check_and_set_language"><a class="viewcode-back" href="../../../api.html#pywps.app.WPSRequest.check_and_set_language">[docs]</a> <span class="k">def</span> <span class="nf">check_and_set_language</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">language</span><span class="p">):</span>
- <span class="sd">"""set this.language</span>
-<span class="sd"> """</span>
-
- <span class="k">if</span> <span class="ow">not</span> <span class="n">language</span><span class="p">:</span>
- <span class="n">language</span> <span class="o">=</span> <span class="s1">'None'</span>
- <span class="k">elif</span> <span class="n">language</span> <span class="o">!=</span> <span class="s1">'en-US'</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">InvalidParameterValue</span><span class="p">(</span>
- <span class="s1">'The requested language "</span><span class="si">%s</span><span class="s1">" is not supported by this server'</span> <span class="o">%</span> <span class="n">language</span><span class="p">,</span> <span class="s1">'language'</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">language</span> <span class="o">=</span> <span class="n">language</span></div>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return JSON encoded representation of the request</span>
-<span class="sd"> """</span>
-
- <span class="n">obj</span> <span class="o">=</span> <span class="p">{</span>
- <span class="s1">'operation'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">operation</span><span class="p">,</span>
- <span class="s1">'version'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">version</span><span class="p">,</span>
- <span class="s1">'language'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">language</span><span class="p">,</span>
- <span class="s1">'identifiers'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">identifiers</span><span class="p">,</span>
- <span class="s1">'store_execute'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">store_execute</span><span class="p">,</span>
- <span class="s1">'status'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span><span class="p">,</span>
- <span class="s1">'lineage'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">lineage</span><span class="p">,</span>
- <span class="s1">'inputs'</span><span class="p">:</span> <span class="nb">dict</span><span class="p">((</span><span class="n">i</span><span class="p">,</span> <span class="p">[</span><span class="n">inpt</span><span class="o">.</span><span class="n">json</span> <span class="k">for</span> <span class="n">inpt</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="n">i</span [...]
- <span class="s1">'outputs'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">outputs</span><span class="p">,</span>
- <span class="s1">'raw'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">raw</span>
- <span class="p">}</span>
-
- <span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">allow_nan</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
-
- <span class="nd">@json.setter</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
- <span class="sd">"""init this request from json back again</span>
-
-<span class="sd"> :param value: the json (not string) representation</span>
-<span class="sd"> """</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">operation</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="s1">'operation'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">version</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="s1">'version'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">language</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="s1">'language'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">identifiers</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="s1">'identifiers'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">store_execute</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="s1">'store_execute'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="s1">'status'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">lineage</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="s1">'lineage'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">outputs</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="s1">'outputs'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">raw</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="s1">'raw'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">inputs</span> <span class="o">=</span> <span class="p">{}</span>
-
- <span class="k">for</span> <span class="n">identifier</span> <span class="ow">in</span> <span class="n">value</span><span class="p">[</span><span class="s1">'inputs'</span><span class="p">]:</span>
- <span class="n">inpt</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="n">inpt_defs</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="s1">'inputs'</span><span class="p">][</span><span class="n">identifier</span><span class="p">]</span>
-
- <span class="k">for</span> <span class="n">inpt_def</span> <span class="ow">in</span> <span class="n">inpt_defs</span><span class="p">:</span>
-
- <span class="k">if</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'type'</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'complex'</span><span class="p">:</span>
- <span class="n">inpt</span> <span class="o">=</span> <span class="n">ComplexInput</span><span class="p">(</span>
- <span class="n">identifier</span><span class="o">=</span><span class="n">inpt_def</span><span class="p">[</span><span class="s1">'identifier'</span><span class="p">],</span>
- <span class="n">title</span><span class="o">=</span><span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'title'</span><span class="p">),</span>
- <span class="n">abstract</span><span class="o">=</span><span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'abstract'</span><span class="p">),</span>
- <span class="n">workdir</span><span class="o">=</span><span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'workdir'</span><span class="p">),</span>
- <span class="n">data_format</span><span class="o">=</span><span class="n">Format</span><span class="p">(</span>
- <span class="n">schema</span><span class="o">=</span><span class="n">inpt_def</span><span class="p">[</span><span class="s1">'data_format'</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'schema'</span><span class="p">),</span>
- <span class="n">extension</span><span class="o">=</span><span class="n">inpt_def</span><span class="p">[</span><span class="s1">'data_format'</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'extension'</span><span class="p">),</span>
- <span class="n">mime_type</span><span class="o">=</span><span class="n">inpt_def</span><span class="p">[</span><span class="s1">'data_format'</span><span class="p">][</span><span class="s1">'mime_type'</span><span class="p">],</span>
- <span class="n">encoding</span><span class="o">=</span><span class="n">inpt_def</span><span class="p">[</span><span class="s1">'data_format'</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'encoding'</span><span class="p">)</span>
- <span class="p">),</span>
- <span class="n">supported_formats</span><span class="o">=</span><span class="p">[</span>
- <span class="n">Format</span><span class="p">(</span>
- <span class="n">schema</span><span class="o">=</span><span class="n">infrmt</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'schema'</span><span class="p">),</span>
- <span class="n">extension</span><span class="o">=</span><span class="n">infrmt</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'extension'</span><span class="p">),</span>
- <span class="n">mime_type</span><span class="o">=</span><span class="n">infrmt</span><span class="p">[</span><span class="s1">'mime_type'</span><span class="p">],</span>
- <span class="n">encoding</span><span class="o">=</span><span class="n">infrmt</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'encoding'</span><span class="p">)</span>
- <span class="p">)</span> <span class="k">for</span> <span class="n">infrmt</span> <span class="ow">in</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'supported_formats'</span><span class="p">]</span>
- <span class="p">],</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span>
- <span class="p">)</span>
- <span class="n">inpt</span><span class="o">.</span><span class="n">file</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'file'</span><span class="p">]</span>
- <span class="k">elif</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'type'</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'literal'</span><span class="p">:</span>
-
- <span class="n">allowed_values</span> <span class="o">=</span> <span class="p">[]</span>
- <span class="k">for</span> <span class="n">allowed_value</span> <span class="ow">in</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'allowed_values'</span><span class="p">]:</span>
- <span class="k">if</span> <span class="n">allowed_value</span><span class="p">[</span><span class="s1">'type'</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'anyvalue'</span><span class="p">:</span>
- <span class="n">allowed_values</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">AnyValue</span><span class="p">())</span>
- <span class="k">elif</span> <span class="n">allowed_value</span><span class="p">[</span><span class="s1">'type'</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'novalue'</span><span class="p">:</span>
- <span class="n">allowed_values</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">NoValue</span><span class="p">())</span>
- <span class="k">elif</span> <span class="n">allowed_value</span><span class="p">[</span><span class="s1">'type'</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'valuesreference'</span><span class="p">:</span>
- <span class="n">allowed_values</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ValuesReference</span><span class="p">())</span>
- <span class="k">elif</span> <span class="n">allowed_value</span><span class="p">[</span><span class="s1">'type'</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'allowedvalue'</span><span class="p">:</span>
- <span class="n">allowed_values</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">AllowedValue</span><span class="p">(</span>
- <span class="n">allowed_type</span><span class="o">=</span><span class="n">allowed_value</span><span class="p">[</span><span class="s1">'allowed_type'</span><span class="p">],</span>
- <span class="n">value</span><span class="o">=</span><span class="n">allowed_value</span><span class="p">[</span><span class="s1">'value'</span><span class="p">],</span>
- <span class="n">minval</span><span class="o">=</span><span class="n">allowed_value</span><span class="p">[</span><span class="s1">'minval'</span><span class="p">],</span>
- <span class="n">maxval</span><span class="o">=</span><span class="n">allowed_value</span><span class="p">[</span><span class="s1">'maxval'</span><span class="p">],</span>
- <span class="n">spacing</span><span class="o">=</span><span class="n">allowed_value</span><span class="p">[</span><span class="s1">'spacing'</span><span class="p">],</span>
- <span class="n">range_closure</span><span class="o">=</span><span class="n">allowed_value</span><span class="p">[</span><span class="s1">'range_closure'</span><span class="p">]</span>
- <span class="p">))</span>
-
- <span class="n">inpt</span> <span class="o">=</span> <span class="n">LiteralInput</span><span class="p">(</span>
- <span class="n">identifier</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'identifier'</span><span class="p">],</span>
- <span class="n">title</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'title'</span><span class="p">),</span>
- <span class="n">abstract</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'abstract'</span><span class="p">),</span>
- <span class="n">data_type</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'data_type'</span><span class="p">),</span>
- <span class="n">workdir</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'workdir'</span><span class="p">),</span>
- <span class="n">allowed_values</span> <span class="o">=</span> <span class="n">AnyValue</span><span class="p">,</span>
- <span class="n">uoms</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'uoms'</span><span class="p">),</span>
- <span class="n">mode</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'mode'</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="n">inpt</span><span class="o">.</span><span class="n">uom</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'uom'</span><span class="p">)</span>
- <span class="n">inpt</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'data'</span><span class="p">)</span>
-
- <span class="k">elif</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'type'</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'bbox'</span><span class="p">:</span>
- <span class="n">inpt</span> <span class="o">=</span> <span class="n">BBoxInput</span><span class="p">(</span>
- <span class="n">identifier</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'identifier'</span><span class="p">],</span>
- <span class="n">title</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'title'</span><span class="p">],</span>
- <span class="n">abstract</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'abstract'</span><span class="p">],</span>
- <span class="n">crss</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'crs'</span><span class="p">],</span>
- <span class="n">dimensions</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'dimensions'</span><span class="p">],</span>
- <span class="n">workdir</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'workdir'</span><span class="p">],</span>
- <span class="n">mode</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'mode'</span><span class="p">]</span>
- <span class="p">)</span>
- <span class="n">inpt</span><span class="o">.</span><span class="n">ll</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'bbox'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
- <span class="n">inpt</span><span class="o">.</span><span class="n">ur</span> <span class="o">=</span> <span class="n">inpt_def</span><span class="p">[</span><span class="s1">'bbox'</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span>
-
- <span class="k">if</span> <span class="n">identifier</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">inputs</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="n">identifier</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="n">identifier</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">inpt</span><span class="p">]</span></div>
-
-<span class="k">def</span> <span class="nf">get_inputs_from_xml</span><span class="p">(</span><span class="n">doc</span><span class="p">):</span>
- <span class="n">the_inputs</span> <span class="o">=</span> <span class="p">{}</span>
- <span class="k">for</span> <span class="n">input_el</span> <span class="ow">in</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">doc</span><span class="p">,</span> <span class="s1">'/wps:Execute/wps:DataInputs/wps:Input'</span><span class="p">):</span>
- <span class="p">[</span><span class="n">identifier_el</span><span class="p">]</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">input_el</span><span class="p">,</span> <span class="s1">'./ows:Identifier'</span><span class="p">)</span>
- <span class="n">identifier</span> <span class="o">=</span> <span class="n">identifier_el</span><span class="o">.</span><span class="n">text</span>
-
- <span class="k">if</span> <span class="n">identifier</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">the_inputs</span><span class="p">:</span>
- <span class="n">the_inputs</span><span class="p">[</span><span class="n">identifier</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
-
- <span class="n">literal_data</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">input_el</span><span class="p">,</span> <span class="s1">'./wps:Data/wps:LiteralData'</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">literal_data</span><span class="p">:</span>
- <span class="n">value_el</span> <span class="o">=</span> <span class="n">literal_data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
- <span class="n">inpt</span> <span class="o">=</span> <span class="p">{}</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'identifier'</span><span class="p">]</span> <span class="o">=</span> <span class="n">identifier_el</span><span class="o">.</span><span class="n">text</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'data'</span><span class="p">]</span> <span class="o">=</span> <span class="n">text_type</span><span class="p">(</span><span class="n">value_el</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'uom'</span><span class="p">]</span> <span class="o">=</span> <span class="n">value_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'uom'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'datatype'</span><span class="p">]</span> <span class="o">=</span> <span class="n">value_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'datatype'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">the_inputs</span><span class="p">[</span><span class="n">identifier</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
- <span class="k">continue</span>
-
- <span class="n">complex_data</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">input_el</span><span class="p">,</span> <span class="s1">'./wps:Data/wps:ComplexData'</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">complex_data</span><span class="p">:</span>
-
- <span class="n">complex_data_el</span> <span class="o">=</span> <span class="n">complex_data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
- <span class="n">inpt</span> <span class="o">=</span> <span class="p">{}</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'identifier'</span><span class="p">]</span> <span class="o">=</span> <span class="n">identifier_el</span><span class="o">.</span><span class="n">text</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'mimeType'</span><span class="p">]</span> <span class="o">=</span> <span class="n">complex_data_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'mimeType'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'encoding'</span><span class="p">]</span> <span class="o">=</span> <span class="n">complex_data_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
- <span class="s1">'encoding'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'schema'</span><span class="p">]</span> <span class="o">=</span> <span class="n">complex_data_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'schema'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'method'</span><span class="p">]</span> <span class="o">=</span> <span class="n">complex_data_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'method'</span><span class="p">,</span> <span class="s1">'GET'</span><span class="p">)</span>
- <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">complex_data_el</span><span class="o">.</span><span class="n">getchildren</span><span class="p">())</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
- <span class="n">value_el</span> <span class="o">=</span> <span class="n">complex_data_el</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'data'</span><span class="p">]</span> <span class="o">=</span> <span class="n">_get_dataelement_value</span><span class="p">(</span><span class="n">value_el</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'data'</span><span class="p">]</span> <span class="o">=</span> <span class="n">_get_rawvalue_value</span><span class="p">(</span>
- <span class="n">complex_data_el</span><span class="o">.</span><span class="n">text</span><span class="p">,</span> <span class="n">inpt</span><span class="p">[</span><span class="s1">'encoding'</span><span class="p">])</span>
- <span class="n">the_inputs</span><span class="p">[</span><span class="n">identifier</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
- <span class="k">continue</span>
-
- <span class="n">reference_data</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">input_el</span><span class="p">,</span> <span class="s1">'./wps:Reference'</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">reference_data</span><span class="p">:</span>
- <span class="n">reference_data_el</span> <span class="o">=</span> <span class="n">reference_data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
- <span class="n">inpt</span> <span class="o">=</span> <span class="p">{}</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'identifier'</span><span class="p">]</span> <span class="o">=</span> <span class="n">identifier_el</span><span class="o">.</span><span class="n">text</span>
- <span class="n">inpt</span><span class="p">[</span><span class="n">identifier_el</span><span class="o">.</span><span class="n">text</span><span class="p">]</span> <span class="o">=</span> <span class="n">reference_data_el</span><span class="o">.</span><span class="n">text</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'href'</span><span class="p">]</span> <span class="o">=</span> <span class="n">reference_data_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
- <span class="s1">'{http://www.w3.org/1999/xlink}href'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'mimeType'</span><span class="p">]</span> <span class="o">=</span> <span class="n">reference_data_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'mimeType'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'method'</span><span class="p">]</span> <span class="o">=</span> <span class="n">reference_data_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'method'</span><span class="p">,</span> <span class="s1">'GET'</span><span class="p">)</span>
- <span class="n">header_element</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">reference_data_el</span><span class="p">,</span> <span class="s1">'./wps:Header'</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">header_element</span><span class="p">:</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'header'</span><span class="p">]</span> <span class="o">=</span> <span class="n">_get_reference_header</span><span class="p">(</span><span class="n">header_element</span><span class="p">)</span>
- <span class="n">body_element</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">reference_data_el</span><span class="p">,</span> <span class="s1">'./wps:Body'</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">body_element</span><span class="p">:</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'body'</span><span class="p">]</span> <span class="o">=</span> <span class="n">_get_reference_body</span><span class="p">(</span><span class="n">body_element</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
- <span class="n">bodyreference_element</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">reference_data_el</span><span class="p">,</span>
- <span class="s1">'./wps:BodyReference'</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">bodyreference_element</span><span class="p">:</span>
- <span class="n">inpt</span><span class="p">[</span><span class="s1">'bodyreference'</span><span class="p">]</span> <span class="o">=</span> <span class="n">_get_reference_bodyreference</span><span class="p">(</span>
- <span class="n">bodyreference_element</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
- <span class="n">the_inputs</span><span class="p">[</span><span class="n">identifier</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
- <span class="k">continue</span>
-
- <span class="c1"># OWSlib is not python 3 compatible yet</span>
- <span class="k">if</span> <span class="n">PY2</span><span class="p">:</span>
- <span class="kn">from</span> <span class="nn">owslib.ows</span> <span class="kn">import</span> <span class="n">BoundingBox</span>
- <span class="n">bbox_datas</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">input_el</span><span class="p">,</span> <span class="s1">'./wps:Data/wps:BoundingBoxData'</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">bbox_datas</span><span class="p">:</span>
- <span class="k">for</span> <span class="n">bbox_data</span> <span class="ow">in</span> <span class="n">bbox_datas</span><span class="p">:</span>
- <span class="n">bbox_data_el</span> <span class="o">=</span> <span class="n">bbox_data</span>
- <span class="n">bbox</span> <span class="o">=</span> <span class="n">BoundingBox</span><span class="p">(</span><span class="n">bbox_data_el</span><span class="p">)</span>
- <span class="n">the_inputs</span><span class="p">[</span><span class="n">identifier</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">bbox</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">the_inputs</span>
-
-
-<span class="k">def</span> <span class="nf">get_output_from_xml</span><span class="p">(</span><span class="n">doc</span><span class="p">):</span>
- <span class="n">the_output</span> <span class="o">=</span> <span class="p">{}</span>
-
- <span class="k">if</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">doc</span><span class="p">,</span> <span class="s1">'/wps:Execute/wps:ResponseForm/wps:ResponseDocument'</span><span class="p">):</span>
- <span class="k">for</span> <span class="n">output_el</span> <span class="ow">in</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">doc</span><span class="p">,</span> <span class="s1">'/wps:Execute/wps:ResponseForm/wps:ResponseDocument/wps:Output'</span><span class="p">):</span>
- <span class="p">[</span><span class="n">identifier_el</span><span class="p">]</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">output_el</span><span class="p">,</span> <span class="s1">'./ows:Identifier'</span><span class="p">)</span>
- <span class="n">outpt</span> <span class="o">=</span> <span class="p">{}</span>
- <span class="n">outpt</span><span class="p">[</span><span class="n">identifier_el</span><span class="o">.</span><span class="n">text</span><span class="p">]</span> <span class="o">=</span> <span class="s1">''</span>
- <span class="n">outpt</span><span class="p">[</span><span class="s1">'asReference'</span><span class="p">]</span> <span class="o">=</span> <span class="n">output_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'asReference'</span><span class="p">,</span> <span class="s1">'false'</span><span class="p">)</span>
- <span class="n">the_output</span><span class="p">[</span><span class="n">identifier_el</span><span class="o">.</span><span class="n">text</span><span class="p">]</span> <span class="o">=</span> <span class="n">outpt</span>
-
- <span class="k">elif</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">doc</span><span class="p">,</span> <span class="s1">'/wps:Execute/wps:ResponseForm/wps:RawDataOutput'</span><span class="p">):</span>
- <span class="k">for</span> <span class="n">output_el</span> <span class="ow">in</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">doc</span><span class="p">,</span> <span class="s1">'/wps:Execute/wps:ResponseForm/wps:RawDataOutput'</span><span class="p">):</span>
- <span class="p">[</span><span class="n">identifier_el</span><span class="p">]</span> <span class="o">=</span> <span class="n">xpath_ns</span><span class="p">(</span><span class="n">output_el</span><span class="p">,</span> <span class="s1">'./ows:Identifier'</span><span class="p">)</span>
- <span class="n">outpt</span> <span class="o">=</span> <span class="p">{}</span>
- <span class="n">outpt</span><span class="p">[</span><span class="n">identifier_el</span><span class="o">.</span><span class="n">text</span><span class="p">]</span> <span class="o">=</span> <span class="s1">''</span>
- <span class="n">outpt</span><span class="p">[</span><span class="s1">'mimetype'</span><span class="p">]</span> <span class="o">=</span> <span class="n">output_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'mimeType'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">outpt</span><span class="p">[</span><span class="s1">'encoding'</span><span class="p">]</span> <span class="o">=</span> <span class="n">output_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'encoding'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">outpt</span><span class="p">[</span><span class="s1">'schema'</span><span class="p">]</span> <span class="o">=</span> <span class="n">output_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'schema'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">outpt</span><span class="p">[</span><span class="s1">'uom'</span><span class="p">]</span> <span class="o">=</span> <span class="n">output_el</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'uom'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
- <span class="n">the_output</span><span class="p">[</span><span class="n">identifier_el</span><span class="o">.</span><span class="n">text</span><span class="p">]</span> <span class="o">=</span> <span class="n">outpt</span>
-
- <span class="k">return</span> <span class="n">the_output</span>
-
-
-<span class="k">def</span> <span class="nf">get_data_from_kvp</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">part</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="sd">"""Get execute DataInputs and ResponseDocument from URL (key-value-pairs) encoding</span>
-<span class="sd"> :param data: key:value pair list of the datainputs and responseDocument parameter</span>
-<span class="sd"> :param part: DataInputs or similar part of input url</span>
-<span class="sd"> """</span>
-
- <span class="n">the_data</span> <span class="o">=</span> <span class="p">{}</span>
-
- <span class="k">if</span> <span class="n">data</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">None</span>
-
- <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">";"</span><span class="p">):</span>
- <span class="k">try</span><span class="p">:</span>
- <span class="n">io</span> <span class="o">=</span> <span class="p">{}</span>
- <span class="n">fields</span> <span class="o">=</span> <span class="n">d</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">'@'</span><span class="p">)</span>
-
- <span class="c1"># First field is identifier and its value</span>
- <span class="p">(</span><span class="n">identifier</span><span class="p">,</span> <span class="n">val</span><span class="p">)</span> <span class="o">=</span> <span class="n">fields</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"="</span><span class="p">)</span>
- <span class="n">io</span><span class="p">[</span><span class="s1">'identifier'</span><span class="p">]</span> <span class="o">=</span> <span class="n">identifier</span>
- <span class="n">io</span><span class="p">[</span><span class="s1">'data'</span><span class="p">]</span> <span class="o">=</span> <span class="n">val</span>
-
- <span class="c1"># Get the attributes of the data</span>
- <span class="k">for</span> <span class="n">attr</span> <span class="ow">in</span> <span class="n">fields</span><span class="p">[</span><span class="mi">1</span><span class="p">:]:</span>
- <span class="p">(</span><span class="n">attribute</span><span class="p">,</span> <span class="n">attr_val</span><span class="p">)</span> <span class="o">=</span> <span class="n">attr</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">'='</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">attribute</span> <span class="o">==</span> <span class="s1">'xlink:href'</span><span class="p">:</span>
- <span class="n">io</span><span class="p">[</span><span class="s1">'href'</span><span class="p">]</span> <span class="o">=</span> <span class="n">attr_val</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">io</span><span class="p">[</span><span class="n">attribute</span><span class="p">]</span> <span class="o">=</span> <span class="n">attr_val</span>
-
- <span class="c1"># Add the input/output with all its attributes and values to the</span>
- <span class="c1"># dictionary</span>
- <span class="k">if</span> <span class="n">part</span> <span class="o">==</span> <span class="s1">'DataInputs'</span><span class="p">:</span>
- <span class="k">if</span> <span class="n">identifier</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">the_data</span><span class="p">:</span>
- <span class="n">the_data</span><span class="p">[</span><span class="n">identifier</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
- <span class="n">the_data</span><span class="p">[</span><span class="n">identifier</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">io</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">the_data</span><span class="p">[</span><span class="n">identifier</span><span class="p">]</span> <span class="o">=</span> <span class="n">io</span>
- <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
- <span class="n">the_data</span><span class="p">[</span><span class="n">d</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span><span class="s1">'identifier'</span><span class="p">:</span> <span class="n">d</span><span class="p">,</span> <span class="s1">'data'</span><span class="p">:</span> <span class="s1">''</span><span class="p">}</span>
-
- <span class="k">return</span> <span class="n">the_data</span>
-
-
-<span class="k">def</span> <span class="nf">_check_version</span><span class="p">(</span><span class="n">version</span><span class="p">):</span>
- <span class="sd">""" check given version</span>
-<span class="sd"> """</span>
- <span class="k">if</span> <span class="n">version</span> <span class="o">!=</span> <span class="s1">'1.0.0'</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">False</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">True</span>
-
-
-<span class="k">def</span> <span class="nf">_get_get_param</span><span class="p">(</span><span class="n">http_request</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">aslist</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
- <span class="sd">"""Returns value from the key:value pair, of the HTTP GET request, for</span>
-<span class="sd"> example 'service' or 'request'</span>
-
-<span class="sd"> :param http_request: http_request object</span>
-<span class="sd"> :param key: key value you need to dig out of the HTTP GET request</span>
-<span class="sd"> """</span>
-
- <span class="n">key</span> <span class="o">=</span> <span class="n">key</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
- <span class="n">value</span> <span class="o">=</span> <span class="n">default</span>
- <span class="c1"># http_request.args.keys will make + sign disappear in GET url if not</span>
- <span class="c1"># urlencoded</span>
- <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">http_request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
- <span class="k">if</span> <span class="n">k</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="n">key</span><span class="p">:</span>
- <span class="n">value</span> <span class="o">=</span> <span class="n">http_request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">k</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">aslist</span><span class="p">:</span>
- <span class="n">value</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">value</span>
-
-
-<span class="k">def</span> <span class="nf">_get_dataelement_value</span><span class="p">(</span><span class="n">value_el</span><span class="p">):</span>
- <span class="sd">"""Return real value of XML Element (e.g. convert Element.FeatureCollection</span>
-<span class="sd"> to String</span>
-<span class="sd"> """</span>
-
- <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value_el</span><span class="p">,</span> <span class="n">lxml</span><span class="o">.</span><span class="n">etree</span><span class="o">.</span><span class="n">_Element</span><span class="p">):</span>
- <span class="k">if</span> <span class="n">PY2</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">lxml</span><span class="o">.</span><span class="n">etree</span><span class="o">.</span><span class="n">tostring</span><span class="p">(</span><span class="n">value_el</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="nb">unicode</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">lxml</span><span class="o">.</span><span class="n">etree</span><span class="o">.</span><span class="n">tostring</span><span class="p">(</span><span class="n">value_el</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="nb">str</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">value_el</span>
-
-
-<span class="k">def</span> <span class="nf">_get_rawvalue_value</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="sd">"""Return real value of CDATA section"""</span>
-
- <span class="k">try</span><span class="p">:</span>
- <span class="k">if</span> <span class="n">encoding</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> <span class="n">encoding</span> <span class="o">==</span> <span class="s2">""</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">data</span>
- <span class="k">elif</span> <span class="n">encoding</span> <span class="o">==</span> <span class="s1">'base64'</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">base64</span><span class="o">.</span><span class="n">b64decode</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">base64</span><span class="o">.</span><span class="n">b64decode</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
- <span class="k">except</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">data</span>
-
-
-<span class="k">def</span> <span class="nf">_get_reference_header</span><span class="p">(</span><span class="n">header_element</span><span class="p">):</span>
- <span class="sd">"""Parses ReferenceInput Header element</span>
-<span class="sd"> """</span>
- <span class="n">header</span> <span class="o">=</span> <span class="p">{}</span>
- <span class="n">header</span><span class="p">[</span><span class="s1">'key'</span><span class="p">]</span> <span class="o">=</span> <span class="n">header_element</span><span class="o">.</span><span class="n">attrib</span><span class="p">(</span><span class="s1">'key'</span><span class="p">)</span>
- <span class="n">header</span><span class="p">[</span><span class="s1">'value'</span><span class="p">]</span> <span class="o">=</span> <span class="n">header_element</span><span class="o">.</span><span class="n">attrib</span><span class="p">(</span><span class="s1">'value'</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">header</span>
-
-
-<span class="k">def</span> <span class="nf">_get_reference_body</span><span class="p">(</span><span class="n">body_element</span><span class="p">):</span>
- <span class="sd">"""Parses ReferenceInput Body element</span>
-<span class="sd"> """</span>
-
- <span class="n">body</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">body_element</span><span class="o">.</span><span class="n">getchildren</span><span class="p">())</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
- <span class="n">value_el</span> <span class="o">=</span> <span class="n">body_element</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
- <span class="n">body</span> <span class="o">=</span> <span class="n">_get_dataelement_value</span><span class="p">(</span><span class="n">value_el</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">body</span> <span class="o">=</span> <span class="n">_get_rawvalue_value</span><span class="p">(</span><span class="n">body_element</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">body</span>
-
-
-<span class="k">def</span> <span class="nf">_get_reference_bodyreference</span><span class="p">(</span><span class="n">referencebody_element</span><span class="p">):</span>
- <span class="sd">"""Parse ReferenceInput BodyReference element</span>
-<span class="sd"> """</span>
- <span class="k">return</span> <span class="n">referencebody_element</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
- <span class="s1">'{http://www.w3.org/1999/xlink}href'</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../../index.html">
- <img class="logo" src="../../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/app/WPSResponse.html b/docs/_build/html/_modules/pywps/app/WPSResponse.html
deleted file mode 100644
index 3a67c6e..0000000
--- a/docs/_build/html/_modules/pywps/app/WPSResponse.html
+++ /dev/null
@@ -1,309 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.app.WPSResponse — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../../index.html" />
- <link rel="up" title="Module code" href="../../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.app.WPSResponse</h1><div class="highlight"><pre>
-<span class="kn">import</span> <span class="nn">os</span>
-<span class="kn">from</span> <span class="nn">lxml</span> <span class="kn">import</span> <span class="n">etree</span>
-<span class="kn">import</span> <span class="nn">time</span>
-<span class="kn">from</span> <span class="nn">werkzeug.wrappers</span> <span class="kn">import</span> <span class="n">Request</span>
-<span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">HTTPException</span>
-<span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">WPS</span><span class="p">,</span> <span class="n">OWS</span>
-<span class="kn">from</span> <span class="nn">pywps.app.basic</span> <span class="kn">import</span> <span class="n">xml_response</span>
-<span class="kn">from</span> <span class="nn">pywps.exceptions</span> <span class="kn">import</span> <span class="n">NoApplicableCode</span>
-<span class="kn">import</span> <span class="nn">pywps.configuration</span> <span class="kn">as</span> <span class="nn">config</span>
-<span class="kn">from</span> <span class="nn">pywps.dblog</span> <span class="kn">import</span> <span class="n">update_response</span>
-<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">namedtuple</span>
-
-<span class="n">_STATUS</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s1">'Status'</span><span class="p">,</span> <span class="s1">'NO_STATUS, STORE_STATUS,'</span>
- <span class="s1">'STORE_AND_UPDATE_STATUS, DONE_STATUS'</span><span class="p">)</span>
-
-<span class="n">STATUS</span> <span class="o">=</span> <span class="n">_STATUS</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-
-<div class="viewcode-block" id="WPSResponse"><a class="viewcode-back" href="../../../api.html#pywps.app.WPSResponse.WPSResponse">[docs]</a><span class="k">class</span> <span class="nc">WPSResponse</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">process</span><span class="p">,</span> <span class="n">wps_request</span><span class="p">,</span> <span class="n">uuid</span><span class="p">):</span>
- <span class="sd">"""constructor</span>
-
-<span class="sd"> :param pywps.app.Process.Process process:</span>
-<span class="sd"> :param pywps.app.WPSRequest.WPSRequest wps_request:</span>
-<span class="sd"> :param uuid: string this request uuid</span>
-<span class="sd"> """</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">process</span> <span class="o">=</span> <span class="n">process</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">wps_request</span> <span class="o">=</span> <span class="n">wps_request</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">outputs</span> <span class="o">=</span> <span class="p">{</span><span class="n">o</span><span class="o">.</span><span class="n">identifier</span><span class="p">:</span> <span class="n">o</span> <span class="k">for</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">process</span><span class="o">.</span><span class="n">outputs</span><span class="p">}</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">message</span> <span class="o">=</span> <span class="s1">''</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">STATUS</span><span class="o">.</span><span class="n">NO_STATUS</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">status_percentage</span> <span class="o">=</span> <span class="mi">0</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">doc</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">uuid</span> <span class="o">=</span> <span class="n">uuid</span>
-
-<div class="viewcode-block" id="WPSResponse.update_status"><a class="viewcode-back" href="../../../api.html#pywps.app.WPSResponse.WPSResponse.update_status">[docs]</a> <span class="k">def</span> <span class="nf">update_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">message</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">status_percentage</span><span class="o">=</span><span cla [...]
- <span class="n">clean</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> Update status report of currently running process instance</span>
-
-<span class="sd"> :param str message: Message you need to share with the client</span>
-<span class="sd"> :param int status_percentage: Percent done (number betwen <0-100>)</span>
-<span class="sd"> :param pywps.app.WPSResponse.STATUS status: process status - user should usually</span>
-<span class="sd"> ommit this parameter</span>
-<span class="sd"> """</span>
-
- <span class="k">if</span> <span class="n">message</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">message</span> <span class="o">=</span> <span class="n">message</span>
-
- <span class="k">if</span> <span class="n">status</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">status</span>
-
- <span class="k">if</span> <span class="n">status_percentage</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">status_percentage</span> <span class="o">=</span> <span class="n">status_percentage</span>
-
- <span class="c1"># check if storing of the status is requested</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">>=</span> <span class="n">STATUS</span><span class="o">.</span><span class="n">STORE_AND_UPDATE_STATUS</span><span class="p">:</span>
-
- <span class="c1"># rebuild the doc and update the status xml file</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">doc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_construct_doc</span><span class="p">()</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">write_response_doc</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">doc</span><span class="p">,</span> <span class="n">clean</span><span class="p">)</span>
-
- <span class="n">update_response</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">uuid</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span></div>
-
- <span class="k">def</span> <span class="nf">write_response_doc</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">doc</span><span class="p">,</span> <span class="n">clean</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
- <span class="c1"># TODO: check if file/directory is still present, maybe deleted in mean time</span>
-
- <span class="k">try</span><span class="p">:</span>
- <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">status_location</span><span class="p">,</span> <span class="s1">'w'</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
- <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">etree</span><span class="o">.</span><span class="n">tostring</span><span class="p">(</span><span class="n">doc</span><span class="p">,</span> <span class="n">pretty_print</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s1">'utf-8'</span><span class= [...]
- <span class="n">f</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span>
- <span class="n">os</span><span class="o">.</span><span class="n">fsync</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">fileno</span><span class="p">())</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">>=</span> <span class="n">STATUS</span><span class="o">.</span><span class="n">DONE_STATUS</span> <span class="ow">and</span> <span class="n">clean</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">clean</span><span class="p">()</span>
-
- <span class="k">except</span> <span class="ne">IOError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">NoApplicableCode</span><span class="p">(</span><span class="s1">'Writing Response Document failed with : </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="n">e</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">_process_accepted</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Status</span><span class="p">(</span>
- <span class="n">WPS</span><span class="o">.</span><span class="n">ProcessAccepted</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">message</span><span class="p">),</span>
- <span class="n">creationTime</span><span class="o">=</span><span class="n">time</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1">T%H:%M:%SZ'</span><span class="p">,</span> <span class="n">time</span><span class="o">.</span><span class="n">localtime</span><span class="p">())</span>
- <span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">_process_started</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Status</span><span class="p">(</span>
- <span class="n">WPS</span><span class="o">.</span><span class="n">ProcessStarted</span><span class="p">(</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">message</span><span class="p">,</span>
- <span class="n">percentCompleted</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">status_percentage</span><span class="p">)</span>
- <span class="p">),</span>
- <span class="n">creationTime</span><span class="o">=</span><span class="n">time</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1">T%H:%M:%SZ'</span><span class="p">,</span> <span class="n">time</span><span class="o">.</span><span class="n">localtime</span><span class="p">())</span>
- <span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">_process_paused</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Status</span><span class="p">(</span>
- <span class="n">WPS</span><span class="o">.</span><span class="n">ProcessPaused</span><span class="p">(</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">message</span><span class="p">,</span>
- <span class="n">percentCompleted</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">status_percentage</span><span class="p">)</span>
- <span class="p">),</span>
- <span class="n">creationTime</span><span class="o">=</span><span class="n">time</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1">T%H:%M:%SZ'</span><span class="p">,</span> <span class="n">time</span><span class="o">.</span><span class="n">localtime</span><span class="p">())</span>
- <span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">_process_succeeded</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Status</span><span class="p">(</span>
- <span class="n">WPS</span><span class="o">.</span><span class="n">ProcessSucceeded</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">message</span><span class="p">),</span>
- <span class="n">creationTime</span><span class="o">=</span><span class="n">time</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1">T%H:%M:%SZ'</span><span class="p">,</span> <span class="n">time</span><span class="o">.</span><span class="n">localtime</span><span class="p">())</span>
- <span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">_process_failed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Status</span><span class="p">(</span>
- <span class="n">WPS</span><span class="o">.</span><span class="n">ProcessFailed</span><span class="p">(</span>
- <span class="n">WPS</span><span class="o">.</span><span class="n">ExceptionReport</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Exception</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Exception</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">message</span><span class="p">),</span>
- <span class="n">exceptionCode</span><span class="o">=</span><span class="s1">'NoApplicableCode'</span><span class="p">,</span>
- <span class="n">locater</span><span class="o">=</span><span class="s1">'None'</span>
- <span class="p">)</span>
- <span class="p">)</span>
- <span class="p">),</span>
- <span class="n">creationTime</span><span class="o">=</span><span class="n">time</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1">T%H:%M:%SZ'</span><span class="p">,</span> <span class="n">time</span><span class="o">.</span><span class="n">localtime</span><span class="p">())</span>
- <span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">_construct_doc</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">ExecuteResponse</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{http://www.w3.org/2001/XMLSchema-instance}schemaLocation'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsExecute_response.xsd'</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'service'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'WPS'</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'version'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'1.0.0'</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{http://www.w3.org/XML/1998/namespace}lang'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'en-US'</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'serviceInstance'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'</span><span class="si">%s%s</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span>
- <span class="n">config</span><span class="o">.</span><span class="n">get_config_value</span><span class="p">(</span><span class="s1">'server'</span><span class="p">,</span> <span class="s1">'url'</span><span class="p">),</span>
- <span class="s1">'?service=WPS&request=GetCapabilities'</span>
- <span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">>=</span> <span class="n">STATUS</span><span class="o">.</span><span class="n">STORE_STATUS</span><span class="p">:</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">status_location</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'statusLocation'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">status_url</span>
-
- <span class="c1"># Process XML</span>
- <span class="n">process_doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Process</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">process_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
- <span class="c1"># TODO: See Table 32 Metadata in OGC 06-121r3</span>
- <span class="c1">#for m in self.process.metadata:</span>
- <span class="c1"># process_doc.append(OWS.Metadata(m))</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">profile</span><span class="p">:</span>
- <span class="n">process_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Profile</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">profile</span><span class="p">))</span>
- <span class="n">process_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{http://www.opengis.net/wps/1.0.0}processVersion'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">version</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">process_doc</span><span class="p">)</span>
-
- <span class="c1"># Status XML</span>
- <span class="c1"># return the correct response depending on the progress of the process</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">>=</span> <span class="n">STATUS</span><span class="o">.</span><span class="n">STORE_AND_UPDATE_STATUS</span><span class="p">:</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status_percentage</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">message</span> <span class="o">=</span> <span class="s1">'PyWPS Process </span><span class="si">%s</span><span class="s1"> accepted'</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">identifier</span>
- <span class="n">status_doc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_process_accepted</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">status_doc</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">write_response_doc</span><span class="p">(</span><span class="n">doc</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">doc</span>
- <span class="k">elif</span> <span class="mi">0</span> <span class="o"><</span> <span class="bp">self</span><span class="o">.</span><span class="n">status_percentage</span> <span class="o"><</span> <span class="mi">100</span><span class="p">:</span>
- <span class="n">status_doc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_process_started</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">status_doc</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="c1"># check if process failed and display fail message</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status_percentage</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
- <span class="n">status_doc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_process_failed</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">status_doc</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="c1"># TODO: add paused status</span>
-
- <span class="n">status_doc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_process_succeeded</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">status_doc</span><span class="p">)</span>
-
- <span class="c1"># DataInputs and DataOutputs definition XML if lineage=true</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">wps_request</span><span class="o">.</span><span class="n">lineage</span> <span class="o">==</span> <span class="s1">'true'</span><span class="p">:</span>
- <span class="n">data_inputs</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">wps_request</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">execute_xml</span><span class="p">()</span> <span class="k">for</span> <span class="n">i</span> [...]
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">WPS</span><span class="o">.</span><span class="n">DataInputs</span><span class="p">(</span><span class="o">*</span><span class="n">data_inputs</span><span class="p">))</span>
-
- <span class="n">output_definitions</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">outputs</span><span class="p">[</span><span class="n">o</span><span class="p">]</span><span class="o">.</span><span class="n">execute_xml_lineage</span><span class="p">()</span> <span class="k">for</span> <span class="n">o</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class= [...]
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">WPS</span><span class="o">.</span><span class="n">OutputDefinitions</span><span class="p">(</span><span class="o">*</span><span class="n">output_definitions</span><span class="p">))</span>
-
- <span class="c1"># Process outputs XML</span>
- <span class="n">output_elements</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">outputs</span><span class="p">[</span><span class="n">o</span><span class="p">]</span><span class="o">.</span><span class="n">execute_xml</span><span class="p">()</span> <span class="k">for</span> <span class="n">o</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">outputs</sp [...]
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">WPS</span><span class="o">.</span><span class="n">ProcessOutputs</span><span class="p">(</span><span class="o">*</span><span class="n">output_elements</span><span class="p">))</span>
- <span class="k">return</span> <span class="n">doc</span>
-
-<div class="viewcode-block" id="WPSResponse.call_on_close"><a class="viewcode-back" href="../../../api.html#pywps.app.WPSResponse.WPSResponse.call_on_close">[docs]</a> <span class="k">def</span> <span class="nf">call_on_close</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">function</span><span class="p">):</span>
- <span class="sd">"""Custom implementation of call_on_close of werkzeug</span>
-<span class="sd"> TODO: rewrite this using werkzeug's tools</span>
-<span class="sd"> """</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_close_functions</span><span class="o">.</span><span class="n">push</span><span class="p">(</span><span class="n">function</span><span class="p">)</span></div>
-
- <span class="nd">@Request.application</span>
- <span class="k">def</span> <span class="nf">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">request</span><span class="p">):</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="k">try</span><span class="p">:</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_construct_doc</span><span class="p">()</span>
- <span class="k">except</span> <span class="n">HTTPException</span> <span class="k">as</span> <span class="n">httpexp</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">httpexp</span>
- <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">exp</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">NoApplicableCode</span><span class="p">(</span><span class="n">exp</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">>=</span> <span class="n">STATUS</span><span class="o">.</span><span class="n">DONE_STATUS</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">process</span><span class="o">.</span><span class="n">clean</span><span class="p">()</span>
-
- <span class="k">return</span> <span class="n">xml_response</span><span class="p">(</span><span class="n">doc</span><span class="p">)</span></div>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../../index.html">
- <img class="logo" src="../../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/exceptions.html b/docs/_build/html/_modules/pywps/exceptions.html
deleted file mode 100644
index c237c8a..0000000
--- a/docs/_build/html/_modules/pywps/exceptions.html
+++ /dev/null
@@ -1,255 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.exceptions — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../index.html" />
- <link rel="up" title="Module code" href="../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.exceptions</h1><div class="highlight"><pre>
-<span class="sd">"""</span>
-<span class="sd">OGC OWS and WPS Exceptions</span>
-
-<span class="sd">Based on OGC OWS, WPS and</span>
-
-<span class="sd">http://lists.opengeospatial.org/pipermail/wps-dev/2013-October/000335.html</span>
-<span class="sd">"""</span>
-<span class="c1"># Author: Alex Morega & Calin Ciociu</span>
-<span class="c1"># </span>
-<span class="c1"># License:</span>
-<span class="c1">#</span>
-<span class="c1"># Web Processing Service implementation</span>
-<span class="c1"># Copyright (C) 2015 PyWPS Development Team, represented by Jachym Cepicky</span>
-<span class="c1">#</span>
-<span class="c1"># Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="c1"># of this software and associated documentation files (the "Software"), to</span>
-<span class="c1"># deal in the Software without restriction, including without limitation the</span>
-<span class="c1"># rights to use, copy, modify, merge, publish, distribute, sublicense, and/or</span>
-<span class="c1"># sell copies of the Software, and to permit persons to whom the Software is</span>
-<span class="c1"># furnished to do so, subject to the following conditions:</span>
-<span class="c1"># </span>
-<span class="c1"># The above copyright notice and this permission notice shall be included in</span>
-<span class="c1"># all copies or substantial portions of the Software.</span>
-<span class="c1"># </span>
-<span class="c1"># THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="c1"># IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="c1"># FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="c1"># AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="c1"># LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
-<span class="c1"># FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS</span>
-<span class="c1"># IN THE SOFTWARE.</span>
-
-<span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">HTTPException</span><span class="p">,</span> <span class="n">BadRequest</span><span class="p">,</span> <span class="n">MethodNotAllowed</span>
-<span class="kn">from</span> <span class="nn">werkzeug._compat</span> <span class="kn">import</span> <span class="n">text_type</span>
-<span class="kn">from</span> <span class="nn">werkzeug.utils</span> <span class="kn">import</span> <span class="n">escape</span>
-<span class="kn">from</span> <span class="nn">werkzeug.http</span> <span class="kn">import</span> <span class="n">HTTP_STATUS_CODES</span>
-
-<span class="kn">import</span> <span class="nn">logging</span>
-
-<span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">__version__</span>
-
-<span class="c1">#logging.basicConfig()</span>
-<span class="n">LOGGER</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">'PYWPS'</span><span class="p">)</span>
-
-<div class="viewcode-block" id="NoApplicableCode"><a class="viewcode-back" href="../../exceptions.html#pywps.exceptions.NoApplicableCode">[docs]</a><span class="k">class</span> <span class="nc">NoApplicableCode</span><span class="p">(</span><span class="n">HTTPException</span><span class="p">):</span>
- <span class="sd">"""No applicable code exception implementation</span>
-
-<span class="sd"> also</span>
-
-<span class="sd"> Base exception class</span>
-<span class="sd"> """</span>
-
- <span class="n">code</span> <span class="o">=</span> <span class="mi">400</span>
- <span class="n">locator</span> <span class="o">=</span> <span class="s2">""</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">locator</span><span class="o">=</span><span class="s2">""</span><span class="p">,</span> <span class="n">code</span><span class="o">=</span><span class="mi">400</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">code</span> <span class="o">=</span> <span class="n">code</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">description</span> <span class="o">=</span> <span class="n">description</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">locator</span> <span class="o">=</span> <span class="n">locator</span>
- <span class="n">msg</span> <span class="o">=</span> <span class="s1">'Exception: code: </span><span class="si">%s</span><span class="s1">, locator: </span><span class="si">%s</span><span class="s1">, description: </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">code</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span [...]
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">exception</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span>
-
- <span class="n">HTTPException</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""The status name."""</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>
-
- <span class="k">def</span> <span class="nf">get_headers</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">environ</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="sd">"""Get a list of headers."""</span>
- <span class="k">return</span> <span class="p">[(</span><span class="s1">'Content-Type'</span><span class="p">,</span> <span class="s1">'text/xml'</span><span class="p">)]</span>
-
- <span class="k">def</span> <span class="nf">get_description</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">environ</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="sd">"""Get the description."""</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">description</span><span class="p">:</span>
- <span class="k">return</span> <span class="s1">'''<ows:ExceptionText></span><span class="si">%s</span><span class="s1"></ows:ExceptionText>'''</span> <span class="o">%</span> <span class="n">escape</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">description</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="s1">''</span>
-
- <span class="k">def</span> <span class="nf">get_body</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">environ</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="sd">"""Get the XML body."""</span>
- <span class="k">return</span> <span class="n">text_type</span><span class="p">((</span>
- <span class="s1">u'<?xml version="1.0" encoding="UTF-8"?></span><span class="se">\n</span><span class="s1">'</span>
- <span class="s1">u'<!-- PyWPS </span><span class="si">%(version)s</span><span class="s1"> --></span><span class="se">\n</span><span class="s1">'</span>
- <span class="s1">u'<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd" version="1.0.0"></span><span class="se">\n</span><span class="s1">'</span>
- <span class="s1">u' <ows:Exception exceptionCode="</span><span class="si">%(name)s</span><span class="s1">" locator="</span><span class="si">%(locator)s</span><span class="s1">" ></span><span class="se">\n</span><span class="s1">'</span>
- <span class="s1">u' </span><span class="si">%(description)s</span><span class="se">\n</span><span class="s1">'</span>
- <span class="s1">u' </ows:Exception></span><span class="se">\n</span><span class="s1">'</span>
- <span class="s1">u'</ows:ExceptionReport>'</span>
- <span class="p">)</span> <span class="o">%</span> <span class="p">{</span>
- <span class="s1">'version'</span><span class="p">:</span> <span class="n">__version__</span><span class="p">,</span>
- <span class="s1">'code'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">code</span><span class="p">,</span>
- <span class="s1">'locator'</span><span class="p">:</span> <span class="n">escape</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">locator</span><span class="p">),</span>
- <span class="s1">'name'</span><span class="p">:</span> <span class="n">escape</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">),</span>
- <span class="s1">'description'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_description</span><span class="p">(</span><span class="n">environ</span><span class="p">)</span>
- <span class="p">})</span></div>
-
-
-<div class="viewcode-block" id="InvalidParameterValue"><a class="viewcode-back" href="../../exceptions.html#pywps.exceptions.InvalidParameterValue">[docs]</a><span class="k">class</span> <span class="nc">InvalidParameterValue</span><span class="p">(</span><span class="n">NoApplicableCode</span><span class="p">):</span>
- <span class="sd">"""Invalid parameter value exception implementation</span>
-<span class="sd"> """</span>
- <span class="n">code</span> <span class="o">=</span> <span class="mi">400</span></div>
-
-
-<div class="viewcode-block" id="MissingParameterValue"><a class="viewcode-back" href="../../exceptions.html#pywps.exceptions.MissingParameterValue">[docs]</a><span class="k">class</span> <span class="nc">MissingParameterValue</span><span class="p">(</span><span class="n">NoApplicableCode</span><span class="p">):</span>
- <span class="sd">"""Missing parameter value exception implementation</span>
-<span class="sd"> """</span>
- <span class="n">code</span> <span class="o">=</span> <span class="mi">400</span></div>
-
-
-<div class="viewcode-block" id="FileSizeExceeded"><a class="viewcode-back" href="../../exceptions.html#pywps.exceptions.FileSizeExceeded">[docs]</a><span class="k">class</span> <span class="nc">FileSizeExceeded</span><span class="p">(</span><span class="n">NoApplicableCode</span><span class="p">):</span>
- <span class="sd">"""File size exceeded exception implementation</span>
-<span class="sd"> """</span>
- <span class="n">code</span> <span class="o">=</span> <span class="mi">400</span></div>
-
-
-<div class="viewcode-block" id="VersionNegotiationFailed"><a class="viewcode-back" href="../../exceptions.html#pywps.exceptions.VersionNegotiationFailed">[docs]</a><span class="k">class</span> <span class="nc">VersionNegotiationFailed</span><span class="p">(</span><span class="n">NoApplicableCode</span><span class="p">):</span>
- <span class="sd">"""Version negotiation exception implementation</span>
-<span class="sd"> """</span>
- <span class="n">code</span> <span class="o">=</span> <span class="mi">400</span></div>
-
-
-<div class="viewcode-block" id="OperationNotSupported"><a class="viewcode-back" href="../../exceptions.html#pywps.exceptions.OperationNotSupported">[docs]</a><span class="k">class</span> <span class="nc">OperationNotSupported</span><span class="p">(</span><span class="n">NoApplicableCode</span><span class="p">):</span>
- <span class="sd">"""Operation not supported exception implementation</span>
-<span class="sd"> """</span>
- <span class="n">code</span> <span class="o">=</span> <span class="mi">501</span></div>
-
-
-<div class="viewcode-block" id="StorageNotSupported"><a class="viewcode-back" href="../../exceptions.html#pywps.exceptions.StorageNotSupported">[docs]</a><span class="k">class</span> <span class="nc">StorageNotSupported</span><span class="p">(</span><span class="n">NoApplicableCode</span><span class="p">):</span>
- <span class="sd">"""Storage not supported exception implementation</span>
-<span class="sd"> """</span>
- <span class="n">code</span> <span class="o">=</span> <span class="mi">400</span></div>
-
-<div class="viewcode-block" id="NotEnoughStorage"><a class="viewcode-back" href="../../exceptions.html#pywps.exceptions.NotEnoughStorage">[docs]</a><span class="k">class</span> <span class="nc">NotEnoughStorage</span><span class="p">(</span><span class="n">NoApplicableCode</span><span class="p">):</span>
- <span class="sd">"""Storage not supported exception implementation</span>
-<span class="sd"> """</span>
- <span class="n">code</span> <span class="o">=</span> <span class="mi">400</span></div>
-
-<span class="k">class</span> <span class="nc">ServerBusy</span><span class="p">(</span><span class="n">NoApplicableCode</span><span class="p">):</span>
- <span class="sd">"""Max number of operations exceeded</span>
-<span class="sd"> """</span>
-
- <span class="n">code</span> <span class="o">=</span> <span class="mi">400</span>
- <span class="n">description</span> <span class="o">=</span> <span class="s1">'Maximum number of processes exceeded'</span>
-
- <span class="k">def</span> <span class="nf">get_body</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">environ</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="sd">"""Get the XML body."""</span>
- <span class="k">return</span> <span class="n">text_type</span><span class="p">((</span>
- <span class="s1">u'<?xml version="1.0" encoding="UTF-8"?></span><span class="se">\n</span><span class="s1">'</span>
- <span class="s1">u'<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 ../../../ows/1.1.0/owsExceptionReport.xsd" version="1.0.0">'</span>
- <span class="s1">u'<ows:Exception exceptionCode="</span><span class="si">%(name)s</span><span class="s1">">'</span>
- <span class="s1">u'</span><span class="si">%(description)s</span><span class="s1">'</span>
- <span class="s1">u'</ows:Exception>'</span>
- <span class="s1">u'</ows:ExceptionReport>'</span>
- <span class="p">)</span> <span class="o">%</span> <span class="p">{</span>
- <span class="s1">'name'</span><span class="p">:</span> <span class="n">escape</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">),</span>
- <span class="s1">'description'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_description</span><span class="p">(</span><span class="n">environ</span><span class="p">)</span>
- <span class="p">})</span>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../index.html">
- <img class="logo" src="../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/inout/basic.html b/docs/_build/html/_modules/pywps/inout/basic.html
deleted file mode 100644
index 25fa10c..0000000
--- a/docs/_build/html/_modules/pywps/inout/basic.html
+++ /dev/null
@@ -1,724 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.inout.basic — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../../index.html" />
- <link rel="up" title="Module code" href="../../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.inout.basic</h1><div class="highlight"><pre>
-<span class="kn">from</span> <span class="nn">pywps._compat</span> <span class="kn">import</span> <span class="n">text_type</span><span class="p">,</span> <span class="n">StringIO</span>
-<span class="kn">import</span> <span class="nn">tempfile</span><span class="o">,</span> <span class="nn">os</span>
-<span class="kn">from</span> <span class="nn">pywps.inout.literaltypes</span> <span class="kn">import</span> <span class="n">LITERAL_DATA_TYPES</span><span class="p">,</span> <span class="n">convert</span><span class="p">,</span>\
- <span class="n">AnyValue</span><span class="p">,</span> <span class="n">AllowedValue</span><span class="p">,</span> <span class="n">make_allowedvalues</span><span class="p">,</span> <span class="n">is_anyvalue</span>
-<span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">OWS</span><span class="p">,</span> <span class="n">OGCUNIT</span><span class="p">,</span> <span class="n">NAMESPACES</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.mode</span> <span class="kn">import</span> <span class="n">MODE</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.base</span> <span class="kn">import</span> <span class="n">emptyvalidator</span>
-<span class="kn">from</span> <span class="nn">pywps.validator</span> <span class="kn">import</span> <span class="n">get_validator</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.literalvalidator</span> <span class="kn">import</span> <span class="n">validate_anyvalue</span><span class="p">,</span>\
- <span class="n">validate_allowed_values</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.allowed_value</span> <span class="kn">import</span> <span class="n">ALLOWEDVALUETYPE</span>
-<span class="kn">from</span> <span class="nn">pywps.exceptions</span> <span class="kn">import</span> <span class="n">InvalidParameterValue</span>
-<span class="kn">import</span> <span class="nn">base64</span>
-<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">namedtuple</span>
-
-<span class="n">_SOURCE_TYPE</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s1">'SOURCE_TYPE'</span><span class="p">,</span> <span class="s1">'MEMORY, FILE, STREAM, DATA'</span><span class="p">)</span>
-<span class="n">SOURCE_TYPE</span> <span class="o">=</span> <span class="n">_SOURCE_TYPE</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-
-<div class="viewcode-block" id="IOHandler"><a class="viewcode-back" href="../../../api.html#pywps.inout.basic.IOHandler">[docs]</a><span class="k">class</span> <span class="nc">IOHandler</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
- <span class="sd">"""Basic IO class. Provides functions, to accept input data in file,</span>
-<span class="sd"> memory object and stream object and give them out in all three types</span>
-
-<span class="sd"> >>> # setting up </span>
-<span class="sd"> >>> import os</span>
-<span class="sd"> >>> from io import RawIOBase</span>
-<span class="sd"> >>> from io import FileIO</span>
-<span class="sd"> >>> import types</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> ioh_file = IOHandler(workdir=tmp)</span>
-<span class="sd"> >>> assert isinstance(ioh_file, IOHandler)</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> # Create test file input</span>
-<span class="sd"> >>> fileobj = open(os.path.join(tmp, 'myfile.txt'), 'w')</span>
-<span class="sd"> >>> fileobj.write('ASDF ASFADSF ASF ASF ASDF ASFASF')</span>
-<span class="sd"> >>> fileobj.close()</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> # testing file object on input</span>
-<span class="sd"> >>> ioh_file.file = fileobj.name</span>
-<span class="sd"> >>> assert ioh_file.source_type == SOURCE_TYPE.FILE</span>
-<span class="sd"> >>> file = ioh_file.file</span>
-<span class="sd"> >>> stream = ioh_file.stream</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> assert file == fileobj.name</span>
-<span class="sd"> >>> assert isinstance(stream, RawIOBase)</span>
-<span class="sd"> >>> # skipped assert isinstance(ioh_file.memory_object, POSH)</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> # testing stream object on input</span>
-<span class="sd"> >>> ioh_stream = IOHandler(workdir=tmp)</span>
-<span class="sd"> >>> assert ioh_stream.workdir == tmp</span>
-<span class="sd"> >>> ioh_stream.stream = FileIO(fileobj.name,'r')</span>
-<span class="sd"> >>> assert ioh_stream.source_type == SOURCE_TYPE.STREAM</span>
-<span class="sd"> >>> file = ioh_stream.file</span>
-<span class="sd"> >>> stream = ioh_stream.stream</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> assert open(file).read() == ioh_file.stream.read()</span>
-<span class="sd"> >>> assert isinstance(stream, RawIOBase)</span>
-<span class="sd"> >>> # skipped assert isinstance(ioh_stream.memory_object, POSH)</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> # testing in memory object object on input</span>
-<span class="sd"> >>> # skipped ioh_mo = IOHandler(workdir=tmp)</span>
-<span class="sd"> >>> # skipped ioh_mo.memory_object = POSH</span>
-<span class="sd"> >>> # skipped assert ioh_mo.source_type == SOURCE_TYPE.MEMORY</span>
-<span class="sd"> >>> # skipped file = ioh_mo.file</span>
-<span class="sd"> >>> # skipped stream = ioh_mo.stream</span>
-<span class="sd"> >>> # skipped posh = ioh_mo.memory_object</span>
-<span class="sd"> >>> #</span>
-<span class="sd"> >>> # skipped assert open(file).read() == ioh_file.stream.read()</span>
-<span class="sd"> >>> # skipped assert isinstance(ioh_mo.stream, RawIOBase)</span>
-<span class="sd"> >>> # skipped assert isinstance(ioh_mo.memory_object, POSH)</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_tempfile</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span> <span class="o">=</span> <span class="n">workdir</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">valid_mode</span> <span class="o">=</span> <span class="n">mode</span>
-
- <span class="k">def</span> <span class="nf">_check_valid</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Validate this input usig given validator</span>
-<span class="sd"> """</span>
-
- <span class="n">validate</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">validator</span>
- <span class="n">_valid</span> <span class="o">=</span> <span class="n">validate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">valid_mode</span><span class="p">)</span>
- <span class="k">if</span> <span class="ow">not</span> <span class="n">_valid</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">InvalidParameterValue</span><span class="p">(</span><span class="s1">'Input data not valid using '</span>
- <span class="s1">'mode </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">valid_mode</span><span class="p">))</span>
-
- <span class="k">def</span> <span class="nf">set_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span>
- <span class="sd">"""Set source as file name"""</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">=</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">FILE</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_check_valid</span><span class="p">()</span>
-
- <span class="k">def</span> <span class="nf">set_workdir</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdirpath</span><span class="p">):</span>
- <span class="sd">"""Set working temporary directory for files to be stored in"""</span>
-
- <span class="k">if</span> <span class="n">workdirpath</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">workdirpath</span><span class="p">):</span>
- <span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">workdirpath</span><span class="p">)</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">_workdir</span> <span class="o">=</span> <span class="n">workdirpath</span>
-
-
- <span class="k">def</span> <span class="nf">set_memory_object</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">memory_object</span><span class="p">):</span>
- <span class="sd">"""Set source as in memory object"""</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">=</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">MEMORY</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_check_valid</span><span class="p">()</span>
-
- <span class="k">def</span> <span class="nf">set_stream</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">stream</span><span class="p">):</span>
- <span class="sd">"""Set source as stream object"""</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">=</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">STREAM</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="n">stream</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_check_valid</span><span class="p">()</span>
-
- <span class="k">def</span> <span class="nf">set_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
- <span class="sd">"""Set source as simple datatype e.g. string, number"""</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">=</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">DATA</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="n">data</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_check_valid</span><span class="p">()</span>
-
- <span class="k">def</span> <span class="nf">set_base64</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
- <span class="sd">"""Set data encoded in base64"""</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">base64</span><span class="o">.</span><span class="n">b64decode</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_check_valid</span><span class="p">()</span>
-
- <span class="k">def</span> <span class="nf">get_file</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get source as file name"""</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">FILE</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">source</span>
-
- <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">STREAM</span> <span class="ow">or</span>\
- <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">DATA</span><span class="p">:</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_tempfile</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_tempfile</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="p">(</span><span class="n">opening</span><span class="p">,</span> <span class="n">stream_file_name</span><span class="p">)</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkstemp</span><span class="p">(</span><span class="nb">dir</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">)</span>
- <span class="n">stream_file</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">stream_file_name</span><span class="p">,</span> <span class="s1">'w'</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">STREAM</span><span class="p">:</span>
- <span class="n">stream_file</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">source</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">stream_file</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">source</span><span class="p">)</span>
-
- <span class="n">stream_file</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_tempfile</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">stream_file_name</span><span class="p">)</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_tempfile</span>
-
- <span class="k">def</span> <span class="nf">get_workdir</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return working directory name</span>
-<span class="sd"> """</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_workdir</span>
-
- <span class="k">def</span> <span class="nf">get_memory_object</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get source as memory object"""</span>
- <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s2">"setmemory_object not implemented, Soeren promissed to implement at WPS Workshop on 23rd of January 2014"</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">get_stream</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get source as stream object"""</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">FILE</span><span class="p">:</span>
- <span class="kn">from</span> <span class="nn">io</span> <span class="kn">import</span> <span class="n">FileIO</span>
- <span class="k">return</span> <span class="n">FileIO</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">source</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">'r'</span><span class="p">,</span> <span class="n">closefd</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
- <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">STREAM</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">source</span>
- <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">DATA</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">StringIO</span><span class="p">(</span><span class="n">text_type</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">source</span><span class="p">))</span>
-
- <span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get source as simple data object"""</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">FILE</span><span class="p">:</span>
- <span class="n">file_handler</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">source</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">'r'</span><span class="p">)</span>
- <span class="n">content</span> <span class="o">=</span> <span class="n">file_handler</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
- <span class="n">file_handler</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
- <span class="k">return</span> <span class="n">content</span>
- <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">STREAM</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">source</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
- <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">DATA</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">source</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">validator</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return the function suitable for validation</span>
-<span class="sd"> This method should be overridden by class children</span>
-
-<span class="sd"> :return: validating function</span>
-<span class="sd"> """</span>
-
- <span class="k">return</span> <span class="n">emptyvalidator</span>
-
- <span class="k">def</span> <span class="nf">get_base64</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="n">base64</span><span class="o">.</span><span class="n">b64encode</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
-
- <span class="c1"># Properties</span>
- <span class="nb">file</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">fget</span><span class="o">=</span><span class="n">get_file</span><span class="p">,</span> <span class="n">fset</span><span class="o">=</span><span class="n">set_file</span><span class="p">)</span>
- <span class="n">memory_object</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">fget</span><span class="o">=</span><span class="n">get_memory_object</span><span class="p">,</span> <span class="n">fset</span><span class="o">=</span><span class="n">set_memory_object</span><span class="p">)</span>
- <span class="n">stream</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">fget</span><span class="o">=</span><span class="n">get_stream</span><span class="p">,</span> <span class="n">fset</span><span class="o">=</span><span class="n">set_stream</span><span class="p">)</span>
- <span class="n">data</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">fget</span><span class="o">=</span><span class="n">get_data</span><span class="p">,</span> <span class="n">fset</span><span class="o">=</span><span class="n">set_data</span><span class="p">)</span>
- <span class="n">base64</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">fget</span><span class="o">=</span><span class="n">get_base64</span><span class="p">,</span> <span class="n">fset</span><span class="o">=</span><span class="n">set_base64</span><span class="p">)</span>
- <span class="n">workdir</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">fget</span><span class="o">=</span><span class="n">get_workdir</span><span class="p">,</span> <span class="n">fset</span><span class="o">=</span><span class="n">set_workdir</span><span class="p">)</span></div>
-
-
-<span class="k">class</span> <span class="nc">SimpleHandler</span><span class="p">(</span><span class="n">IOHandler</span><span class="p">):</span>
- <span class="sd">"""Data handler for Literal In- and Outputs</span>
-
-<span class="sd"> >>> class Int_type(object):</span>
-<span class="sd"> ... @staticmethod</span>
-<span class="sd"> ... def convert(value): return int(value)</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> class MyValidator(object):</span>
-<span class="sd"> ... @staticmethod</span>
-<span class="sd"> ... def validate(inpt): return 0 < inpt.data < 3</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> inpt = SimpleHandler(data_type = Int_type)</span>
-<span class="sd"> >>> inpt.validator = MyValidator</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> inpt.data = 1</span>
-<span class="sd"> >>> inpt.validator.validate(inpt)</span>
-<span class="sd"> True</span>
-<span class="sd"> >>> inpt.data = 5</span>
-<span class="sd"> >>> inpt.validator.validate(inpt)</span>
-<span class="sd"> False</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">data_type</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span c [...]
- <span class="n">IOHandler</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="n">workdir</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">data_type</span> <span class="o">=</span> <span class="n">data_type</span>
-
- <span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="n">IOHandler</span><span class="o">.</span><span class="n">get_data</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">set_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
- <span class="sd">"""Set data value. input data are converted into target format</span>
-<span class="sd"> """</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_type</span><span class="p">:</span>
- <span class="n">data</span> <span class="o">=</span> <span class="n">convert</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data_type</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span>
-
- <span class="n">IOHandler</span><span class="o">.</span><span class="n">set_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span>
-
- <span class="n">data</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">fget</span><span class="o">=</span><span class="n">get_data</span><span class="p">,</span> <span class="n">fset</span><span class="o">=</span><span class="n">set_data</span><span class="p">)</span>
-
-
-<span class="k">class</span> <span class="nc">BasicIO</span><span class="p">:</span>
- <span class="sd">"""Basic Input or Ouput class</span>
-<span class="sd"> """</span>
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">identifier</span> <span class="o">=</span> <span class="n">identifier</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">title</span> <span class="o">=</span> <span class="n">title</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span> <span class="o">=</span> <span class="n">abstract</span>
-
-<span class="k">class</span> <span class="nc">BasicLiteral</span><span class="p">:</span>
- <span class="sd">"""Basic literal input/output class</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data_type</span><span class="o">=</span><span class="s2">"integer"</span><span class="p">,</span> <span class="n">uoms</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="k">assert</span> <span class="n">data_type</span> <span class="ow">in</span> <span class="n">LITERAL_DATA_TYPES</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">data_type</span> <span class="o">=</span> <span class="n">data_type</span>
- <span class="c1"># list of uoms</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">uoms</span> <span class="o">=</span> <span class="p">[]</span>
- <span class="c1"># current uom</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_uom</span> <span class="o">=</span> <span class="bp">None</span>
-
- <span class="c1"># add all uoms (upcasting to UOM)</span>
- <span class="k">if</span> <span class="n">uoms</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
- <span class="k">for</span> <span class="n">uom</span> <span class="ow">in</span> <span class="n">uoms</span><span class="p">:</span>
- <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">uom</span><span class="p">,</span> <span class="n">UOM</span><span class="p">):</span>
- <span class="n">uom</span> <span class="o">=</span> <span class="n">UOM</span><span class="p">(</span><span class="n">uom</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">uoms</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">uom</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">uoms</span><span class="p">:</span>
- <span class="c1"># default/current uom</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">uom</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">uoms</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
-
-
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">uom</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_uom</span>
-
- <span class="nd">@uom.setter</span>
- <span class="k">def</span> <span class="nf">uom</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">uom</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_uom</span> <span class="o">=</span> <span class="n">uom</span>
-
-
-<span class="k">class</span> <span class="nc">BasicComplex</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
- <span class="sd">"""Basic complex input/output class</span>
-
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data_format</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">supported_formats</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_data_format</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_supported_formats</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="k">if</span> <span class="n">supported_formats</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">supported_formats</span> <span class="o">=</span> <span class="n">supported_formats</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">supported_formats</span><span class="p">:</span>
- <span class="c1"># not an empty list, set the default/current format to the first</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span> <span class="o">=</span> <span class="n">supported_formats</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
-
- <span class="k">def</span> <span class="nf">get_format</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mime_type</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> :param mime_type: given mimetype</span>
-<span class="sd"> :return: Format</span>
-<span class="sd"> """</span>
-
- <span class="k">for</span> <span class="n">frmt</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">supported_formats</span><span class="p">:</span>
- <span class="k">if</span> <span class="n">frmt</span><span class="o">.</span><span class="n">mime_type</span> <span class="o">==</span> <span class="n">mime_type</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">frmt</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">None</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">validator</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return the proper validator for given data_format</span>
-<span class="sd"> """</span>
-
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">validate</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">supported_formats</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_supported_formats</span>
-
- <span class="nd">@supported_formats.setter</span>
- <span class="k">def</span> <span class="nf">supported_formats</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">supported_formats</span><span class="p">):</span>
- <span class="sd">"""Setter of supported formats</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">set_format_validator</span><span class="p">(</span><span class="n">supported_format</span><span class="p">):</span>
- <span class="k">if</span> <span class="ow">not</span> <span class="n">supported_format</span><span class="o">.</span><span class="n">validate</span> <span class="ow">or</span> \
- <span class="n">supported_format</span><span class="o">.</span><span class="n">validate</span> <span class="o">==</span> <span class="n">emptyvalidator</span><span class="p">:</span>
- <span class="n">supported_format</span><span class="o">.</span><span class="n">validate</span> <span class="o">=</span>\
- <span class="n">get_validator</span><span class="p">(</span><span class="n">supported_format</span><span class="o">.</span><span class="n">mime_type</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">supported_format</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">_supported_formats</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">set_format_validator</span><span class="p">,</span> <span class="n">supported_formats</span><span class="p">))</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">data_format</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_data_format</span>
-
-
- <span class="nd">@data_format.setter</span>
- <span class="k">def</span> <span class="nf">data_format</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data_format</span><span class="p">):</span>
- <span class="sd">"""self data_format setter</span>
-<span class="sd"> """</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_is_supported</span><span class="p">(</span><span class="n">data_format</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_data_format</span> <span class="o">=</span> <span class="n">data_format</span>
- <span class="k">if</span> <span class="ow">not</span> <span class="n">data_format</span><span class="o">.</span><span class="n">validate</span> <span class="ow">or</span>\
- <span class="n">data_format</span><span class="o">.</span><span class="n">validate</span> <span class="o">==</span> <span class="n">emptyvalidator</span><span class="p">:</span>
- <span class="n">data_format</span><span class="o">.</span><span class="n">validate</span> <span class="o">=</span> <span class="n">get_validator</span><span class="p">(</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">InvalidParameterValue</span><span class="p">(</span><span class="s2">"Requested format "</span>
- <span class="s2">"</span><span class="si">%s</span><span class="s2">, </span><span class="si">%s</span><span class="s2">, </span><span class="si">%s</span><span class="s2"> not supported"</span> <span class="o">%</span>\
- <span class="p">(</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span><span class="p">,</span>
- <span class="n">data_format</span><span class="o">.</span><span class="n">encoding</span><span class="p">,</span>
- <span class="n">data_format</span><span class="o">.</span><span class="n">schema</span><span class="p">),</span>
- <span class="s1">'mimeType'</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">_is_supported</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data_format</span><span class="p">):</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">supported_formats</span><span class="p">:</span>
- <span class="k">for</span> <span class="n">frmt</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">supported_formats</span><span class="p">:</span>
- <span class="k">if</span> <span class="n">frmt</span><span class="o">.</span><span class="n">same_as</span><span class="p">(</span><span class="n">data_format</span><span class="p">):</span>
- <span class="k">return</span> <span class="bp">True</span>
-
- <span class="k">return</span> <span class="bp">False</span>
-
-
-
-<span class="k">class</span> <span class="nc">BasicBoundingBox</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
- <span class="sd">"""Basic BoundingBox input/output class</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">crss</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">dimensions</span><span class="o">=</span><span class="mi">2</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">crss</span> <span class="o">=</span> <span class="n">crss</span> <span class="ow">or</span> <span class="p">[</span><span class="s1">'epsg:4326'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">crs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">crss</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">dimensions</span> <span class="o">=</span> <span class="n">dimensions</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">ll</span> <span class="o">=</span> <span class="p">[]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">ur</span> <span class="o">=</span> <span class="p">[]</span>
-
-<span class="k">class</span> <span class="nc">LiteralInput</span><span class="p">(</span><span class="n">BasicIO</span><span class="p">,</span> <span class="n">BasicLiteral</span><span class="p">,</span> <span class="n">SimpleHandler</span><span class="p">):</span>
- <span class="sd">"""LiteralInput input abstract class</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">data_type</span><span class="o">=</span><span class="s2">"integer"</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">allowed_values</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">uoms</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="n">BasicIO</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">abstract</span><span class="p">)</span>
- <span class="n">BasicLiteral</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data_type</span><span class="p">,</span> <span class="n">uoms</span><span class="p">)</span>
- <span class="n">SimpleHandler</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdir</span><span class="p">,</span> <span class="n">data_type</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">any_value</span> <span class="o">=</span> <span class="n">is_anyvalue</span><span class="p">(</span><span class="n">allowed_values</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">allowed_values</span> <span class="o">=</span> <span class="p">[]</span>
- <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">any_value</span><span class="p">:</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">allowed_values</span> <span class="o">=</span> <span class="n">make_allowedvalues</span><span class="p">(</span><span class="n">allowed_values</span><span class="p">)</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">validator</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get validator for any value as well as allowed_values</span>
-<span class="sd"> :rtype: function</span>
-<span class="sd"> """</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">any_value</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">validate_anyvalue</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">validate_allowed_values</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get JSON representation of the input</span>
-<span class="sd"> """</span>
- <span class="k">return</span> <span class="p">{</span>
- <span class="s1">'identifier'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">,</span>
- <span class="s1">'title'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">,</span>
- <span class="s1">'abstract'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">,</span>
- <span class="s1">'type'</span><span class="p">:</span> <span class="s1">'literal'</span><span class="p">,</span>
- <span class="s1">'data_type'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_type</span><span class="p">,</span>
- <span class="s1">'workdir'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">,</span>
- <span class="s1">'allowed_values'</span><span class="p">:</span> <span class="p">[</span><span class="n">value</span><span class="o">.</span><span class="n">json</span> <span class="k">for</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">allowed_values</span><span class="p">],</span>
- <span class="s1">'uoms'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">uoms</span><span class="p">,</span>
- <span class="s1">'uom'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">uom</span><span class="p">,</span>
- <span class="s1">'mode'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">valid_mode</span><span class="p">,</span>
- <span class="s1">'data'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span>
- <span class="p">}</span>
-
-
-<span class="k">class</span> <span class="nc">LiteralOutput</span><span class="p">(</span><span class="n">BasicIO</span><span class="p">,</span> <span class="n">BasicLiteral</span><span class="p">,</span> <span class="n">SimpleHandler</span><span class="p">):</span>
- <span class="sd">"""Basic LiteralOutput class</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">data_type</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">uoms</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">validate</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="n">BasicIO</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">abstract</span><span class="p">)</span>
- <span class="n">BasicLiteral</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data_type</span><span class="p">,</span> <span class="n">uoms</span><span class="p">)</span>
- <span class="n">SimpleHandler</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">data_type</span><span class="o">=</span><span class="n">data_type</span><span class="p">,</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">_storage</span> <span class="o">=</span> <span class="bp">None</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">storage</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_storage</span>
-
- <span class="nd">@storage.setter</span>
- <span class="k">def</span> <span class="nf">storage</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">storage</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_storage</span> <span class="o">=</span> <span class="n">storage</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">validator</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get validator for any value as well as allowed_values</span>
-<span class="sd"> """</span>
-
- <span class="k">return</span> <span class="n">validate_anyvalue</span>
-
-<span class="k">class</span> <span class="nc">BBoxInput</span><span class="p">(</span><span class="n">BasicIO</span><span class="p">,</span> <span class="n">BasicBoundingBox</span><span class="p">,</span> <span class="n">IOHandler</span><span class="p">):</span>
- <span class="sd">"""Basic Bounding box input abstract class</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">crss</span><span class="o">=</span><span class="bp">None</span><s [...]
- <span class="n">dimensions</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="n">BasicIO</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">abstract</span><span class="p">)</span>
- <span class="n">BasicBoundingBox</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">crss</span><span class="p">,</span> <span class="n">dimensions</span><span class="p">)</span>
- <span class="n">IOHandler</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get JSON representation of the input. It returns following keys in</span>
-<span class="sd"> the JSON object:</span>
-
-<span class="sd"> * identifier</span>
-<span class="sd"> * title</span>
-<span class="sd"> * abstract</span>
-<span class="sd"> * type</span>
-<span class="sd"> * crs</span>
-<span class="sd"> * bbox</span>
-<span class="sd"> * dimensions</span>
-<span class="sd"> * workdir</span>
-<span class="sd"> * mode</span>
-<span class="sd"> """</span>
- <span class="k">return</span> <span class="p">{</span>
- <span class="s1">'identifier'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">,</span>
- <span class="s1">'title'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">,</span>
- <span class="s1">'abstract'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">,</span>
- <span class="s1">'type'</span><span class="p">:</span> <span class="s1">'bbox'</span><span class="p">,</span>
- <span class="s1">'crs'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">crss</span><span class="p">,</span>
- <span class="s1">'bbox'</span><span class="p">:</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">ll</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">ur</span><span class="p">),</span>
- <span class="s1">'dimensions'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">dimensions</span><span class="p">,</span>
- <span class="s1">'workdir'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">,</span>
- <span class="s1">'mode'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">valid_mode</span>
- <span class="p">}</span>
-
-
-<span class="k">class</span> <span class="nc">BBoxOutput</span><span class="p">(</span><span class="n">BasicIO</span><span class="p">,</span> <span class="n">BasicBoundingBox</span><span class="p">,</span> <span class="n">SimpleHandler</span><span class="p">):</span>
- <span class="sd">"""Basic BoundingBox output class</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">crss</span><span class="o">=</span><span class="bp">None</span><s [...]
- <span class="n">dimensions</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="n">BasicIO</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">abstract</span><span class="p">)</span>
- <span class="n">BasicBoundingBox</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">crss</span><span class="p">,</span> <span class="n">dimensions</span><span class="p">)</span>
- <span class="n">SimpleHandler</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_storage</span> <span class="o">=</span> <span class="bp">None</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">storage</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_storage</span>
-
- <span class="nd">@storage.setter</span>
- <span class="k">def</span> <span class="nf">storage</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">storage</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_storage</span> <span class="o">=</span> <span class="n">storage</span>
-
-
-<span class="k">class</span> <span class="nc">ComplexInput</span><span class="p">(</span><span class="n">BasicIO</span><span class="p">,</span> <span class="n">BasicComplex</span><span class="p">,</span> <span class="n">IOHandler</span><span class="p">):</span>
- <span class="sd">"""Complex input abstract class</span>
-
-<span class="sd"> >>> ci = ComplexInput()</span>
-<span class="sd"> >>> ci.validator = 1</span>
-<span class="sd"> >>> ci.validator</span>
-<span class="sd"> 1</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">data_format</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">supported_formats</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="n">BasicIO</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">abstract</span><span class="p">)</span>
- <span class="n">IOHandler</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="n">workdir</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
- <span class="n">BasicComplex</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data_format</span><span class="p">,</span> <span class="n">supported_formats</span><span class="p">)</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get JSON representation of the input</span>
-<span class="sd"> """</span>
- <span class="k">return</span> <span class="p">{</span>
- <span class="s1">'identifier'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">,</span>
- <span class="s1">'title'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">,</span>
- <span class="s1">'abstract'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">,</span>
- <span class="s1">'type'</span><span class="p">:</span> <span class="s1">'complex'</span><span class="p">,</span>
- <span class="s1">'data_format'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">json</span><span class="p">,</span>
- <span class="s1">'supported_formats'</span><span class="p">:</span> <span class="p">[</span><span class="n">frmt</span><span class="o">.</span><span class="n">json</span> <span class="k">for</span> <span class="n">frmt</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">supported_formats</span><span class="p">],</span>
- <span class="s1">'file'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">file</span><span class="p">,</span>
- <span class="s1">'workdir'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">,</span>
- <span class="s1">'mode'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">valid_mode</span>
- <span class="p">}</span>
-
-
-<span class="k">class</span> <span class="nc">ComplexOutput</span><span class="p">(</span><span class="n">BasicIO</span><span class="p">,</span> <span class="n">BasicComplex</span><span class="p">,</span> <span class="n">IOHandler</span><span class="p">):</span>
- <span class="sd">"""Complex output abstract class</span>
-
-<span class="sd"> >>> # temporary configuration</span>
-<span class="sd"> >>> import ConfigParser</span>
-<span class="sd"> >>> from pywps.storage import *</span>
-<span class="sd"> >>> config = ConfigParser.RawConfigParser()</span>
-<span class="sd"> >>> config.add_section('FileStorage')</span>
-<span class="sd"> >>> config.set('FileStorage', 'target', './')</span>
-<span class="sd"> >>> config.add_section('server')</span>
-<span class="sd"> >>> config.set('server', 'outputurl', 'http://foo/bar/filestorage')</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> # create temporary file</span>
-<span class="sd"> >>> tiff_file = open('file.tiff', 'w')</span>
-<span class="sd"> >>> tiff_file.write("AA")</span>
-<span class="sd"> >>> tiff_file.close()</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> co = ComplexOutput()</span>
-<span class="sd"> >>> co.set_file('file.tiff')</span>
-<span class="sd"> >>> fs = FileStorage(config)</span>
-<span class="sd"> >>> co.storage = fs</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> url = co.get_url() # get url, data are stored</span>
-<span class="sd"> >>></span>
-<span class="sd"> >>> co.get_stream().read() # get data - nothing is stored</span>
-<span class="sd"> 'AA'</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">data_format</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">supported_formats</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="n">BasicIO</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">abstract</span><span class="p">)</span>
- <span class="n">IOHandler</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="n">workdir</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
- <span class="n">BasicComplex</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data_format</span><span class="p">,</span> <span class="n">supported_formats</span><span class="p">)</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">_storage</span> <span class="o">=</span> <span class="bp">None</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">storage</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_storage</span>
-
- <span class="nd">@storage.setter</span>
- <span class="k">def</span> <span class="nf">storage</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">storage</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_storage</span> <span class="o">=</span> <span class="n">storage</span>
-
- <span class="k">def</span> <span class="nf">get_url</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return URL pointing to data</span>
-<span class="sd"> """</span>
- <span class="p">(</span><span class="n">outtype</span><span class="p">,</span> <span class="n">storage</span><span class="p">,</span> <span class="n">url</span><span class="p">)</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">storage</span><span class="o">.</span><span class="n">store</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">url</span>
-
-
-<span class="k">class</span> <span class="nc">UOM</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> :param uom: unit of measure</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">uom</span><span class="o">=</span><span class="s1">''</span><span class="p">):</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">uom</span> <span class="o">=</span> <span class="n">uom</span>
-
- <span class="k">def</span> <span class="nf">describe_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">elem</span> <span class="o">=</span> <span class="n">OWS</span><span class="o">.</span><span class="n">UOM</span><span class="p">(</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">uom</span>
- <span class="p">)</span>
-
- <span class="n">elem</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{</span><span class="si">%s</span><span class="s1">}reference'</span> <span class="o">%</span> <span class="n">NAMESPACES</span><span class="p">[</span><span class="s1">'ows'</span><span class="p">]]</span> <span class="o">=</span> <span class="n">OGCUNIT</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span cl [...]
-
- <span class="k">return</span> <span class="n">elem</span>
-
- <span class="k">def</span> <span class="nf">execute_attribute</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="n">OGCUNIT</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">uom</span><span class="p">]</span>
-
-
-<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s2">"__main__"</span><span class="p">:</span>
- <span class="kn">import</span> <span class="nn">doctest</span>
- <span class="kn">import</span> <span class="nn">os</span>
- <span class="kn">from</span> <span class="nn">pywps.wpsserver</span> <span class="kn">import</span> <span class="n">temp_dir</span>
-
- <span class="k">with</span> <span class="n">temp_dir</span><span class="p">()</span> <span class="k">as</span> <span class="n">tmp</span><span class="p">:</span>
- <span class="n">os</span><span class="o">.</span><span class="n">chdir</span><span class="p">(</span><span class="n">tmp</span><span class="p">)</span>
- <span class="n">doctest</span><span class="o">.</span><span class="n">testmod</span><span class="p">()</span>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../../index.html">
- <img class="logo" src="../../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/inout/formats.html b/docs/_build/html/_modules/pywps/inout/formats.html
deleted file mode 100644
index 2c0e233..0000000
--- a/docs/_build/html/_modules/pywps/inout/formats.html
+++ /dev/null
@@ -1,295 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.inout.formats — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../../index.html" />
- <link rel="up" title="Module code" href="../../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.inout.formats</h1><div class="highlight"><pre>
-<span class="c1"># List of known complex data formats</span>
-<span class="c1"># you can use any other, but thise are widly known and supported by polular</span>
-<span class="c1"># software packages</span>
-<span class="c1"># based on Web Processing Service Best Practices Discussion Paper, OGC 12-029</span>
-<span class="c1"># http://opengeospatial.org/standards/wps</span>
-
-<span class="sd">"""List of known mimetypes</span>
-<span class="sd">"""</span>
-
-<span class="kn">from</span> <span class="nn">lxml.builder</span> <span class="kn">import</span> <span class="n">ElementMaker</span>
-<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">namedtuple</span>
-<span class="kn">import</span> <span class="nn">mimetypes</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.mode</span> <span class="kn">import</span> <span class="n">MODE</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.base</span> <span class="kn">import</span> <span class="n">emptyvalidator</span>
-
-<span class="n">_FORMAT</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s1">'FormatDefintion'</span><span class="p">,</span> <span class="s1">'mime_type,'</span>
- <span class="s1">'extension, schema'</span><span class="p">)</span>
-<span class="n">_FORMATS</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s1">'FORMATS'</span><span class="p">,</span> <span class="s1">'GEOJSON, JSON, SHP, GML, GEOTIFF, WCS,'</span>
- <span class="s1">'WCS100, WCS110, WCS20, WFS, WFS100,'</span>
- <span class="s1">'WFS110, WFS20, WMS, WMS130, WMS110,'</span>
- <span class="s1">'WMS100'</span><span class="p">)</span>
-<span class="n">FORMATS</span> <span class="o">=</span> <span class="n">_FORMATS</span><span class="p">(</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/vnd.geo+json'</span><span class="p">,</span> <span class="s1">'.geojson'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/json'</span><span class="p">,</span> <span class="s1">'.json'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-zipped-shp'</span><span class="p">,</span> <span class="s1">'.zip'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/gml+xml'</span><span class="p">,</span> <span class="s1">'.gml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'image/tiff; subtype=geotiff'</span><span class="p">,</span> <span class="s1">'.tiff'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/xogc-wcs'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wcs; version=1.0.0'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wcs; version=1.1.0'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wcs; version=2.0'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wfs'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wfs; version=1.0.0'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wfs; version=1.1.0'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wfs; version=2.0'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wms'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wms; version=1.3.0'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wms; version=1.1.0'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
- <span class="n">_FORMAT</span><span class="p">(</span><span class="s1">'application/x-ogc-wms; version=1.0.0'</span><span class="p">,</span> <span class="s1">'.xml'</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
-<span class="p">)</span>
-
-<span class="k">def</span> <span class="nf">_get_mimetypes</span><span class="p">():</span>
- <span class="sd">"""Add FORMATS to system wide mimetypes</span>
-<span class="sd"> """</span>
- <span class="n">mimetypes</span><span class="o">.</span><span class="n">init</span><span class="p">()</span>
- <span class="k">for</span> <span class="n">pywps_format</span> <span class="ow">in</span> <span class="n">FORMATS</span><span class="p">:</span>
- <span class="n">mimetypes</span><span class="o">.</span><span class="n">add_type</span><span class="p">(</span><span class="n">pywps_format</span><span class="o">.</span><span class="n">mime_type</span><span class="p">,</span> <span class="n">pywps_format</span><span class="o">.</span><span class="n">extension</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
-<span class="n">_get_mimetypes</span><span class="p">()</span>
-
-
-<div class="viewcode-block" id="Format"><a class="viewcode-back" href="../../../api.html#pywps.Format">[docs]</a><span class="k">class</span> <span class="nc">Format</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
- <span class="sd">"""Input/output format specification</span>
-
-<span class="sd"> Predefined Formats are stored in :class:`pywps.inout.formats.FORMATS`</span>
-
-<span class="sd"> :param str mime_type: mimetype definition</span>
-<span class="sd"> :param str schema: xml schema definition</span>
-<span class="sd"> :param str encoding: base64 or not</span>
-<span class="sd"> :param function validate: function, which will perform validation. e.g.</span>
-<span class="sd"> :param number mode: validation mode</span>
-<span class="sd"> :param str extension: file extension</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mime_type</span><span class="p">,</span>
- <span class="n">schema</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">validate</span><span class="o">=</span><span class="n">emptyvalidator</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">SIMPLE</span><span class="p">,</span>
- <span class="n">extension</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="sd">"""Constructor</span>
-<span class="sd"> """</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">_mime_type</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_encoding</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_schema</span> <span class="o">=</span> <span class="bp">None</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">mime_type</span> <span class="o">=</span> <span class="n">mime_type</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">encoding</span> <span class="o">=</span> <span class="n">encoding</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">schema</span> <span class="o">=</span> <span class="n">schema</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">validate</span> <span class="o">=</span> <span class="n">validate</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">extension</span> <span class="o">=</span> <span class="n">extension</span>
-
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">mime_type</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get format mime type</span>
-<span class="sd"> :rtype: String</span>
-<span class="sd"> """</span>
-
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_mime_type</span>
-
- <span class="nd">@mime_type.setter</span>
- <span class="k">def</span> <span class="nf">mime_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mime_type</span><span class="p">):</span>
- <span class="sd">"""Set format mime type</span>
-<span class="sd"> """</span>
- <span class="k">try</span><span class="p">:</span>
- <span class="c1"># support Format('GML')</span>
- <span class="n">formatdef</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">FORMATS</span><span class="p">,</span> <span class="n">mime_type</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_mime_type</span> <span class="o">=</span> <span class="n">formatdef</span><span class="o">.</span><span class="n">mime_type</span>
- <span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
- <span class="c1"># if we don't have this as a shortcut, assume it's a real mime type</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_mime_type</span> <span class="o">=</span> <span class="n">mime_type</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">encoding</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get format encoding</span>
-<span class="sd"> :rtype: String</span>
-<span class="sd"> """</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_encoding</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_encoding</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="s1">''</span>
-
- <span class="nd">@encoding.setter</span>
- <span class="k">def</span> <span class="nf">encoding</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">encoding</span><span class="p">):</span>
- <span class="sd">"""Set format encoding</span>
-<span class="sd"> """</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">_encoding</span> <span class="o">=</span> <span class="n">encoding</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">schema</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get format schema</span>
-<span class="sd"> :rtype: String</span>
-<span class="sd"> """</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_schema</span><span class="p">:</span>
- <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_schema</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="s1">''</span>
-
- <span class="nd">@schema.setter</span>
- <span class="k">def</span> <span class="nf">schema</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">schema</span><span class="p">):</span>
- <span class="sd">"""Set format schema</span>
-<span class="sd"> """</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">_schema</span> <span class="o">=</span> <span class="n">schema</span>
-
-
- <span class="k">def</span> <span class="nf">same_as</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">frmt</span><span class="p">):</span>
- <span class="sd">"""Check input frmt, if it seems to be the same as self</span>
-<span class="sd"> """</span>
- <span class="k">return</span> <span class="n">frmt</span><span class="o">.</span><span class="n">mime_type</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">mime_type</span> <span class="ow">and</span>\
- <span class="n">frmt</span><span class="o">.</span><span class="n">encoding</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">encoding</span> <span class="ow">and</span>\
- <span class="n">frmt</span><span class="o">.</span><span class="n">schema</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema</span>
-
- <span class="k">def</span> <span class="nf">describe_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return describe process response element</span>
-<span class="sd"> """</span>
-
- <span class="n">elmar</span> <span class="o">=</span> <span class="n">ElementMaker</span><span class="p">()</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">elmar</span><span class="o">.</span><span class="n">Format</span><span class="p">(</span>
- <span class="n">elmar</span><span class="o">.</span><span class="n">MimeType</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mime_type</span><span class="p">)</span>
- <span class="p">)</span>
-
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">encoding</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">elmar</span><span class="o">.</span><span class="n">Encoding</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">encoding</span><span class="p">))</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">elmar</span><span class="o">.</span><span class="n">Schema</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">schema</span><span class="p">))</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Get format as json</span>
-<span class="sd"> :rtype: dict</span>
-<span class="sd"> """</span>
- <span class="k">return</span> <span class="p">{</span>
- <span class="s1">'mime_type'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mime_type</span><span class="p">,</span>
- <span class="s1">'encoding'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">encoding</span><span class="p">,</span>
- <span class="s1">'schema'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">schema</span><span class="p">,</span>
- <span class="s1">'extension'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">extension</span>
- <span class="p">}</span>
-
- <span class="nd">@json.setter</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">jsonin</span><span class="p">):</span>
- <span class="sd">"""Set format from json</span>
-<span class="sd"> :param jsonin:</span>
-<span class="sd"> """</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">mime_type</span> <span class="o">=</span> <span class="n">jsonin</span><span class="p">[</span><span class="s1">'mime_type'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">encoding</span> <span class="o">=</span> <span class="n">jsonin</span><span class="p">[</span><span class="s1">'encoding'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">schema</span> <span class="o">=</span> <span class="n">jsonin</span><span class="p">[</span><span class="s1">'schema'</span><span class="p">]</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">extension</span> <span class="o">=</span> <span class="n">jsonin</span><span class="p">[</span><span class="s1">'extension'</span><span class="p">]</span></div>
-
-
-<span class="k">def</span> <span class="nf">get_format</span><span class="p">(</span><span class="n">frmt</span><span class="p">,</span> <span class="n">validator</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
- <span class="sd">"""Return Format instance based on given pywps.inout.FORMATS keyword</span>
-<span class="sd"> """</span>
- <span class="c1"># TODO this should be probably removed, it's used only in tests</span>
-
- <span class="n">outfrmt</span> <span class="o">=</span> <span class="bp">None</span>
-
- <span class="k">if</span> <span class="n">frmt</span> <span class="ow">in</span> <span class="n">FORMATS</span><span class="o">.</span><span class="n">_asdict</span><span class="p">():</span>
- <span class="n">formatdef</span> <span class="o">=</span> <span class="n">FORMATS</span><span class="o">.</span><span class="n">_asdict</span><span class="p">()[</span><span class="n">frmt</span><span class="p">]</span>
- <span class="n">outfrmt</span> <span class="o">=</span> <span class="n">Format</span><span class="p">(</span><span class="o">**</span><span class="n">formatdef</span><span class="o">.</span><span class="n">_asdict</span><span class="p">())</span>
- <span class="n">outfrmt</span><span class="o">.</span><span class="n">validate</span><span class="o">=</span><span class="n">validator</span>
- <span class="k">return</span> <span class="n">outfrmt</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">Format</span><span class="p">(</span><span class="s1">'None'</span><span class="p">,</span> <span class="n">validate</span><span class="o">=</span><span class="n">validator</span><span class="p">)</span>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../../index.html">
- <img class="logo" src="../../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/inout/inputs.html b/docs/_build/html/_modules/pywps/inout/inputs.html
deleted file mode 100644
index 5a8f219..0000000
--- a/docs/_build/html/_modules/pywps/inout/inputs.html
+++ /dev/null
@@ -1,466 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.inout.inputs — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../../index.html" />
- <link rel="up" title="Module code" href="../../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.inout.inputs</h1><div class="highlight"><pre>
-<span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">configuration</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">OWS</span><span class="p">,</span> <span class="n">WPS</span><span class="p">,</span> <span class="n">OGCTYPE</span><span class="p">,</span> <span class="n">NAMESPACES</span>
-<span class="kn">from</span> <span class="nn">pywps.inout</span> <span class="kn">import</span> <span class="n">basic</span>
-<span class="kn">from</span> <span class="nn">copy</span> <span class="kn">import</span> <span class="n">deepcopy</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.mode</span> <span class="kn">import</span> <span class="n">MODE</span>
-<span class="kn">from</span> <span class="nn">pywps.inout.literaltypes</span> <span class="kn">import</span> <span class="n">AnyValue</span>
-
-
-<div class="viewcode-block" id="BoundingBoxInput"><a class="viewcode-back" href="../../../api.html#pywps.BoundingBoxInput">[docs]</a><span class="k">class</span> <span class="nc">BoundingBoxInput</span><span class="p">(</span><span class="n">basic</span><span class="o">.</span><span class="n">BBoxInput</span><span class="p">):</span>
-
- <span class="sd">"""</span>
-<span class="sd"> :param string identifier: The name of this input.</span>
-<span class="sd"> :param string title: Human readable title</span>
-<span class="sd"> :param string abstract: Longer text description</span>
-<span class="sd"> :param crss: List of supported coordinate reference system (e.g. ['EPSG:4326'])</span>
-<span class="sd"> :param int dimensions: 2 or 3</span>
-<span class="sd"> :param int min_occurs: how many times this input occurs</span>
-<span class="sd"> :param int max_occurs: how many times this input occurs</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">crss</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="s1">''</span><span class="p">,</span>
- <span class="n">dimensions</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">min_occurs</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
- <span class="n">max_occurs</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="k">if</span> <span class="n">metadata</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
- <span class="n">metadata</span> <span class="o">=</span> <span class="p">[]</span>
- <span class="n">basic</span><span class="o">.</span><span class="n">BBoxInput</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">title</span><span class="p">,</span>
- <span class="n">abstract</span><span class="o">=</span><span class="n">abstract</span><span class="p">,</span> <span class="n">crss</span><span class="o">=</span><span class="n">crss</span><span class="p">,</span>
- <span class="n">dimensions</span><span class="o">=</span><span class="n">dimensions</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="n">metadata</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">min_occurs</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">min_occurs</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">max_occurs</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">max_occurs</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">as_reference</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">def</span> <span class="nf">describe_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> :return: describeprocess response xml element</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Input</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'minOccurs'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">min_occurs</span><span class="p">)</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'maxOccurs'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">max_occurs</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Metadata</span><span class="p">(</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">))</span>
-
- <span class="n">bbox_data_doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">BoundingBoxData</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">bbox_data_doc</span><span class="p">)</span>
-
- <span class="n">default_doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Default</span><span class="p">()</span>
- <span class="n">default_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">E</span><span class="o">.</span><span class="n">CRS</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">crss</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span>
-
- <span class="n">supported_doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Supported</span><span class="p">()</span>
- <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">crss</span><span class="p">:</span>
- <span class="n">supported_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">E</span><span class="o">.</span><span class="n">CRS</span><span class="p">(</span><span class="n">c</span><span class="p">))</span>
-
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">default_doc</span><span class="p">)</span>
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">supported_doc</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">execute_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> :return: execute response element</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Input</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="n">bbox_data_doc</span> <span class="o">=</span> <span class="n">OWS</span><span class="o">.</span><span class="n">BoundingBox</span><span class="p">()</span>
-
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'crs'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">crs</span>
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'dimensions'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">dimensions</span><span class="p">)</span>
-
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">LowerCorner</span><span class="p">(</span><span class="s1">'{0[0]} {0[1]}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)))</span>
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">UpperCorner</span><span class="p">(</span><span class="s1">'{0[2]} {0[3]}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)))</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">bbox_data_doc</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">clone</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Create copy of yourself</span>
-<span class="sd"> """</span>
- <span class="k">return</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span></div>
-
-
-<div class="viewcode-block" id="ComplexInput"><a class="viewcode-back" href="../../../api.html#pywps.ComplexInput">[docs]</a><span class="k">class</span> <span class="nc">ComplexInput</span><span class="p">(</span><span class="n">basic</span><span class="o">.</span><span class="n">ComplexInput</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> Complex data input</span>
-
-<span class="sd"> :param str identifier: The name of this input.</span>
-<span class="sd"> :param str title: Title of the input</span>
-<span class="sd"> :param pywps.inout.formats.Format supported_formats: List of supported formats</span>
-<span class="sd"> :param pywps.inout.formats.Format data_format: default data format</span>
-<span class="sd"> :param str abstract: Input abstract</span>
-<span class="sd"> :param list metada: TODO</span>
-<span class="sd"> :param int min_occurs: minimum occurence</span>
-<span class="sd"> :param int max_occurs: maximum occurence</span>
-<span class="sd"> :param pywps.validator.mode.MODE mode: validation mode (none to strict)</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">supported_formats</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">data_format</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="s1">''</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="p">[],</span> <span class="n">min_occurs</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
- <span class="n">max_occurs</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="sd">"""constructor"""</span>
-
- <span class="k">if</span> <span class="n">metadata</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
- <span class="n">metadata</span> <span class="o">=</span> <span class="p">[]</span>
- <span class="n">basic</span><span class="o">.</span><span class="n">ComplexInput</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="o">=</span><span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">title</span><span class="p">,</span>
- <span class="n">abstract</span><span class="o">=</span><span class="n">abstract</span><span class="p">,</span>
- <span class="n">supported_formats</span><span class="o">=</span><span class="n">supported_formats</span><span class="p">,</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="n">metadata</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">min_occurs</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">min_occurs</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">max_occurs</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">max_occurs</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">as_reference</span> <span class="o">=</span> <span class="bp">False</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">url</span> <span class="o">=</span> <span class="s1">''</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">method</span> <span class="o">=</span> <span class="s1">''</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">max_size</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">calculate_max_input_size</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Calculates maximal size for input file based on configuration</span>
-<span class="sd"> and units</span>
-
-<span class="sd"> :return: maximum file size bytes</span>
-<span class="sd"> """</span>
- <span class="n">max_size</span> <span class="o">=</span> <span class="n">configuration</span><span class="o">.</span><span class="n">get_config_value</span><span class="p">(</span>
- <span class="s1">'server'</span><span class="p">,</span> <span class="s1">'maxsingleinputsize'</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">max_size</span> <span class="o">=</span> <span class="n">configuration</span><span class="o">.</span><span class="n">get_size_mb</span><span class="p">(</span><span class="n">max_size</span><span class="p">)</span>
-
- <span class="k">def</span> <span class="nf">describe_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return Describe process element</span>
-<span class="sd"> """</span>
- <span class="n">default_format_el</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">supported_formats</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">()</span>
- <span class="n">supported_format_elements</span> <span class="o">=</span> <span class="p">[</span><span class="n">f</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">()</span>
- <span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">supported_formats</span><span class="p">]</span>
-
- <span class="n">doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Input</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'minOccurs'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">min_occurs</span><span class="p">)</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'maxOccurs'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">max_occurs</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Metadata</span><span class="p">(</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">))</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
- <span class="n">E</span><span class="o">.</span><span class="n">ComplexData</span><span class="p">(</span>
- <span class="n">E</span><span class="o">.</span><span class="n">Default</span><span class="p">(</span><span class="n">default_format_el</span><span class="p">),</span>
- <span class="n">E</span><span class="o">.</span><span class="n">Supported</span><span class="p">(</span><span class="o">*</span><span class="n">supported_format_elements</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">execute_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Render Execute response XML node</span>
-
-
-<span class="sd"> :return: node</span>
-<span class="sd"> :rtype: ElementMaker</span>
-<span class="sd"> """</span>
- <span class="n">node</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">as_reference</span><span class="p">:</span>
- <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_execute_xml_reference</span><span class="p">()</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_execute_xml_data</span><span class="p">()</span>
-
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Input</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">node</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">_execute_xml_reference</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return Reference node</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Reference</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{http://www.w3.org/1999/xlink}href'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">url</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="p">:</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'mimeType'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">encoding</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'encoding'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">encoding</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">schema</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'schema'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">schema</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="o">==</span> <span class="s1">'POST'</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="o">==</span> <span class="s1">' [...]
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'method'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span>
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">_execute_xml_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return Data node</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Data</span><span class="p">()</span>
- <span class="n">complex_doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">ComplexData</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="p">:</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span><span class="p">:</span>
- <span class="n">complex_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'mimeType'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">encoding</span><span class="p">:</span>
- <span class="n">complex_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'encoding'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">encoding</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">schema</span><span class="p">:</span>
- <span class="n">complex_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'schema'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">schema</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">complex_doc</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">clone</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Create copy of yourself</span>
-<span class="sd"> """</span>
- <span class="k">return</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span></div>
-
-
-<div class="viewcode-block" id="LiteralInput"><a class="viewcode-back" href="../../../api.html#pywps.LiteralInput">[docs]</a><span class="k">class</span> <span class="nc">LiteralInput</span><span class="p">(</span><span class="n">basic</span><span class="o">.</span><span class="n">LiteralInput</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> :param str identifier: The name of this input.</span>
-<span class="sd"> :param str title: Title of the input</span>
-<span class="sd"> :param pywps.inout.literaltypes.LITERAL_DATA_TYPES data_type: data type</span>
-<span class="sd"> :param str abstract: Input abstract</span>
-<span class="sd"> :param list metadata: TODO</span>
-<span class="sd"> :param str uoms: units</span>
-<span class="sd"> :param int min_occurs: minimum occurence</span>
-<span class="sd"> :param int max_occurs: maximum occurence</span>
-<span class="sd"> :param pywps.validator.mode.MODE mode: validation mode (none to strict)</span>
-<span class="sd"> :param pywps.inout.literaltypes.AnyValue allowed_values: or :py:class:`pywps.inout.literaltypes.AllowedValue` object</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">data_type</span><span class="o">=</span><span class="s1">'integer'</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="s1">''</span><span class="p">,</span>
- <span class="n">metadata</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">uoms</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">min_occurs</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">max_occurs</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">SIMPLE</span><span class="p">,</span> <span class="n">allowed_values</span><span class="o">=</span><span class="n">AnyValue</span><span class="p">):</span>
- <span class="sd">"""Constructor</span>
-<span class="sd"> """</span>
-
- <span class="n">basic</span><span class="o">.</span><span class="n">LiteralInput</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="o">=</span><span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">title</span><span class="p">,</span>
- <span class="n">abstract</span><span class="o">=</span><span class="n">abstract</span><span class="p">,</span> <span class="n">data_type</span><span class="o">=</span><span class="n">data_type</span><span class="p">,</span>
- <span class="n">uoms</span><span class="o">=</span><span class="n">uoms</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">,</span>
- <span class="n">allowed_values</span><span class="o">=</span><span class="n">allowed_values</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="n">metadata</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">default</span> <span class="o">=</span> <span class="n">default</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">min_occurs</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">min_occurs</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">max_occurs</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">max_occurs</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">as_reference</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">def</span> <span class="nf">describe_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return DescribeProcess Output element</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Input</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'minOccurs'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">min_occurs</span><span class="p">)</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'maxOccurs'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">max_occurs</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Metadata</span><span class="p">(</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">))</span>
-
- <span class="n">literal_data_doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">LiteralData</span><span class="p">()</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_type</span><span class="p">:</span>
- <span class="n">data_type</span> <span class="o">=</span> <span class="n">OWS</span><span class="o">.</span><span class="n">DataType</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data_type</span><span class="p">)</span>
- <span class="n">data_type</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{</span><span class="si">%s</span><span class="s1">}reference'</span> <span class="o">%</span>
- <span class="n">NAMESPACES</span><span class="p">[</span><span class="s1">'ows'</span><span class="p">]]</span> <span class="o">=</span> <span class="n">OGCTYPE</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">data_type</span><span class="p">]</span>
- <span class="n">literal_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">data_type</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">uoms</span><span class="p">:</span>
- <span class="n">default_uom_element</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">uoms</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">()</span>
- <span class="n">supported_uom_elements</span> <span class="o">=</span> <span class="p">[</span><span class="n">u</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">()</span> <span class="k">for</span> <span class="n">u</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">uoms</span><span class="p">]</span>
-
- <span class="n">literal_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
- <span class="n">E</span><span class="o">.</span><span class="n">UOMs</span><span class="p">(</span>
- <span class="n">E</span><span class="o">.</span><span class="n">Default</span><span class="p">(</span><span class="n">default_uom_element</span><span class="p">),</span>
- <span class="n">E</span><span class="o">.</span><span class="n">Supported</span><span class="p">(</span><span class="o">*</span><span class="n">supported_uom_elements</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="p">)</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">literal_data_doc</span><span class="p">)</span>
-
- <span class="c1"># TODO: refer to table 29 and 30</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">any_value</span><span class="p">:</span>
- <span class="n">literal_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">AnyValue</span><span class="p">())</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">literal_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_describe_xml_allowedvalues</span><span class="p">())</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">default</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">E</span><span class="o">.</span><span class="n">DefaultValue</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">default</span><span class="p">))</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">execute_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Render Execute response XML node</span>
-
-<span class="sd"> :return: node</span>
-<span class="sd"> :rtype: ElementMaker</span>
-<span class="sd"> """</span>
- <span class="n">node</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">as_reference</span><span class="p">:</span>
- <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_execute_xml_reference</span><span class="p">()</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_execute_xml_data</span><span class="p">()</span>
-
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Input</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">node</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">_describe_xml_allowedvalues</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return AllowedValues node</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">OWS</span><span class="o">.</span><span class="n">AllowedValues</span><span class="p">()</span>
- <span class="k">for</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">allowed_values</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">())</span>
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">_execute_xml_reference</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return Reference node</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Reference</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{http://www.w3.org/1999/xlink}href'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">stream</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="o">==</span> <span class="s1">'POST'</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="o">==</span> <span class="s1">' [...]
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'method'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span>
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">_execute_xml_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return Data node</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Data</span><span class="p">()</span>
- <span class="n">literal_doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">LiteralData</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">))</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_type</span><span class="p">:</span>
- <span class="n">literal_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'dataType'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_type</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">uom</span><span class="p">:</span>
- <span class="n">literal_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'uom'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">uom</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">literal_doc</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">clone</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Create copy of yourself</span>
-<span class="sd"> """</span>
- <span class="k">return</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span></div>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../../index.html">
- <img class="logo" src="../../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/inout/literaltypes.html b/docs/_build/html/_modules/pywps/inout/literaltypes.html
deleted file mode 100644
index ad01452..0000000
--- a/docs/_build/html/_modules/pywps/inout/literaltypes.html
+++ /dev/null
@@ -1,414 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.inout.literaltypes — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../../index.html" />
- <link rel="up" title="Module code" href="../../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.inout.literaltypes</h1><div class="highlight"><pre>
-<span class="sd">"""Literaltypes are used for LiteralInputs, to make sure, input data are OK</span>
-<span class="sd">"""</span>
-
-<span class="kn">from</span> <span class="nn">pywps._compat</span> <span class="kn">import</span> <span class="n">urlparse</span>
-<span class="kn">import</span> <span class="nn">time</span>
-<span class="kn">from</span> <span class="nn">pywps.exceptions</span> <span class="kn">import</span> <span class="n">InvalidParameterValue</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.allowed_value</span> <span class="kn">import</span> <span class="n">RANGECLOSURETYPE</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.allowed_value</span> <span class="kn">import</span> <span class="n">ALLOWEDVALUETYPE</span>
-<span class="kn">from</span> <span class="nn">pywps._compat</span> <span class="kn">import</span> <span class="n">PY2</span>
-<span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">OWS</span><span class="p">,</span> <span class="n">WPS</span><span class="p">,</span> <span class="n">OGCTYPE</span><span class="p">,</span> <span class="n">NAMESPACES</span>
-
-<span class="n">LITERAL_DATA_TYPES</span> <span class="o">=</span> <span class="p">(</span><span class="s1">'float'</span><span class="p">,</span> <span class="s1">'boolean'</span><span class="p">,</span> <span class="s1">'integer'</span><span class="p">,</span> <span class="s1">'string'</span><span class="p">,</span>
- <span class="s1">'positiveInteger'</span><span class="p">,</span> <span class="s1">'anyURI'</span><span class="p">,</span> <span class="s1">'time'</span><span class="p">,</span> <span class="s1">'scale'</span><span class="p">,</span> <span class="s1">'angle'</span><span class="p">,</span>
- <span class="s1">'nonNegativeInteger'</span><span class="p">)</span>
-
-<span class="c1"># currently we are supporting just ^^^ data types, feel free to add support for</span>
-<span class="c1"># more</span>
-<span class="c1"># 'measure', 'angleList',</span>
-<span class="c1"># 'angle', 'integerList',</span>
-<span class="c1"># 'positiveIntegerList',</span>
-<span class="c1"># 'lengthOrAngle', 'gridLength',</span>
-<span class="c1"># 'measureList', 'lengthList',</span>
-<span class="c1"># 'gridLengthList', 'scaleList', 'timeList',</span>
-<span class="c1"># 'nonNegativeInteger', 'length'</span>
-
-
-<div class="viewcode-block" id="AnyValue"><a class="viewcode-back" href="../../../api.html#pywps.inout.literaltypes.AnyValue">[docs]</a><span class="k">class</span> <span class="nc">AnyValue</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
- <span class="sd">"""Any value for literal input</span>
-<span class="sd"> """</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="p">{</span><span class="s1">'type'</span><span class="p">:</span> <span class="s1">'anyvalue'</span><span class="p">}</span></div>
-
-<span class="k">class</span> <span class="nc">NoValue</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
- <span class="sd">"""No value allowed</span>
-<span class="sd"> NOTE: not really implemented</span>
-<span class="sd"> """</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="p">{</span><span class="s1">'type'</span><span class="p">:</span> <span class="s1">'novalue'</span><span class="p">}</span>
-
-<span class="k">class</span> <span class="nc">ValuesReference</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
- <span class="sd">"""Any value for literal input</span>
-<span class="sd"> NOTE: not really implemented</span>
-<span class="sd"> """</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="k">return</span> <span class="p">{</span><span class="s1">'type'</span><span class="p">:</span> <span class="s1">'valuesreference'</span><span class="p">}</span>
-
-<div class="viewcode-block" id="AllowedValue"><a class="viewcode-back" href="../../../api.html#pywps.inout.literaltypes.AllowedValue">[docs]</a><span class="k">class</span> <span class="nc">AllowedValue</span><span class="p">(</span><span class="n">AnyValue</span><span class="p">):</span>
- <span class="sd">"""Allowed value parameters</span>
-<span class="sd"> the values are evaluated in literal validator functions</span>
-
-<span class="sd"> :param pywps.validator.allowed_value.ALLOWEDVALUETYPE allowed_type: VALUE or RANGE</span>
-<span class="sd"> :param value: single value</span>
-<span class="sd"> :param minval: minimal value in case of Range</span>
-<span class="sd"> :param maxval: maximal value in case of Range</span>
-<span class="sd"> :param spacing: spacing in case of Range</span>
-<span class="sd"> :param pywps.input.literaltypes.RANGECLOSURETYPE range_closure:</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">allowed_type</span><span class="o">=</span><span class="n">ALLOWEDVALUETYPE</span><span class="o">.</span><span class="n">VALUE</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">minval</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">maxval</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">spacing</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">range_closure</span><span class="o">=</span><span class="n">RANGECLOSURETYPE</span><span class="o">.</span><span class="n">CLOSED</span><span class="p">):</span>
-
- <span class="n">AnyValue</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">allowed_type</span> <span class="o">=</span> <span class="n">allowed_type</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">value</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">minval</span> <span class="o">=</span> <span class="n">minval</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">maxval</span> <span class="o">=</span> <span class="n">maxval</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">spacing</span> <span class="o">=</span> <span class="n">spacing</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">range_closure</span> <span class="o">=</span> <span class="n">range_closure</span>
-
- <span class="k">def</span> <span class="nf">describe_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return back Element for DescribeProcess response</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">allowed_type</span> <span class="o">==</span> <span class="n">ALLOWEDVALUETYPE</span><span class="o">.</span><span class="n">VALUE</span><span class="p">:</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">OWS</span><span class="o">.</span><span class="n">Value</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">value</span><span class="p">))</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">OWS</span><span class="o">.</span><span class="n">Range</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s1">'{</span><span class="si">%s</span><span class="s1">}rangeClosure'</span> <span class="o">%</span> <span class="n">NAMESPACES</span><span class="p">[</span><span class="s1">'ows'</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">range_closure</span><span class="p">)</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">MinimumValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">minval</span><span class="p">)))</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">MaximumValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">maxval</span><span class="p">)))</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">spacing</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Spacing</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">spacing</span><span class="p">)))</span>
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="nd">@property</span>
- <span class="k">def</span> <span class="nf">json</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">value</span>
- <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="s1">'json'</span><span class="p">):</span>
- <span class="n">value</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">json</span>
- <span class="k">return</span> <span class="p">{</span>
- <span class="s1">'type'</span><span class="p">:</span> <span class="s1">'allowedvalue'</span><span class="p">,</span>
- <span class="s1">'allowed_type'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">allowed_type</span><span class="p">,</span>
- <span class="s1">'value'</span><span class="p">:</span> <span class="n">value</span><span class="p">,</span>
- <span class="s1">'minval'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">minval</span><span class="p">,</span>
- <span class="s1">'maxval'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">maxval</span><span class="p">,</span>
- <span class="s1">'spacing'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">spacing</span><span class="p">,</span>
- <span class="s1">'range_closure'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">range_closure</span>
- <span class="p">}</span></div>
-
-<span class="k">def</span> <span class="nf">get_converter</span><span class="p">(</span><span class="n">convertor</span><span class="p">):</span>
- <span class="sd">"""function for decoration of convert</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">decorator_selector</span><span class="p">(</span><span class="n">data_type</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="k">if</span> <span class="n">data_type</span> <span class="ow">in</span> <span class="n">LITERAL_DATA_TYPES</span><span class="p">:</span>
- <span class="k">if</span> <span class="n">data_type</span> <span class="o">==</span> <span class="s1">'string'</span><span class="p">:</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="n">convert_string</span>
- <span class="k">elif</span> <span class="n">data_type</span> <span class="o">==</span> <span class="s1">'integer'</span><span class="p">:</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="n">convert_integer</span>
- <span class="k">elif</span> <span class="n">data_type</span> <span class="o">==</span> <span class="s1">'float'</span><span class="p">:</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="n">convert_float</span>
- <span class="k">elif</span> <span class="n">data_type</span> <span class="o">==</span> <span class="s1">'boolean'</span><span class="p">:</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="n">convert_boolean</span>
- <span class="k">elif</span> <span class="n">data_type</span> <span class="o">==</span> <span class="s1">'positiveInteger'</span><span class="p">:</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="n">convert_positiveInteger</span>
- <span class="k">elif</span> <span class="n">data_type</span> <span class="o">==</span> <span class="s1">'anyURI'</span><span class="p">:</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="n">convert_anyURI</span>
- <span class="k">elif</span> <span class="n">data_type</span> <span class="o">==</span> <span class="s1">'time'</span><span class="p">:</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="n">convert_time</span>
- <span class="k">elif</span> <span class="n">data_type</span> <span class="o">==</span> <span class="s1">'scale'</span><span class="p">:</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="n">convert_scale</span>
- <span class="k">elif</span> <span class="n">data_type</span> <span class="o">==</span> <span class="s1">'angle'</span><span class="p">:</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="n">convert_angle</span>
- <span class="k">elif</span> <span class="n">data_type</span> <span class="o">==</span> <span class="s1">'nonNegativeInteger'</span><span class="p">:</span>
- <span class="n">convert</span> <span class="o">=</span> <span class="n">convert_positiveInteger</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">InvalidParameterValue</span><span class="p">(</span>
- <span class="s2">"Invalid data_type value of LiteralInput "</span> <span class="o">+</span>
- <span class="s2">"set to '{}'"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">data_type</span><span class="p">))</span>
- <span class="k">try</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">convert</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
- <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">InvalidParameterValue</span><span class="p">(</span>
- <span class="s2">"Could not convert value '{}' to format '{}'"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
- <span class="n">data</span><span class="p">,</span> <span class="n">data_type</span><span class="p">))</span>
-
-
- <span class="k">return</span> <span class="n">decorator_selector</span>
-
-
-<span class="nd">@get_converter</span>
-<span class="k">def</span> <span class="nf">convert</span><span class="p">(</span><span class="n">data_type</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
- <span class="sd">"""Convert data to target value</span>
-<span class="sd"> """</span>
-
- <span class="k">return</span> <span class="n">data_type</span><span class="p">,</span> <span class="n">data</span>
-
-
-<span class="k">def</span> <span class="nf">convert_boolean</span><span class="p">(</span><span class="n">inpt</span><span class="p">):</span>
- <span class="sd">"""Return boolean value from input boolean input</span>
-
-<span class="sd"> >>> convert_boolean('1')</span>
-<span class="sd"> True</span>
-<span class="sd"> >>> convert_boolean('-1')</span>
-<span class="sd"> True</span>
-<span class="sd"> >>> convert_boolean('FaLsE')</span>
-<span class="sd"> False</span>
-<span class="sd"> >>> convert_boolean('FaLsEx')</span>
-<span class="sd"> True</span>
-<span class="sd"> >>> convert_boolean(0)</span>
-<span class="sd"> False</span>
-<span class="sd"> """</span>
-
- <span class="n">val</span> <span class="o">=</span> <span class="bp">False</span>
- <span class="k">if</span> <span class="nb">str</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">'false'</span><span class="p">,</span> <span class="s1">'f'</span><span class="p">]:</span>
- <span class="n">val</span> <span class="o">=</span> <span class="bp">False</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">try</span><span class="p">:</span>
- <span class="n">val</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">val</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
- <span class="n">val</span> <span class="o">=</span> <span class="bp">False</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">val</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="k">except</span><span class="p">:</span>
- <span class="n">val</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="k">return</span> <span class="n">val</span>
-
-<span class="k">def</span> <span class="nf">convert_float</span><span class="p">(</span><span class="n">inpt</span><span class="p">):</span>
- <span class="sd">"""Return float value from inpt</span>
-
-<span class="sd"> >>> convert_float('1')</span>
-<span class="sd"> 1.0</span>
-<span class="sd"> """</span>
-
- <span class="k">return</span> <span class="nb">float</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
-
-<span class="k">def</span> <span class="nf">convert_integer</span><span class="p">(</span><span class="n">inpt</span><span class="p">):</span>
- <span class="sd">"""Return integer value from input inpt</span>
-
-<span class="sd"> >>> convert_integer('1.0')</span>
-<span class="sd"> 1</span>
-<span class="sd"> """</span>
-
- <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">inpt</span><span class="p">))</span>
-
-<span class="k">def</span> <span class="nf">convert_string</span><span class="p">(</span><span class="n">inpt</span><span class="p">):</span>
- <span class="sd">"""Return string value from input lit_input</span>
-
-<span class="sd"> >>> convert_string(1)</span>
-<span class="sd"> '1'</span>
-<span class="sd"> """</span>
-
- <span class="k">if</span> <span class="n">PY2</span><span class="p">:</span>
- <span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span><span class="o">.</span><span class="n">decode</span><span class="p">()</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
-
-<span class="k">def</span> <span class="nf">convert_positiveInteger</span><span class="p">(</span><span class="n">inpt</span><span class="p">):</span>
- <span class="sd">"""Return value of input"""</span>
-
- <span class="n">inpt</span> <span class="o">=</span> <span class="n">convert_integer</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">inpt</span> <span class="o"><</span> <span class="mi">0</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">InvalidParameterValue</span><span class="p">(</span>
- <span class="s1">'The value "{}" is not of type positiveInteger'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">inpt</span><span class="p">))</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">return</span> <span class="n">inpt</span>
-
-<span class="k">def</span> <span class="nf">convert_anyURI</span><span class="p">(</span><span class="n">inpt</span><span class="p">):</span>
- <span class="sd">"""Return value of input</span>
-<span class="sd"> </span>
-<span class="sd"> :rtype: url components </span>
-<span class="sd"> """</span>
- <span class="n">inpt</span> <span class="o">=</span> <span class="n">convert_string</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
- <span class="n">components</span> <span class="o">=</span> <span class="n">urlparse</span><span class="o">.</span><span class="n">urlparse</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="n">components</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">and</span> <span class="n">components</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span>
- <span class="k">return</span> <span class="n">components</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="k">raise</span> <span class="n">InvalidParameterValue</span><span class="p">(</span>
- <span class="s1">'The value "{}" does not seem to be of type anyURI'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">inpt</span><span class="p">))</span>
-
-<span class="k">def</span> <span class="nf">convert_time</span><span class="p">(</span><span class="n">inpt</span><span class="p">):</span>
- <span class="sd">"""Return value of input</span>
-<span class="sd"> time formating assumed according to ISO standard</span>
-
-<span class="sd"> http://www.w3.org/TR/NOTE-datetime</span>
-
-<span class="sd"> :rtype: time object</span>
-<span class="sd"> """</span>
- <span class="n">time_format</span> <span class="o">=</span> <span class="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1">T%H:%M:%S%z'</span>
- <span class="n">inpt</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">strptime</span><span class="p">(</span><span class="n">convert_string</span><span class="p">(</span><span class="n">inpt</span><span class="p">),</span> <span class="n">time_format</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">inpt</span>
-
-<span class="k">def</span> <span class="nf">convert_scale</span><span class="p">(</span><span class="n">inpt</span><span class="p">):</span>
- <span class="sd">"""Return value of input"""</span>
-
- <span class="k">return</span> <span class="n">convert_float</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
-
-<span class="k">def</span> <span class="nf">convert_angle</span><span class="p">(</span><span class="n">inpt</span><span class="p">):</span>
- <span class="sd">"""Return value of input</span>
-
-<span class="sd"> return degrees</span>
-<span class="sd"> """</span>
-
- <span class="n">inpt</span> <span class="o">=</span> <span class="n">convert_float</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">inpt</span><span class="o">%</span><span class="mi">360</span>
-
-
-<span class="k">def</span> <span class="nf">make_allowedvalues</span><span class="p">(</span><span class="n">allowed_values</span><span class="p">):</span>
- <span class="sd">"""convert given value list to AllowedValue objects</span>
-
-<span class="sd"> :return: list of pywps.inout.literaltypes.AllowedValue</span>
-<span class="sd"> """</span>
-
- <span class="n">new_allowedvalues</span> <span class="o">=</span> <span class="p">[]</span>
-
- <span class="k">for</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">allowed_values</span><span class="p">:</span>
-
- <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">AllowedValue</span><span class="p">):</span>
- <span class="n">new_allowedvalues</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
-
- <span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="o">==</span> <span class="nb">tuple</span> <span class="ow">or</span>\
- <span class="nb">type</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="o">==</span> <span class="nb">list</span><span class="p">:</span>
- <span class="n">minval</span> <span class="o">=</span> <span class="n">maxval</span> <span class="o">=</span> <span class="n">spacing</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
- <span class="n">minval</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
- <span class="n">maxval</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">minval</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
- <span class="n">spacing</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
- <span class="n">maxval</span> <span class="o">=</span> <span class="n">value</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
- <span class="n">new_allowedvalues</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
- <span class="n">AllowedValue</span><span class="p">(</span><span class="n">allowed_type</span><span class="o">=</span><span class="n">ALLOWEDVALUETYPE</span><span class="o">.</span><span class="n">RANGE</span><span class="p">,</span>
- <span class="n">minval</span><span class="o">=</span><span class="n">minval</span><span class="p">,</span> <span class="n">maxval</span><span class="o">=</span><span class="n">maxval</span><span class="p">,</span>
- <span class="n">spacing</span><span class="o">=</span><span class="n">spacing</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="k">else</span><span class="p">:</span>
- <span class="n">new_allowedvalues</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">AllowedValue</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="n">value</span><span class="p">))</span>
-
- <span class="k">return</span> <span class="n">new_allowedvalues</span>
-
-
-<span class="k">def</span> <span class="nf">is_anyvalue</span><span class="p">(</span><span class="n">value</span><span class="p">):</span>
- <span class="sd">"""Check for any value object of given value</span>
-<span class="sd"> """</span>
-
- <span class="n">is_av</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">if</span> <span class="n">value</span> <span class="o">==</span> <span class="n">AnyValue</span><span class="p">:</span>
- <span class="n">is_av</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="k">elif</span> <span class="n">value</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
- <span class="n">is_av</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">AnyValue</span><span class="p">):</span>
- <span class="n">is_av</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="k">elif</span> <span class="nb">str</span><span class="p">(</span><span class="n">value</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">'anyvalue'</span><span class="p">:</span>
- <span class="n">is_av</span> <span class="o">=</span> <span class="bp">True</span>
-
- <span class="k">return</span> <span class="n">is_av</span>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../../index.html">
- <img class="logo" src="../../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/inout/outputs.html b/docs/_build/html/_modules/pywps/inout/outputs.html
deleted file mode 100644
index 110c990..0000000
--- a/docs/_build/html/_modules/pywps/inout/outputs.html
+++ /dev/null
@@ -1,388 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.inout.outputs — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../../index.html" />
- <link rel="up" title="Module code" href="../../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.inout.outputs</h1><div class="highlight"><pre>
-<span class="kn">from</span> <span class="nn">pywps._compat</span> <span class="kn">import</span> <span class="n">text_type</span>
-<span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">E</span><span class="p">,</span> <span class="n">WPS</span><span class="p">,</span> <span class="n">OWS</span><span class="p">,</span> <span class="n">OGCTYPE</span><span class="p">,</span> <span class="n">NAMESPACES</span>
-<span class="kn">from</span> <span class="nn">pywps.inout</span> <span class="kn">import</span> <span class="n">basic</span>
-<span class="kn">from</span> <span class="nn">pywps.inout.storage</span> <span class="kn">import</span> <span class="n">FileStorage</span>
-<span class="kn">from</span> <span class="nn">pywps.inout.formats</span> <span class="kn">import</span> <span class="n">Format</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.mode</span> <span class="kn">import</span> <span class="n">MODE</span>
-<span class="kn">import</span> <span class="nn">lxml.etree</span> <span class="kn">as</span> <span class="nn">etree</span>
-
-
-<div class="viewcode-block" id="BoundingBoxOutput"><a class="viewcode-back" href="../../../api.html#pywps.BoundingBoxOutput">[docs]</a><span class="k">class</span> <span class="nc">BoundingBoxOutput</span><span class="p">(</span><span class="n">basic</span><span class="o">.</span><span class="n">BBoxInput</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> :param identifier: The name of this input.</span>
-<span class="sd"> :param str title: Title of the input</span>
-<span class="sd"> :param str abstract: Input abstract</span>
-<span class="sd"> :param crss: List of supported coordinate reference system (e.g. ['EPSG:4326'])</span>
-<span class="sd"> :param int dimensions: number of dimensions (2 or 3)</span>
-<span class="sd"> :param int min_occurs: minimum occurence</span>
-<span class="sd"> :param int max_occurs: maximum occurence</span>
-<span class="sd"> :param pywps.validator.mode.MODE mode: validation mode (none to strict)</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">crss</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="s1">''</span><span class="p">,</span>
- <span class="n">dimensions</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">min_occurs</span><span class="o">=</span><span class="s1">'1'</span><span class="p">,</span>
- <span class="n">max_occurs</span><span class="o">=</span><span class="s1">'1'</span><span class="p">,</span> <span class="n">as_reference</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="k">if</span> <span class="n">metadata</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
- <span class="n">metadata</span> <span class="o">=</span> <span class="p">[]</span>
- <span class="n">basic</span><span class="o">.</span><span class="n">BBoxInput</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">title</span><span class="p">,</span>
- <span class="n">abstract</span><span class="o">=</span><span class="n">abstract</span><span class="p">,</span> <span class="n">crss</span><span class="o">=</span><span class="n">crss</span><span class="p">,</span>
- <span class="n">dimensions</span><span class="o">=</span><span class="n">dimensions</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="n">metadata</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">min_occurs</span> <span class="o">=</span> <span class="n">min_occurs</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">max_occurs</span> <span class="o">=</span> <span class="n">max_occurs</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">as_reference</span> <span class="o">=</span> <span class="n">as_reference</span>
-
- <span class="k">def</span> <span class="nf">describe_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Output</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Metadata</span><span class="p">(</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">))</span>
-
- <span class="n">bbox_data_doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">BoundingBoxOutput</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">bbox_data_doc</span><span class="p">)</span>
-
- <span class="n">default_doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Default</span><span class="p">()</span>
- <span class="n">default_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">E</span><span class="o">.</span><span class="n">CRS</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">crss</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span>
-
- <span class="n">supported_doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Supported</span><span class="p">()</span>
- <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">crss</span><span class="p">:</span>
- <span class="n">supported_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">E</span><span class="o">.</span><span class="n">CRS</span><span class="p">(</span><span class="n">c</span><span class="p">))</span>
-
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">default_doc</span><span class="p">)</span>
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">supported_doc</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">execute_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Output</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="n">bbox_data_doc</span> <span class="o">=</span> <span class="n">OWS</span><span class="o">.</span><span class="n">BoundingBox</span><span class="p">()</span>
-
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'crs'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">crs</span>
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'dimensions'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">dimensions</span><span class="p">)</span>
-
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">LowerCorner</span><span class="p">(</span><span class="s1">'{0[0]} {0[1]}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)))</span>
- <span class="n">bbox_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">UpperCorner</span><span class="p">(</span><span class="s1">'{0[2]} {0[3]}'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)))</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">bbox_data_doc</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span></div>
-
-
-<div class="viewcode-block" id="ComplexOutput"><a class="viewcode-back" href="../../../api.html#pywps.ComplexOutput">[docs]</a><span class="k">class</span> <span class="nc">ComplexOutput</span><span class="p">(</span><span class="n">basic</span><span class="o">.</span><span class="n">ComplexOutput</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> :param identifier: The name of this output.</span>
-<span class="sd"> :param title: Readable form of the output name.</span>
-<span class="sd"> :param pywps.inout.formats.Format supported_formats: List of supported</span>
-<span class="sd"> formats. The first format in the list will be used as the default.</span>
-<span class="sd"> :param str abstract: Description of the output</span>
-<span class="sd"> :param pywps.validator.mode.MODE mode: validation mode (none to strict)</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">supported_formats</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
- <span class="n">abstract</span><span class="o">=</span><span class="s1">''</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">):</span>
- <span class="k">if</span> <span class="n">metadata</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
- <span class="n">metadata</span> <span class="o">=</span> <span class="p">[]</span>
-
- <span class="n">basic</span><span class="o">.</span><span class="n">ComplexOutput</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">title</span><span class="p">,</span>
- <span class="n">abstract</span><span class="o">=</span><span class="n">abstract</span><span class="p">,</span>
- <span class="n">supported_formats</span><span class="o">=</span><span class="n">supported_formats</span><span class="p">,</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="n">metadata</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">as_reference</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">storage</span> <span class="o">=</span> <span class="bp">None</span>
-
- <span class="k">def</span> <span class="nf">describe_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Generate DescribeProcess element</span>
-<span class="sd"> """</span>
- <span class="n">default_format_el</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">supported_formats</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">()</span>
- <span class="n">supported_format_elements</span> <span class="o">=</span> <span class="p">[</span><span class="n">f</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">()</span> <span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">supported_formats</span><span class="p">]</span>
-
- <span class="n">doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Output</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Metadata</span><span class="p">(</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">))</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
- <span class="n">E</span><span class="o">.</span><span class="n">ComplexOutput</span><span class="p">(</span>
- <span class="n">E</span><span class="o">.</span><span class="n">Default</span><span class="p">(</span><span class="n">default_format_el</span><span class="p">),</span>
- <span class="n">E</span><span class="o">.</span><span class="n">Supported</span><span class="p">(</span><span class="o">*</span><span class="n">supported_format_elements</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">execute_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Render Execute response XML node</span>
-
-<span class="sd"> :return: node</span>
-<span class="sd"> :rtype: ElementMaker</span>
-<span class="sd"> """</span>
-
- <span class="bp">self</span><span class="o">.</span><span class="n">identifier</span>
-
- <span class="n">node</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">as_reference</span><span class="p">:</span>
- <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_execute_xml_reference</span><span class="p">()</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_execute_xml_data</span><span class="p">()</span>
-
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Output</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">node</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">_execute_xml_reference</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return Reference node</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Reference</span><span class="p">()</span>
-
- <span class="c1"># get_url will create the file and return the url for it</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">storage</span> <span class="o">=</span> <span class="n">FileStorage</span><span class="p">()</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{http://www.w3.org/1999/xlink}href'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_url</span><span class="p">()</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="p">:</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'mimeType'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">encoding</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'encoding'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">encoding</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">schema</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'schema'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">schema</span>
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">_execute_xml_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="sd">"""Return Data node</span>
-<span class="sd"> """</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Data</span><span class="p">()</span>
-
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
- <span class="n">complex_doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">ComplexData</span><span class="p">()</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">complex_doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">ComplexData</span><span class="p">()</span>
- <span class="k">try</span><span class="p">:</span>
- <span class="n">data_doc</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">file</span><span class="p">)</span>
- <span class="n">complex_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">data_doc</span><span class="o">.</span><span class="n">getroot</span><span class="p">())</span>
- <span class="k">except</span><span class="p">:</span>
- <span class="n">complex_doc</span><span class="o">.</span><span class="n">text</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">CDATA</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base64</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="p">:</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span><span class="p">:</span>
- <span class="n">complex_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'mimeType'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">encoding</span><span class="p">:</span>
- <span class="n">complex_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'encoding'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">encoding</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">schema</span><span class="p">:</span>
- <span class="n">complex_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'schema'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">schema</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">complex_doc</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">doc</span></div>
-
-
-<div class="viewcode-block" id="LiteralOutput"><a class="viewcode-back" href="../../../api.html#pywps.LiteralOutput">[docs]</a><span class="k">class</span> <span class="nc">LiteralOutput</span><span class="p">(</span><span class="n">basic</span><span class="o">.</span><span class="n">LiteralOutput</span><span class="p">):</span>
- <span class="sd">"""</span>
-<span class="sd"> :param identifier: The name of this output.</span>
-<span class="sd"> :param str title: Title of the input</span>
-<span class="sd"> :param pywps.inout.literaltypes.LITERAL_DATA_TYPES data_type: data type</span>
-<span class="sd"> :param str abstract: Input abstract</span>
-<span class="sd"> :param str uoms: units</span>
-<span class="sd"> :param pywps.validator.mode.MODE mode: validation mode (none to strict)</span>
-<span class="sd"> """</span>
-
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">data_type</span><span class="o">=</span><span class="s1">'string'</span><span class="p">,</span> <span class="n">abstract</span><span class="o">=</span><span class="s1">''</span><span class="p">,</span>
- <span class="n">metadata</span><span class="o">=</span><span class="p">[],</span> <span class="n">uoms</span><span class="o">=</span><span class="p">[],</span> <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">SIMPLE</span><span class="p">):</span>
- <span class="k">if</span> <span class="n">metadata</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
- <span class="n">metadata</span> <span class="o">=</span> <span class="p">[]</span>
- <span class="k">if</span> <span class="n">uoms</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
- <span class="n">uoms</span> <span class="o">=</span> <span class="p">[]</span>
- <span class="n">basic</span><span class="o">.</span><span class="n">LiteralOutput</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">identifier</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">title</span><span class="p">,</span>
- <span class="n">data_type</span><span class="o">=</span><span class="n">data_type</span><span class="p">,</span> <span class="n">uoms</span><span class="o">=</span><span class="n">uoms</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">mode</span><span class="p">)</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span> <span class="o">=</span> <span class="n">abstract</span>
- <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="n">metadata</span>
-
- <span class="k">def</span> <span class="nf">describe_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">Output</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Metadata</span><span class="p">(</span><span class="n">m</span><span class="p">))</span>
-
- <span class="n">literal_data_doc</span> <span class="o">=</span> <span class="n">E</span><span class="o">.</span><span class="n">LiteralOutput</span><span class="p">()</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_type</span><span class="p">:</span>
- <span class="n">data_type</span> <span class="o">=</span> <span class="n">OWS</span><span class="o">.</span><span class="n">DataType</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data_type</span><span class="p">)</span>
- <span class="n">data_type</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'{</span><span class="si">%s</span><span class="s1">}reference'</span> <span class="o">%</span> <span class="n">NAMESPACES</span><span class="p">[</span><span class="s1">'ows'</span><span class="p">]]</span> <span class="o">=</span> <span class="n">OGCTYPE</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span [...]
- <span class="n">literal_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">data_type</span><span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">uoms</span><span class="p">:</span>
- <span class="n">default_uom_element</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">uom</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">()</span>
- <span class="n">supported_uom_elements</span> <span class="o">=</span> <span class="p">[</span><span class="n">u</span><span class="o">.</span><span class="n">describe_xml</span><span class="p">()</span> <span class="k">for</span> <span class="n">u</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">uoms</span><span class="p">]</span>
-
- <span class="n">literal_data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
- <span class="n">E</span><span class="o">.</span><span class="n">UOMs</span><span class="p">(</span>
- <span class="n">E</span><span class="o">.</span><span class="n">Default</span><span class="p">(</span><span class="n">default_uom_element</span><span class="p">),</span>
- <span class="n">E</span><span class="o">.</span><span class="n">Supported</span><span class="p">(</span><span class="o">*</span><span class="n">supported_uom_elements</span><span class="p">)</span>
- <span class="p">)</span>
- <span class="p">)</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">literal_data_doc</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
- <span class="k">def</span> <span class="nf">execute_xml_lineage</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Output</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="k">return</span> <span class="n">doc</span>
-
-
- <span class="k">def</span> <span class="nf">execute_xml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Output</span><span class="p">(</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Identifier</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">identifier</span><span class="p">),</span>
- <span class="n">OWS</span><span class="o">.</span><span class="n">Title</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">:</span>
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">OWS</span><span class="o">.</span><span class="n">Abstract</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abstract</span><span class="p">))</span>
-
- <span class="n">data_doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">Data</span><span class="p">()</span>
-
- <span class="n">literal_data_doc</span> <span class="o">=</span> <span class="n">WPS</span><span class="o">.</span><span class="n">LiteralData</span><span class="p">(</span><span class="n">text_type</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">))</span>
- <span class="n">literal_data_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'dataType'</span><span class="p">]</span> <span class="o">=</span> <span class="n">OGCTYPE</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">data_type</span><span class="p">]</span>
- <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">uom</span><span class="p">:</span>
- <span class="n">literal_data_doc</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s1">'uom'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">uom</span><span class="o">.</span><span class="n">execute_attribute</span><span class="p">()</span>
- <span class="n">data_doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">literal_data_doc</span><span class="p">)</span>
-
- <span class="n">doc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">data_doc</span><span class="p">)</span>
-
- <span class="k">return</span> <span class="n">doc</span></div>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../../index.html">
- <img class="logo" src="../../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/validator/complexvalidator.html b/docs/_build/html/_modules/pywps/validator/complexvalidator.html
deleted file mode 100644
index d47713d..0000000
--- a/docs/_build/html/_modules/pywps/validator/complexvalidator.html
+++ /dev/null
@@ -1,361 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.validator.complexvalidator — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../../index.html" />
- <link rel="up" title="Module code" href="../../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.validator.complexvalidator</h1><div class="highlight"><pre>
-<span class="sd">"""Validator classes are used for ComplexInputs, to validate the content</span>
-<span class="sd">"""</span>
-<span class="c1"># Author: Jachym Cepicky</span>
-<span class="c1"># </span>
-<span class="c1"># License:</span>
-<span class="c1">#</span>
-<span class="c1"># Web Processing Service implementation</span>
-<span class="c1"># Copyright (C) 2014-2015 PyWPS Development Team, represented by Jachym Cepicky</span>
-<span class="c1">#</span>
-<span class="c1"># Permission is hereby granted, free of charge, to any person obtaining a copy</span>
-<span class="c1"># of this software and associated documentation files (the "Software"), to</span>
-<span class="c1"># deal in the Software without restriction, including without limitation the</span>
-<span class="c1"># rights to use, copy, modify, merge, publish, distribute, sublicense, and/or</span>
-<span class="c1"># sell copies of the Software, and to permit persons to whom the Software is</span>
-<span class="c1"># furnished to do so, subject to the following conditions:</span>
-<span class="c1"># </span>
-<span class="c1"># The above copyright notice and this permission notice shall be included in</span>
-<span class="c1"># all copies or substantial portions of the Software.</span>
-<span class="c1"># </span>
-<span class="c1"># THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
-<span class="c1"># IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
-<span class="c1"># FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
-<span class="c1"># AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
-<span class="c1"># LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span>
-<span class="c1"># FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS</span>
-<span class="c1"># IN THE SOFTWARE.</span>
-
-<span class="kn">import</span> <span class="nn">logging</span>
-
-<span class="kn">from</span> <span class="nn">pywps.validator.mode</span> <span class="kn">import</span> <span class="n">MODE</span>
-<span class="kn">from</span> <span class="nn">pywps.inout.formats</span> <span class="kn">import</span> <span class="n">FORMATS</span>
-<span class="kn">import</span> <span class="nn">mimetypes</span>
-<span class="kn">import</span> <span class="nn">os</span>
-
-<span class="n">LOGGER</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">'PYWPS'</span><span class="p">)</span>
-
-<div class="viewcode-block" id="validategml"><a class="viewcode-back" href="../../../api.html#pywps.validator.complexvalidator.validategml">[docs]</a><span class="k">def</span> <span class="nf">validategml</span><span class="p">(</span><span class="n">data_input</span><span class="p">,</span> <span class="n">mode</span><span class="p">):</span>
- <span class="sd">"""GML validation function</span>
-
-<span class="sd"> :param data_input: :class:`ComplexInput`</span>
-<span class="sd"> :param pywps.validator.mode.MODE mode:</span>
-
-<span class="sd"> This function validates GML input based on given validation mode. Following</span>
-<span class="sd"> happens, if `mode` parameter is given:</span>
-
-<span class="sd"> `MODE.NONE`</span>
-<span class="sd"> it will return always `True`</span>
-<span class="sd"> `MODE.SIMPLE`</span>
-<span class="sd"> the mimetype will be checked</span>
-<span class="sd"> `MODE.STRICT`</span>
-<span class="sd"> `GDAL/OGR <http://gdal.org/>`_ is used for getting the propper format.</span>
-<span class="sd"> `MODE.VERYSTRICT`</span>
-<span class="sd"> the :class:`lxml.etree` is used along with given input `schema` and the</span>
-<span class="sd"> GML file is properly validated against given schema.</span>
-<span class="sd"> """</span>
-
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">'validating GML; Mode: </span><span class="si">%s</span><span class="s1">'</span><span class="p">,</span> <span class="n">mode</span><span class="p">)</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="kn">import</span> <span class="nn">sys</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">SIMPLE</span><span class="p">:</span>
-
- <span class="n">name</span> <span class="o">=</span> <span class="n">data_input</span><span class="o">.</span><span class="n">file</span>
- <span class="p">(</span><span class="n">mtype</span><span class="p">,</span> <span class="n">encoding</span><span class="p">)</span> <span class="o">=</span> <span class="n">mimetypes</span><span class="o">.</span><span class="n">guess_type</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">strict</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="n">data_input</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span> <span class="ow">in</span> <span class="p">{</span><span class="n">mtype</span><span class="p">,</span> <span class="n">FORMATS</span><span class="o">.</span><span class="n">GML</span><span class="o">.</span><span class="n">mime_type</span><span class="p">}</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">STRICT</span><span class="p">:</span>
-
- <span class="kn">from</span> <span class="nn">pywps.dependencies</span> <span class="kn">import</span> <span class="n">ogr</span>
- <span class="n">data_source</span> <span class="o">=</span> <span class="n">ogr</span><span class="o">.</span><span class="n">Open</span><span class="p">(</span><span class="n">data_input</span><span class="o">.</span><span class="n">file</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">data_source</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="p">(</span><span class="n">data_source</span><span class="o">.</span><span class="n">GetDriver</span><span class="p">()</span><span class="o">.</span><span class="n">GetName</span><span class="p">()</span> <span class="o">==</span> <span class="s2">"GML"</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">VERYSTRICT</span><span class="p">:</span>
-
- <span class="kn">from</span> <span class="nn">lxml</span> <span class="kn">import</span> <span class="n">etree</span>
-
- <span class="kn">from</span> <span class="nn">pywps._compat</span> <span class="kn">import</span> <span class="n">PY2</span>
- <span class="k">if</span> <span class="n">PY2</span><span class="p">:</span>
- <span class="kn">from</span> <span class="nn">urllib2</span> <span class="kn">import</span> <span class="n">urlopen</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="kn">from</span> <span class="nn">urllib.request</span> <span class="kn">import</span> <span class="n">urlopen</span>
-
- <span class="k">try</span><span class="p">:</span>
- <span class="n">schema_url</span> <span class="o">=</span> <span class="n">data_input</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">schema</span>
- <span class="n">gmlschema_doc</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">urlopen</span><span class="p">(</span><span class="n">schema_url</span><span class="p">))</span>
- <span class="n">gmlschema</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">XMLSchema</span><span class="p">(</span><span class="n">gmlschema_doc</span><span class="p">)</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="n">gmlschema</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">etree</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">data_input</span><span class="o">.</span><span class="n">stream</span><span class="p">))</span>
- <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">return</span> <span class="n">passed</span></div>
-
-<span class="k">def</span> <span class="nf">validategeojson</span><span class="p">(</span><span class="n">data_input</span><span class="p">,</span> <span class="n">mode</span><span class="p">):</span>
- <span class="sd">"""GeoJSON validation example</span>
-
-<span class="sd"> >>> import StringIO</span>
-<span class="sd"> >>> class FakeInput(object):</span>
-<span class="sd"> ... json = open('point.geojson','w')</span>
-<span class="sd"> ... json.write('''{"type":"Feature", "properties":{}, "geometry":{"type":"Point", "coordinates":[8.5781228542328, 22.87500500679]}, "crs":{"type":"name", "properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}}}''')</span>
-<span class="sd"> ... json.close()</span>
-<span class="sd"> ... file = 'point.geojson'</span>
-<span class="sd"> >>> class fake_data_format(object):</span>
-<span class="sd"> ... mimetype = 'application/geojson'</span>
-<span class="sd"> >>> fake_input = FakeInput()</span>
-<span class="sd"> >>> fake_input.data_format = fake_data_format()</span>
-<span class="sd"> >>> validategeojson(fake_input, MODE.SIMPLE)</span>
-<span class="sd"> True</span>
-<span class="sd"> """</span>
-
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">'validating GeoJSON; Mode: </span><span class="si">%s</span><span class="s1">'</span><span class="p">,</span> <span class="n">mode</span><span class="p">)</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">True</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">SIMPLE</span><span class="p">:</span>
-
- <span class="n">name</span> <span class="o">=</span> <span class="n">data_input</span><span class="o">.</span><span class="n">file</span>
- <span class="p">(</span><span class="n">mtype</span><span class="p">,</span> <span class="n">encoding</span><span class="p">)</span> <span class="o">=</span> <span class="n">mimetypes</span><span class="o">.</span><span class="n">guess_type</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">strict</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="n">data_input</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span> <span class="ow">in</span> <span class="p">{</span><span class="n">mtype</span><span class="p">,</span> <span class="n">FORMATS</span><span class="o">.</span><span class="n">GEOJSON</span><span class="o">.</span><span class="n">mime_type</span><span class="p">}</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">STRICT</span><span class="p">:</span>
-
- <span class="kn">from</span> <span class="nn">pywps.dependencies</span> <span class="kn">import</span> <span class="n">ogr</span>
- <span class="n">data_source</span> <span class="o">=</span> <span class="n">ogr</span><span class="o">.</span><span class="n">Open</span><span class="p">(</span><span class="n">data_input</span><span class="o">.</span><span class="n">file</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">data_source</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="p">(</span><span class="n">data_source</span><span class="o">.</span><span class="n">GetDriver</span><span class="p">()</span><span class="o">.</span><span class="n">GetName</span><span class="p">()</span> <span class="o">==</span> <span class="s2">"GeoJSON"</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">VERYSTRICT</span><span class="p">:</span>
-
- <span class="kn">import</span> <span class="nn">jsonschema</span>
- <span class="kn">import</span> <span class="nn">json</span>
-
- <span class="c1"># this code comes from</span>
- <span class="c1"># https://github.com/om-henners/GeoJSON_Validation/blob/master/geojsonvalidation/geojson_validation.py</span>
- <span class="n">schema_home</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">_get_schemas_home</span><span class="p">(),</span> <span class="s2">"geojson"</span><span class="p">)</span>
- <span class="n">base_schema</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">schema_home</span><span class="p">,</span> <span class="s2">"geojson.json"</span><span class="p">)</span>
-
- <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">base_schema</span><span class="p">)</span> <span class="k">as</span> <span class="n">fh</span><span class="p">:</span>
- <span class="n">geojson_base</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">fh</span><span class="p">)</span>
-
- <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">schema_home</span><span class="p">,</span> <span class="s2">"crs.json"</span><span class="p">))</span> <span class="k">as</span> <span class="n">fh</span><span class="p">:</span>
- <span class="n">crs_json</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">fh</span><span class="p">)</span>
-
- <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">schema_home</span><span class="p">,</span> <span class="s2">"bbox.json"</span><span class="p">))</span> <span class="k">as</span> <span class="n">fh</span><span class="p">:</span>
- <span class="n">bbox_json</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">fh</span><span class="p">)</span>
-
- <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">schema_home</span><span class="p">,</span> <span class="s2">"geometry.json"</span><span class="p">))</span> <span class="k">as</span> <span class="n">fh</span><span class="p">:</span>
- <span class="n">geometry_json</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">fh</span><span class="p">)</span>
-
- <span class="n">cached_json</span> <span class="o">=</span> <span class="p">{</span>
- <span class="s2">"http://json-schema.org/geojson/crs.json"</span><span class="p">:</span> <span class="n">crs_json</span><span class="p">,</span>
- <span class="s2">"http://json-schema.org/geojson/bbox.json"</span><span class="p">:</span> <span class="n">bbox_json</span><span class="p">,</span>
- <span class="s2">"http://json-schema.org/geojson/geometry.json"</span><span class="p">:</span> <span class="n">geometry_json</span>
- <span class="p">}</span>
-
- <span class="n">resolver</span> <span class="o">=</span> <span class="n">jsonschema</span><span class="o">.</span><span class="n">RefResolver</span><span class="p">(</span>
- <span class="s2">"http://json-schema.org/geojson/geojson.json"</span><span class="p">,</span>
- <span class="n">geojson_base</span><span class="p">,</span> <span class="n">store</span><span class="o">=</span><span class="n">cached_json</span><span class="p">)</span>
-
- <span class="n">validator</span> <span class="o">=</span> <span class="n">jsonschema</span><span class="o">.</span><span class="n">Draft4Validator</span><span class="p">(</span><span class="n">geojson_base</span><span class="p">,</span> <span class="n">resolver</span><span class="o">=</span><span class="n">resolver</span><span class="p">)</span>
- <span class="k">try</span><span class="p">:</span>
- <span class="n">validator</span><span class="o">.</span><span class="n">validate</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">data_input</span><span class="o">.</span><span class="n">stream</span><span class="o">.</span><span class="n">read</span><span class="p">()))</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">True</span>
- <span class="k">except</span> <span class="n">jsonschema</span><span class="o">.</span><span class="n">ValidationError</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">return</span> <span class="n">passed</span>
-
-<span class="k">def</span> <span class="nf">validateshapefile</span><span class="p">(</span><span class="n">data_input</span><span class="p">,</span> <span class="n">mode</span><span class="p">):</span>
- <span class="sd">"""ESRI Shapefile validation example</span>
-
-<span class="sd"> """</span>
-
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">'validating Shapefile; Mode: </span><span class="si">%s</span><span class="s1">'</span><span class="p">,</span> <span class="n">mode</span><span class="p">)</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">True</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">SIMPLE</span><span class="p">:</span>
-
- <span class="n">name</span> <span class="o">=</span> <span class="n">data_input</span><span class="o">.</span><span class="n">file</span>
- <span class="p">(</span><span class="n">mtype</span><span class="p">,</span> <span class="n">encoding</span><span class="p">)</span> <span class="o">=</span> <span class="n">mimetypes</span><span class="o">.</span><span class="n">guess_type</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">strict</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="n">data_input</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span> <span class="ow">in</span> <span class="p">{</span><span class="n">mtype</span><span class="p">,</span> <span class="n">FORMATS</span><span class="o">.</span><span class="n">SHP</span><span class="o">.</span><span class="n">mime_type</span><span class="p">}</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">STRICT</span><span class="p">:</span>
-
- <span class="kn">from</span> <span class="nn">pywps.dependencies</span> <span class="kn">import</span> <span class="n">ogr</span>
-
- <span class="kn">import</span> <span class="nn">zipfile</span>
- <span class="n">z</span> <span class="o">=</span> <span class="n">zipfile</span><span class="o">.</span><span class="n">ZipFile</span><span class="p">(</span><span class="n">data_input</span><span class="o">.</span><span class="n">file</span><span class="p">)</span>
- <span class="n">shape_name</span> <span class="o">=</span> <span class="bp">None</span>
- <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">z</span><span class="o">.</span><span class="n">namelist</span><span class="p">():</span>
- <span class="n">z</span><span class="o">.</span><span class="n">extract</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">data_input</span><span class="o">.</span><span class="n">tempdir</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">splitext</span><span class="p">(</span><span class="n">name</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">'.shp'</span><span class="p">:</span>
- <span class="n">shape_name</span> <span class="o">=</span> <span class="n">name</span>
-
- <span class="k">if</span> <span class="n">shape_name</span><span class="p">:</span>
- <span class="n">data_source</span> <span class="o">=</span> <span class="n">ogr</span><span class="o">.</span><span class="n">Open</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">data_input</span><span class="o">.</span><span class="n">tempdir</span><span class="p">,</span> <span class="n">shape_name</span><span class="p">))</span>
-
- <span class="k">if</span> <span class="n">data_source</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="p">(</span><span class="n">data_source</span><span class="o">.</span><span class="n">GetDriver</span><span class="p">()</span><span class="o">.</span><span class="n">GetName</span><span class="p">()</span> <span class="o">==</span> <span class="s2">"ESRI Shapefile"</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">return</span> <span class="n">passed</span>
-
-<span class="k">def</span> <span class="nf">validategeotiff</span><span class="p">(</span><span class="n">data_input</span><span class="p">,</span> <span class="n">mode</span><span class="p">):</span>
- <span class="sd">"""GeoTIFF validation example</span>
-<span class="sd"> """</span>
-
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">'Validating Shapefile; Mode: </span><span class="si">%s</span><span class="s1">'</span><span class="p">,</span> <span class="n">mode</span><span class="p">)</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">NONE</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">True</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">SIMPLE</span><span class="p">:</span>
-
- <span class="n">name</span> <span class="o">=</span> <span class="n">data_input</span><span class="o">.</span><span class="n">file</span>
- <span class="p">(</span><span class="n">mtype</span><span class="p">,</span> <span class="n">encoding</span><span class="p">)</span> <span class="o">=</span> <span class="n">mimetypes</span><span class="o">.</span><span class="n">guess_type</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">strict</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="n">data_input</span><span class="o">.</span><span class="n">data_format</span><span class="o">.</span><span class="n">mime_type</span> <span class="ow">in</span> <span class="p">{</span><span class="n">mtype</span><span class="p">,</span> <span class="n">FORMATS</span><span class="o">.</span><span class="n">GEOTIFF</span><span class="o">.</span><span class="n">mime_type</span><span class="p">}</span>
-
- <span class="k">if</span> <span class="n">mode</span> <span class="o">>=</span> <span class="n">MODE</span><span class="o">.</span><span class="n">STRICT</span><span class="p">:</span>
-
- <span class="kn">from</span> <span class="nn">pywps.dependencies</span> <span class="kn">import</span> <span class="n">gdal</span>
- <span class="n">data_source</span> <span class="o">=</span> <span class="n">gdal</span><span class="o">.</span><span class="n">Open</span><span class="p">(</span><span class="n">data_input</span><span class="o">.</span><span class="n">file</span><span class="p">)</span>
- <span class="k">if</span> <span class="n">data_source</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="p">(</span><span class="n">data_source</span><span class="o">.</span><span class="n">GetDriver</span><span class="p">()</span><span class="o">.</span><span class="n">ShortName</span> <span class="o">==</span> <span class="s2">"GTiff"</span><span class="p">)</span>
- <span class="k">else</span><span class="p">:</span>
- <span class="n">passed</span> <span class="o">=</span> <span class="bp">False</span>
-
- <span class="k">return</span> <span class="n">passed</span>
-
-<span class="k">def</span> <span class="nf">_get_schemas_home</span><span class="p">():</span>
- <span class="sd">"""Get path to schemas directory</span>
-<span class="sd"> """</span>
- <span class="n">schema_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span>
- <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span>
- <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">__file__</span><span class="p">)</span>
- <span class="p">),</span>
- <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">pardir</span><span class="p">,</span>
- <span class="s2">"schemas"</span><span class="p">)</span>
- <span class="n">LOGGER</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">'Schemas directory: </span><span class="si">%s</span><span class="s1">'</span><span class="p">,</span> <span class="n">schema_dir</span><span class="p">)</span>
- <span class="k">return</span> <span class="n">schema_dir</span>
-
-
-<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s2">"__main__"</span><span class="p">:</span>
- <span class="kn">import</span> <span class="nn">doctest</span>
-
- <span class="kn">import</span> <span class="nn">os</span>
- <span class="kn">from</span> <span class="nn">pywps.wpsserver</span> <span class="kn">import</span> <span class="n">temp_dir</span>
-
- <span class="k">with</span> <span class="n">temp_dir</span><span class="p">()</span> <span class="k">as</span> <span class="n">tmp</span><span class="p">:</span>
- <span class="n">os</span><span class="o">.</span><span class="n">chdir</span><span class="p">(</span><span class="n">tmp</span><span class="p">)</span>
- <span class="n">doctest</span><span class="o">.</span><span class="n">testmod</span><span class="p">()</span>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../../index.html">
- <img class="logo" src="../../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_modules/pywps/validator/mode.html b/docs/_build/html/_modules/pywps/validator/mode.html
deleted file mode 100644
index 117b400..0000000
--- a/docs/_build/html/_modules/pywps/validator/mode.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>pywps.validator.mode — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="../../../_static/jquery.js"></script>
- <script type="text/javascript" src="../../../_static/underscore.js"></script>
- <script type="text/javascript" src="../../../_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="../../../index.html" />
- <link rel="up" title="Module code" href="../../index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1>Source code for pywps.validator.mode</h1><div class="highlight"><pre>
-<span class="sd">"""Validation modes</span>
-<span class="sd">"""</span>
-
-<div class="viewcode-block" id="MODE"><a class="viewcode-back" href="../../../api.html#pywps.validator.mode.MODE">[docs]</a><span class="k">class</span> <span class="nc">MODE</span><span class="p">():</span>
- <span class="sd">"""Validation mode enumeration</span>
-<span class="sd"> """</span>
- <span class="n">NONE</span> <span class="o">=</span> <span class="mi">0</span>
- <span class="n">SIMPLE</span> <span class="o">=</span> <span class="mi">1</span>
- <span class="n">STRICT</span> <span class="o">=</span> <span class="mi">2</span>
- <span class="n">VERYSTRICT</span> <span class="o">=</span> <span class="mi">3</span></div>
-</pre></div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="../../../index.html">
- <img class="logo" src="../../../_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="../../../index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/_sources/api.txt b/docs/_build/html/_sources/api.txt
deleted file mode 100644
index fd3ca32..0000000
--- a/docs/_build/html/_sources/api.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-#############
-PyWPS API Doc
-#############
-
-.. module:: pywps
-
-
-Process
-=======
-
-.. autoclass:: Process
-
-Inputs and outputs
-==================
-
-.. autoclass:: pywps.validator.mode.MODE
- :members:
- :undoc-members:
-
-Most of the inputs nad outputs are derived from the `IOHandler` class
-
-.. autoclass:: pywps.inout.basic.IOHandler
-
-
-LiteralData
------------
-
-.. autoclass:: LiteralInput
-
-.. autoclass:: LiteralOutput
-
-.. autoclass:: pywps.inout.literaltypes.AnyValue
-
-.. autoclass:: pywps.inout.literaltypes.AllowedValue
-
-.. autodata:: pywps.inout.literaltypes.LITERAL_DATA_TYPES
-
-
-ComplexData
------------
-
-.. autoclass:: ComplexInput
-
-.. autoclass:: ComplexOutput
-
-.. autoclass:: Format
-
-.. autodata:: pywps.inout.formats.FORMATS
- :annotation:
-
- List of out of the box supported formats. User can add custom formats to the
- array.
-
-.. autofunction:: pywps.validator.complexvalidator.validategml
-
-BoundingBoxData
----------------
-
-.. autoclass:: BoundingBoxInput
-
-.. autoclass:: BoundingBoxOutput
-
-Request and response objects
-----------------------------
-
-.. autodata:: pywps.app.WPSResponse.STATUS
- :annotation:
-
- Process status information
-
-.. autoclass:: pywps.app.WPSRequest
- :members:
-
- .. attribute:: operation
-
- Type of operation requested by the client. Can be
- `getcapabilities`, `describeprocess` or `execute`.
-
- .. attribute:: http_request
-
- .. TODO link to werkzeug docs
-
- Original Werkzeug HTTPRequest object.
-
- .. attribute:: inputs
-
- .. TODO link to werkzeug docs
-
- A MultiDict object containing input values sent by the client.
-
-
-.. autoclass:: pywps.app.WPSResponse
- :members:
-
- .. attribute:: status
-
- Information about currently running process status
- :class:`pywps.app.WPSResponse.STATUS`
-
-
-Refer :ref:`exceptions` for their description.
diff --git a/docs/_build/html/_sources/configuration.txt b/docs/_build/html/_sources/configuration.txt
deleted file mode 100644
index 29197a2..0000000
--- a/docs/_build/html/_sources/configuration.txt
+++ /dev/null
@@ -1,196 +0,0 @@
-.. _configuration:
-
-=============
-Configuration
-=============
-
-PyWPS is configured using a configuration file. The file uses the
-`ConfigParser <https://wiki.python.org/moin/ConfigParserExamples>`_ format.
-
-.. versionadded:: 4.0.0
-.. warning:: Compatibility with PyWPS 3.x: major changes have been made
- to the config file in order to allow for shared configurations with `PyCSW
- <http://pycsw.org/>`_ and other projects.
-
-The configuration file has 3 sections:
-
- * `metadata:main` for the server metadata inputs
- * `server` for server configuration
- * `grass` for *optional* configuration to support `GRASS GIS
- <http://grass.osgeo.org>`_
-
-PyWPS ships with a sample configuration file (``default-sample.cfg``).
-A similar file is also available in the `demo` service as
-described in :ref:`demo` section.
-
-Copy the file to ``default.cfg`` and edit the following:
-
-[metadata:main]
----------------
-
-The `[metadata:main]` section was designed according to the `PyCSW project
-configuration file <http://docs.pycsw.org/en/latest/configuration.html>`_.
-
-:identification_title:
- the title of the service
-:identification_abstract:
- some descriptive text about the service
-:identification_keywords:
- comma delimited list of keywords about the service
-:identification_keywords_type:
- keyword type as per the `ISO 19115 MD_KeywordTypeCode codelist
- <http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode>`_).
- Accepted values are ``discipline``, ``temporal``, ``place``, ``theme``,
- ``stratum``
-:identification_fees:
- fees associated with the service
-:identification_accessconstraints:
- access constraints associated with the service
-:provider_name:
- the name of the service provider
-:provider_url:
- the URL of the service provider
-:contact_name:
- the name of the provider contact
-:contact_position:
- the position title of the provider contact
-:contact_address:
- the address of the provider contact
-:contact_city:
- the city of the provider contact
-:contact_stateorprovince:
- the province or territory of the provider contact
-:contact_postalcode:
- the postal code of the provider contact
-:contact_country:
- the country of the provider contact
-:contact_phone:
- the phone number of the provider contact
-:contact_fax:
- the facsimile number of the provider contact
-:contact_email:
- the email address of the provider contact
-:contact_url:
- the URL to more information about the provider contact
-:contact_hours:
- the hours of service to contact the provider
-:contact_instructions:
- the how to contact the provider contact
-:contact_role:
- the role of the provider contact as per the `ISO 19115 CI_RoleCode codelist
- <http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode>`_).
- Accepted values are ``author``, ``processor``, ``publisher``, ``custodian``,
- ``pointOfContact``, ``distributor``, ``user``, ``resourceProvider``,
- ``originator``, ``owner``, ``principalInvestigator``
-
-[server]
---------
-
-:url:
- the URL of the WPS service endpoint
-
-:language:
- the ISO 639-1 language and ISO 3166-1 alpha2 country code of the service
- (e.g. ``en-CA``, ``fr-CA``, ``en-US``)
-
-:encoding:
- the content type encoding (e.g. ``ISO-8859-1``, see
- https://docs.python.org/2/library/codecs.html#standard-encodings). Default
- value is 'UTF-8'
-
-:loglevel:
- the logging level (see
- http://docs.python.org/library/logging.html#logging-levels)
-
-:logfile:
- the full file path to the log file
-
-:parallelprocesses:
- maximum number of parallel running processes - set this number carefully.
- The effective number of parallel running processes is limited by the number
- of cores in the processor of the hosting machine. As well, speed and
- response time of hard drives impact ultimate processing performance. A
- reasonable number of parallel running processes is not higher than the
- number of processor cores.
-
-:logdatabase:
- SQLite3 file, where the login about requests/responses is to be stored. It
- can be set to `":memory:"` to store the database in memory.
-
-:maxrequestsize:
- maximal request size. 0 for no limit
-
-:workdir:
- a directory to store all temporary files (which should be always deleted,
- once the process is finished).
-
-:outputpath:
- server path where to store output files.
-
-:outputurl:
- corresponding URL
-
-.. note:: `outputpath` and `outputurl` must corespond. `outputpath` is the name
- of the resulting target directory, where all output data files are
- stored (with unique names). `outputurl` is the corresponding full URL,
- which is targeting to `outputpath` directory.
-
- Example: `outputpath=/var/www/wps/outputs` shall correspond with
- `outputurl=http://foo.bar/wps/outputs`
-
-
-[grass]
--------
-
-:gisbase:
- directory of the GRASS GIS instalation, refered as `GISBASE
- <https://grass.osgeo.org/grass73/manuals/variables.html>`_
-
------------
-Sample file
------------
-::
-
- [server]
- encoding=utf-8
- language=en-US
- url=http://localhost/wps
- maxoperations=30
- maxinputparamlength=1024
- maxsingleinputsize=
- maxrequestsize=3mb
- temp_path=/tmp/pywps/
- processes_path=
- outputurl=/data/
- outputpath=/tmp/outputs/
- logfile=
- loglevel=INFO
- logdatabase=
- workdir=
-
- [metadata:main]
- identification_title=PyWPS Processing Service
- identification_abstract=PyWPS is an implementation of the Web Processing Service standard from the Open Geospatial Consortium. PyWPS is written in Python.
- identification_keywords=PyWPS,WPS,OGC,processing
- identification_keywords_type=theme
- identification_fees=NONE
- identification_accessconstraints=NONE
- provider_name=Organization Name
- provider_url=http://pywps.org/
- contact_name=Lastname, Firstname
- contact_position=Position Title
- contact_address=Mailing Address
- contact_city=City
- contact_stateorprovince=Administrative Area
- contact_postalcode=Zip or Postal Code
- contact_country=Country
- contact_phone=+xx-xxx-xxx-xxxx
- contact_fax=+xx-xxx-xxx-xxxx
- contact_email=Email Address
- contact_url=Contact URL
- contact_hours=Hours of Service
- contact_instructions=During hours of service. Off on weekends.
- contact_role=pointOfContact
-
- [grass]
- gisbase=/usr/local/grass-7.3.svn/
diff --git a/docs/_build/html/_sources/deployment.txt b/docs/_build/html/_sources/deployment.txt
deleted file mode 100644
index 5619aa3..0000000
--- a/docs/_build/html/_sources/deployment.txt
+++ /dev/null
@@ -1,168 +0,0 @@
-.. _deployment:
-
-=================================
-Deployment to a production server
-=================================
-
-As already described in the :ref:`installation` section, no specific deployment
-procedures are for PyWPS when using flask-based server. But this formula is not
-intended to be used in a production environment. For production, `Apache httpd
-<https://httpd.apache.org/>`_ or `nginx <https://nginx.org/>`_ servers are
-more advised. PyWPS is runs as a `WSGI
-<https://wsgi.readthedocs.io/en/latest/>`_ application on those servers. PyWPS
-relies on the `Werkzeug <http://werkzeug.pocoo.org/>`_ library for this purpose.
-
-Deoploying an individual PyWPS instance
----------------------------------------
-
-PyWPS should be installed in your computer (as per the :ref:`installation`
-section). As a following step, you can now create several instances of your WPS
-server.
-
-It is advisable for each PyWPS instance to have its own directory, where the
-WSGI file along with available processes should reside. Therefore create a new
-directory for the PyWPS instance::
-
- $ sudo mkdir /var/www/pywps/
-
- # create a directory for your processes too
- $ sudo mkdir /var/www/pywps/processes
-
-.. note:: In this configuration example it is assumed that there is only one
- instance of PyWPS on the server.
-
-Each instance is represented by a single `WSGI` script (written in Python),
-which:
-
- 1. Loads the configuration files
- 2. Serves processes
- 3. Takes care about maximum number of concurrent processes and similar
-
-Creating a PyWPS `WSGI` instance
---------------------------------
-
-An example WSGI script is distributed along with PyWPS-Demo service, as
-described in the :ref:`installation` section. The script is actually
-straightforward - in fact, it's a just wrapper around the PyWPS server with a
-list of processes and configuration files passed as arguments. Here is an
-example of a PyWPS WSGI script::
-
- $ $EDITOR /var/www/pywps/pywps.wcgi
-
-.. code-block:: python
- :linenos:
-
- #!/usr/bin/env python3
-
- from pywps.app.Service import Service
-
- # processes need to be installed in PYTHON_PATH
- from processes.sleep import Sleep
- from processes.ultimate_question import UltimateQuestion
- from processes.centroids import Centroids
- from processes.sayhello import SayHello
- from processes.feature_count import FeatureCount
- from processes.buffer import Buffer
- from processes.area import Area
-
- processes = [
- FeatureCount(),
- SayHello(),
- Centroids(),
- UltimateQuestion(),
- Sleep(),
- Buffer(),
- Area()
- ]
-
- # Service accepts two parameters:
- # 1 - list of process instances
- # 2 - list of configuration files
- application = Service(
- processes,
- ['/var/www/pywps/pywps.cfg']
- )
-
-.. note:: The WSGI script is assuming that there are already some
- processes at hand that can be directly included. Also it assumes, that
- the configuration file already exists - which is not the case yet.
-
- The Configuration is described in next chapter (:ref:`configuration`),
- as well as process creation and deployment (:ref:`process`).
-
-Deployment on Apache2 httpd server
-----------------------------------
-
-First, the WSGI module must be installed and enabled::
-
- $ sudo apt-get install libapache2-mod-wsgi
- $ sudo a2enmod wsgi
-
-You then can edit your site configuration file
-(`/etc/apache2/sites-enabled/yoursite.conf`) and add the following::
-
- # PyWPS-4
- WSGIDaemonProcess pywps user=www-data group=www-data processes=2 threads=5
- WSGIScriptAlias /pywps /var/www/pywps/pywps.wsgi
-
- <Directory /home/jachym/www/htdocs/wps/>
- WSGIScriptReloading On
- WSGIProcessGroup group
- WSGIApplicationGroup %{GLOBAL}
- Order deny,allow
- Allow from all
- </Directory>
-
-.. note:: `WSGIScriptAlias` points to the `pywps.wsgi` script created
- before - it will be available under the url http://localhost/pywps
-
-And of course restart the server::
-
- $ sudo service apache2 restart
-
-
-Deployment on nginx
--------------------
-
-.. note:: We are currently missing documentation about `nginx`.
- Please help documenting the deployment of PyWPS to nginx.
-
-You should be able to deploy PyWPS on nginx as a standard WSGI application. The
-best documentation is probably to be found at `Readthedocs
-<http://uwsgi-docs.readthedocs.io/en/latest/WSGIquickstart.html>`_.
-
-.. _deployment-testing:
-
-Testing the deployment of a PyWPS instance
-------------------------------------------
-
-.. note:: For the purpose of this documentation, it is assumed that you've
- installed PyWPS using the `localhost` server domain name.
-
-As stated, before, PyWPS should be available at http://localhost/pywps, we now
-can visit the url (or use `wget`)::
-
- # the --content-error parameter makes sure, error response is displayed
- $ wget --content-error -O - "http://localhost/pywps"
-
-The result should be an XML-encoded error message.
-
-.. code-block:: xml
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- PyWPS 4.0.0-alpha2 -->
- <ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd" version="1.0.0">
- <ows:Exception exceptionCode="MissingParameterValue" locator="service" >
- <ows:ExceptionText>service</ows:ExceptionText>
- </ows:Exception>
- </ows:ExceptionReport>
-
-The server responded with the :py:class:`pywps.exceptions.MissingParameterValue`
-exception, telling us that the parameter `service` was not set. This is
-compliant with the OGC WPS standard, since each request mast have at least the
-`service` and `request` parameters. We can say for now, that this PyWPS
-instance is properly deployed on the server, since it returns proper exception
-report.
-
-We now have to configure the instance by editing the `pywps.cfg` file and adding
-some processes.
diff --git a/docs/_build/html/_sources/development.txt b/docs/_build/html/_sources/development.txt
deleted file mode 100644
index 6a9f34d..0000000
--- a/docs/_build/html/_sources/development.txt
+++ /dev/null
@@ -1,120 +0,0 @@
-================
-Developers Guide
-================
-
-If you identify a bug in the PyWPS code base and want to fix it, if you would
-like to add further functionality, or if you wish to expand the documentation,
-you are welcomed to contribute such changes. However, contributions to the
-code base must follow an orderly process, described below. This facilitates
-both the work on your contribution as its review.
-
-0. GitHub account
------------------
-
-The PyWPS source code is hosted at GitHub, therefore you need an account to contribute.
-If you do not have one, you can follow
-`these instructions <https://help.github.com/categories/setup/>`_.
-
-1. Open a new issue
--------------------
-
-The first action to take is to clearly identify the goal of your contribution.
-Be it a bug fix, a new feature or documentation, a clear record must be left
-for future tracking. This is made by opening an issue at the `GitHub issue
-tracker <https://github.com/geopython/pywps/issues>`_. In this new issue you
-should identify not only the subject or goal, but also a draft
-of the changes you expect to achieve. For example:
-
- **Title**: Process class must be magic
-
- **Description**: The Process class must start performing some magics. Give it
- a magic wand.
-
-
-2. Fork and clone the PyWPS repository
---------------------------------------
-
-When you start modifying to the code, there is always the possibility for
-something to go wrong, rendering PyWPS unusable. The first action to avoid such
-a situation is to create a development sand box. In GitHub this can
-easily be made by creating a fork of the main PyWPS repository. Access the
-`PyWPS code repository <https://github.com/geopython/PyWPS>`_ and click the
-*Fork* button. This action creates a copy of the repository associated with
-your GitHub user. For more details please read `the forking guide
-<https://guides.github.com/activities/forking/>`_.
-
-Now you can clone this forked repository into your development environment,
-issuing a command like::
-
- git clone https://github.com/<github-user>/PyWPS.git pywps
-
-Where you should replace *<github-user>* with your GitHub user name.
-
-You can finally start programming your new feature, or fixing that bug you
-found. Keep in mind that PyWPS depends on a few libraries, refer to the
-:ref:`installation` section to make sure you have all of them installed.
-
-
-3. Commit and pull request
---------------------------
-
-If your modification to code is relatively small and can be included in a
-single *commit* then all you need to is reference the issue in the **commit**
-message, e.g.::
-
- git commit -m "Fixes #107"
-
-Where *107* is the number of the issue you opened initially in the PyWPS
-issue tracker. Please refer to `the guide on closing issues with commits
-messages
-<https://help.github.com/articles/closing-issues-via-commit-messages/>`_. Then
-you push the changes to your forked repository, issuing a command like::
-
- git push origin master
-
-Finally you an create a pull request. This it is a formal request to merge your
-contribution with the code base; it is fully managed by GitHub and greatly
-facilitates the review process. You do so by accessing the repository
-associated with your user and clicking the *New pull request* button. Make sure
-your contribution is not creating conflicts and click *Create pull request*.
-If needed, there is also a `guide on pull requests
-<https://help.github.com/articles/creating-a-pull-request/>`_.
-
-If you contribution is more substantial, and composed of multiple commits, then
-you must identify the issue it closes in the pull request itself. Check out
-`this guide
-<https://github.com/blog/1506-closing-issues-via-pull-requests>`_ for
-the details.
-
-The members of the PyWPS PSC are then notified if your pull request. They
-review your contribution and hopefully accept merging it to the code base.
-
-
-4. Updating local repository
-----------------------------
-
-Later on, if you wish to make further contributions, you must make sure to be
-working with the very latest version of the code base. You can add another
-*remote* reference in your local repository pointing to the main PyWPS
-repository::
-
- git remote add upstream https://github.com/geopython/PyWPS
-
-Then you can use the *fetch* command to update your local repository metadata::
-
- git fetch upstream
-
-Finally you use a *pull* command to merge the latest *commits* into your local
-repository::
-
- git pull upstream master
-
-
-5. Help and discussion
-----------------------
-
-If you have any doubts or questions about this contribution process or about the
-code please use the `PyWPS mailing list
-<http://lists.osgeo.org/mailman/listinfo/pywps-dev>`_ . This is also the right
-place to propose and discuss the changes you intend to introduce.
-
diff --git a/docs/_build/html/_sources/exceptions.txt b/docs/_build/html/_sources/exceptions.txt
deleted file mode 100644
index 0015cb7..0000000
--- a/docs/_build/html/_sources/exceptions.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-.. _exceptions:
-
-==========
-Exceptions
-==========
-
-.. module:: pywps.exceptions
-
-PyWPS-4 will throw exceptions based on the error occurred.
-The exceptions will point out what is missing or what went wrong
-as accurately as possible.
-
-Here is the list of Exceptions and HTTP error codes associated with them:
-
-.. autoclass:: NoApplicableCode
-
-.. autoclass:: InvalidParameterValue
-
-.. autoclass:: MissingParameterValue
-
-.. autoclass:: FileSizeExceeded
-
-.. autoclass:: VersionNegotiationFailed
-
-.. autoclass:: OperationNotSupported
-
-.. autoclass:: StorageNotSupported
-
-.. autoclass:: NotEnoughStorage
diff --git a/docs/_build/html/_sources/external_tools.txt b/docs/_build/html/_sources/external_tools.txt
deleted file mode 100644
index 417c37e..0000000
--- a/docs/_build/html/_sources/external_tools.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-########################
-PyWPS and external tools
-########################
-
-=========
-GRASS GIS
-=========
-
-.. todo:: How to setup and get GRASS GIS up and running with PyWPS and example
- process
diff --git a/docs/_build/html/_sources/index.txt b/docs/_build/html/_sources/index.txt
deleted file mode 100644
index cd2d9bf..0000000
--- a/docs/_build/html/_sources/index.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-=====================================
-Welcome to the PyWPS-4 documentation!
-=====================================
-
-.. note:: Please be awere that PyWPS-4 is still in pre-release state,
- there is no stable release yet.
-
-
-PyWPS is a server side implementation of the `OGC Web Processing Service
-(OGC WPS) standard <http://opengeospatial.org/standards/wps>`_ , using the
-`Python <http://python.org>`_ programming language. PyWPS is currently
-supporting WPS 1.0.0. Support for the version 2.0.0. of OGC WPS standard is
-presently being planned.
-
-PyWPS has a bicycle in it's logo, because:
-
-* It's simple to maintain
-* It's fast to drive
-* It can carry a lot
-* It's easy to hack
-
-**Mount your bike and setup & configure your PyWPS instance!**
-
-.. todo::
- * request queue management (probably linked from documentation)
- * inputs and outputs IOhandler class description (file, stream, ...)
-
-Contents:
----------
-
-.. toctree::
- :maxdepth: 2
-
- wps
- pywps
- install
- configuration
- process
- deployment
- migration
- external_tools
- api
- development
- exceptions
-
-
-
-==================
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
diff --git a/docs/_build/html/_sources/install.txt b/docs/_build/html/_sources/install.txt
deleted file mode 100644
index 0c1e71b..0000000
--- a/docs/_build/html/_sources/install.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-.. _installation:
-
-============
-Installation
-============
-
-
-.. note:: PyWPS-4 is not tested on the MS Windows platform. Please join the
- development team if you need this platform to be supported. This is mainly
- because of the lack of a multiprocessing library. It is used to process
- asynchronous execution, i.e., when making requests storing the response
- document and updating a status document displaying the progress of
- execution.
-
-
-Dependencies and requirements
------------------------------
-
-PyWPS-4 runs on Python 2.7, 3.3 or newer. PyWPS is currently tested and
-developed on Linux (mostly Ubuntu). In the documentation we take this
-distribution as reference.
-
-Prior to installing PyWPS-4, Git and the Python bindings for GDAL must be
-installed in the system. In Debian based systems these packages can be
-installed with a tool like *apt*::
-
- $ sudo apt install git python-gdal
-
-
-Download and install
---------------------
-
-Using PIP
- The easiest way to install PyWPS-4 is using the Python Package Index
- (PIP). It fetches the source code from the repository and installs it
- automatically in the system. This might require superuser permissions
- (e.g. *sudo* in Debian based systems)::
-
- $ sudo pip install -e git+https://github.com/geopython/pywps.git@master#egg=pywps-dev
-
-Manual installation
- In alternative PyWPS-4 can be installed manually.
- It requires the cloning of the source code from the repository and then the
- usage of the `setup.py` script. An example again for Debian based systems (note
- the usage of `sudo` for install)::
-
- $ git clone https://github.com/geopython/pywps.git pywps-4
-
- $ cd pywps-4/
-
- Then install the package dependencies using pip::
-
- $ pip install -r requirements.txt
- $ pip install -r requirements-dev.txt # for developer tasks
-
- To install PyWPS system-wide run::
-
- $ sudo python setup.py install
-
-.. _demo:
-
-The demo service and its sample processes
------------------------------------------
-
-To use PyWPS-4 the user must code processes and publish them through a service.
-A demo service is available that makes up a good starting point for first time
-users. This launches a very simple built-in server (relying on `flask
-<http://flask.pocoo.org/>`_), which is good enough for testing but probably not
-appropriate for production. It can be cloned directly into the user
-area::
-
- $ git clone https://github.com/geopython/pywps-demo.git
-
-It may be run right away through the `demo.py` script. First time users should
-start by studying the demo project structure and then code their own processes.
-
-Full more details please consult the :ref:`process` section. The `demo` service
-contains some basic processes too, so you could get started with some examples
-(like `area`, `buffer`, `feature_count` and `grassbuffer`). These processes are
-to be taken just as inspiration and code documentation - most of them do not
-make any sense (e.g. `sayhello`).
diff --git a/docs/_build/html/_sources/migration.txt b/docs/_build/html/_sources/migration.txt
deleted file mode 100644
index e1ac976..0000000
--- a/docs/_build/html/_sources/migration.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-==============================
-Migrating from PyWP 3.x to 4.x
-==============================
-
-TODO
diff --git a/docs/_build/html/_sources/process.txt b/docs/_build/html/_sources/process.txt
deleted file mode 100644
index 6421af3..0000000
--- a/docs/_build/html/_sources/process.txt
+++ /dev/null
@@ -1,395 +0,0 @@
-.. currentmodule:: pywps
-
-.. _process:
-
-#########
-Processes
-#########
-
-.. versionadded:: 4.0.0
-
-.. todo::
- * Input validation
- * IOHandler
-
-PyWPS works with processes and services. A process is a Python `Class`
-containing an `handler` method and a list of inputs and outputs. A PyWPS
-service instance is then a collection of selected processes.
-
-PyWPS does not ship with any processes predefined - it's on you, as user of
-PyWPS to set up the processes of your choice. PyWPS is here to help you
-publishing your awesome geospatial operation on the web - it takes care of
-communication and security, you then have to add the content.
-
-.. note:: There are some example processes in the `PyWPS-Demo`_ project.
-
-Writing a Process
-=================
-
-.. note:: At this place, you should prepare your environment for final
- :ref:`deployment`. At least, you should create a single directory with
- your processes, which is typically named `processes`::
-
- $ mkdir processes
-
- In this directory, we will create single python scripts containing
- processes.
-
- Processes can be located *anywhere in the system* as long as their
- location is identified in the :envvar:`PYTHONPATH` environment
- variable, and can be imported in the final server instance.
-
-A processes is coded as a class inheriting from :class:`Process`.
-In the `PyWPS-Demo`_ server they are
-kept inside the *processes* folder, usually in separated files.
-
-The instance of a *Process* needs following attributes to be configured:
-
-:identifier:
- unique identifier of the process
-:title:
- corresponding title
-:inputs:
- list of process inputs
-:outputs:
- list of process outputs
-:handler:
- method which recieves :class:`pywps.app.WPSRequest` and :class:`pywps.app.WPSResponse` as inputs.
-
-Example vector buffer process
-=============================
-
-As an example, we will create a *buffer* process - which will take a vector
-file as the input, create specified the buffer around the data (using `Shapely
-<http://toblerity.org/shapely/>`_), and return back the result.
-
-Therefore, the process will have two inputs:
-
-* `ComplexData` input - the vector file
-* `LiteralData` input - the buffer size
-
-And it will have one output:
-
-* `ComplexData` output - the final buffer
-
-The process can be called `demobuffer` and we can now start coding it::
-
- $ cd processes
- $ $EDITOR demobuffer.py
-
-At the beginning, we have to import the required classes and modules
-
-Here is a very basic example:
-
-.. literalinclude:: demobuffer.py
- :language: python
- :lines: 10-12
- :linenos:
- :lineno-start: 10
-
-As the next step, we define a list of inputs. The first input is
-:class:`pywps.ComplexInput` with the identifier `vector`, title `Vector map`
-and there is only one allowed format: GML.
-
-The next input is :class:`pywps.LiteralInput`, with the identifier `size` and
-the data type set to `float`:
-
-.. literalinclude:: demobuffer.py
- :language: python
- :lines: 14-21
- :linenos:
- :lineno-start: 14
-
-Next we define the output `output` as :class:`pywps.ComplexOutput`. This
-output supports GML format only.
-
-.. literalinclude:: demobuffer.py
- :language: python
- :lines: 23-27
- :linenos:
- :lineno-start: 23
-
-Next we create a new list variables for inputs and outputs.
-
-.. literalinclude:: demobuffer.py
- :language: python
- :lines: 29-30
- :linenos:
- :lineno-start: 29
-
-Next we define the *handler* method. In it, *geospatial analysis
-may happen*. The method gets a :class:`pywps.app.WPSRequest` and a
-:class:`pywps.app.WPSResponse` object as parameters. In our case, we
-calculate the buffer around each vector feature using
-`GDAL/OGR library <http://gdal.org>`_. We will not got much into the details,
-what you should note is how to get input data from the
-:class:`pywps.app.WPSRequest` object and how to set data as outputs in the
-:class:`pywps.app.WPSResponse` object.
-
-.. literalinclude:: demobuffer.py
- :language: python
- :pyobject: _handler
- :emphasize-lines: 8-12, 50-54
- :linenos:
- :lineno-start: 45
-
-At the end, we put everything together and create new a `DemoBuffer` class with
-handler, inputs and outputs. It's based on :class:`pywps.Process`:
-
-.. literalinclude:: demobuffer.py
- :pyobject: DemoBuffer
- :language: python
- :linenos:
- :lineno-start: 32
-
-
-Declaring inputs and outputs
-============================
-
-Clients need to know which inputs the processes expects. They can be declared
-as :class:`pywps.Input` objects in the :class:`Process` class declaration:
-
-.. code-block:: python
-
- from pywps import Process, LiteralInput, LiteralOutput
-
- class FooProcess(Process):
- def __init__(self):
- inputs = [
- LiteralInput('foo', data_type='string'),
- ComplexInput('bar', [Format('text/xml')])
- ]
- outputs = [
- LiteralOutput('foo_output', data_type='string'),
- ComplexOutput('bar_output', [Format('JSON')])
- ]
-
- super(FooProcess, self).__init__(
- ...
- inputs=inputs,
- outputs=outputs
- )
- ...
-
-.. note:: A more generic description can be found in :ref:`wps` chapter.
-
-LiteralData
------------
-
-* :class:`LiteralInput`
-* :class:`LiteralOutput`
-
-A simple value embedded in the request. The first argument is a
-name. The second argument is the type, one of `string`, `float`,
-`integer` or `boolean`.
-
-ComplexData
------------
-
-* :class:`ComplexInput`
-* :class:`ComplexOutput`
-
-A large data object, for example a layer. ComplexData do have a `format`
-attribute as one of their key properties. It's either a list of supported
-formats or a single (already selected) format. It shall be an instance of
-the :class:`pywps.inout.formats.Format` class.
-
-ComplexData :class:`Format` and input validation
-------------------------------------------------
-The ComplexData needs as one of its parameters a list of supported data
-formats. They are derived from the :class:`Format` class. A :class:`Format`
-instance needs, among others, a `mime_type` parameter, a `validate`
-method -- which is used for input data validation -- and also a `mode`
-parameter -- defining how strict the validation should be (see
-:class:`pywps.validator.mode.MODE`).
-
-The `Validate` method is up to you, the user, to code. It requires two input
-paramers - `data_input` (a :class:`ComplexInput` object), and `mode`. This
-methid must return a `boolean` value indicating whether the input data are
-considered valid or not for given `mode`. You can draw inspiration from the
-:py:func:`pywps.validator.complexvalidator.validategml` method.
-
-The good news is: there are already predefined validation methods for the ESRI
-Shapefile, GML and GeoJSON formats, using GDAL/OGR. There is also an XML Schema
-validaton and a JSON schema validator - you just have to pick the propper
-supported formats from the :class:`pywps.inout.formats.FORMATS` list and set
-the validation mode to your :class:`ComplexInput` object.
-
-Even better news is: you can define custom validation functions and validate
-input data according to your needs.
-
-BoundingBoxData
----------------
-
-* :class:`BoundingBoxInput`
-* :class:`BoundingBoxOutput`
-
-BoundingBoxData contain information about the bounding box of the desired area
-and coordinate reference system. Interesting attributes of the BoundingBoxData
-are:
-
-`crs`
- current coordinate reference system
-`dimensions`
- number of dimensions
-`ll`
- pair of coordinates (or triplet) of the lower-left corner
-`ur`
- pair of coordinates (or triplet) of the upper-right corner
-
-
-Accessing the inputs and outputs in the `handler` method
-========================================================
-
-Handlers receive as input argument a :class:`WPSRequest` object. Input
-values are found in the `inputs` dictionary::
-
- @staticmethod
- def _handler(request, response):
- name = request.inputs['name'][0].data
- response.outputs['output'].data = 'Hello world %s!' % name
- return response
-
-`inputs` is a plain Python dictionary.
-Most of the inputs and outputs are derived from the :class:`IOHandler` class.
-This enables the user to access the data in 3 different ways:
-
-`input.file`
- Returns a file name - you can access the data using the name of the file
- stored on the hard drive.
-`input.data`
- Is the direct link to the data themselves. No need to create a file object
- on the hard drive or opening the file and closing it - PyWPS will do
- everything for you.
-`input.stream`
- Provides the IOStream of the data. No need for opening the file, you just
- have to `read()` the data.
-
-PyWPS will persistently transform the input (and output) data to the desired
-form. You can also set the data for your `Output` object like `output.data = 1`
-or `output.file = "myfile.json"` - it works the same way.
-
-Example::
-
- request.inputs['file_input'][0].file
- request.inputs['data_input'][0].data
- request.inputs['stream_input'][0].stream
-
-Because there could be multiple input values with the same identifier, the
-inputs are accessed with an index. For `LiteralInput`, the value is a string.
-For `ComplexInput`, the value is an open file object, with a `mime_type`
-attribute::
-
- @staticmethod
- def handler(request, response):
- layer_file = request.inputs['layer'][0].file
- mime_type = layer_file.mime_type
- bytes = layer_file.read()
- msg = ("You gave me a file of type %s and size %d"
- % (mime_type, len(bytes)))
- response.outputs['output'].data = msg
- return response
-
-Progress and status report
-==========================
-
-OGC WPS standard enables asynchronous process execution call, that is in
-particular useful, when the process execution takes longer time - process
-instance is set to background and WPS Execute Response document with `ProcessAccepted`
-messag is returned immediately to the client. The client has to check
-`statusLocation` URL, where the current status report is deployed, say every
-n-seconds or n-minutes (depends on calculation time). Content of the response is
-usually `percentDone` information about the progress along with `statusMessage`
-text information, what is currently happening.
-
-You can set process status any time in the `handler` using the
-:py:func:`WPSResponse.update_status` function.
-
-
-Returning large data
-====================
-WPS allows for a clever method of returning a large data file: instead
-of embedding the data in the response, it can be saved separately, and
-a URL is returned from where the data can be downloaded. In the current
-implementation, PyWPS-4 saves the file in a folder specified
-in the configuration passed by the service (or in a default location).
-The URL returned is embedded in the XML response.
-
-This behaviour can be requested either by using a GET::
-
- ...ResponseDocument=output=@asReference=true...
-
-Or a POST request::
-
- ...
- <wps:ResponseForm>
- <wps:ResponseDocument>
- <wps:Output asReference="true">
- <ows:Identifier>output</ows:Identifier>
- <ows:Title>Some Output</ows:Title>
- </wps:Output>
- </wps:ResponseDocument>
- </wps:ResponseForm>
- ...
-
-**output** is the identifier of the output the user wishes to have stored
-and accessible from a URL. The user may request as many outputs by reference
-as needed, but only *one* may be requested in RAW format.
-
-
-Process deployment
-==================
-In order for clients to invoke processes, a PyWPS
-:class:`Service` class must be present with the ability to listen for requests.
-An instance of this class must created, receiving instances of
-all the desired processes classes.
-
-In the *demo* service the :class:`Service` class instance is created in the
-:class:`Server` class. :class:`Server` is a development server that relies
-on `Flask`_. The publication of processes is encapsulated in *demo.py*, where
-a main method passes a list of processes instances to the
-:class:`Server` class::
-
- from pywps import Service
- from processes.helloworld import HelloWorld
- from processes.demobuffer import DemoBuffer
-
- ...
- processes = [ DemoBuffer(), ... ]
-
- server = Server(processes=processes)
-
- ...
-
-Running the dev server
-======================
-
-The :ref:`demo` server is a `WSGI application`_ that accepts incoming `Execute`
-requests and calls the appropriate process to handle them. It also
-answers `GetCapabilities` and `DescribeProcess` requests based on the
-process identifier and their inputs and outputs.
-
-.. _WSGI application: http://werkzeug.pocoo.org/docs/terms/#wsgi
-
-
-A host, a port, a config file and the processes can be passed as arguments to the
-:class:`Server` constructor.
-**host** and **port** will be **prioritised** if passed to the constructor,
-otherwise the contents of the config file (*pywps.cfg*) are used.
-
-
-Use the `run` method to start the server::
-
- ...
- s = Server(host='0.0.0.0', processes=processes, config_file=config_file)
-
- s.run()
- ...
-
-
-To make the server visible from another computer, replace ``localhost`` with ``0.0.0.0``.
-
-.. _Flask: http://flask.pocoo.org
-.. _PyWPS-Demo: http://github.com/geopython/pywps-demo
-
-
diff --git a/docs/_build/html/_sources/pywps.txt b/docs/_build/html/_sources/pywps.txt
deleted file mode 100644
index ddabe2a..0000000
--- a/docs/_build/html/_sources/pywps.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-.. _pywps:
-
-=====
-PyWPS
-=====
-
-.. todo::
-
- * how are thnigs organised
- * storage
- * dblog
- * relationship to grass gis
-
-PyWPS philosophy
-----------------
-
-PyWPS is simple, fast to run, has low requirements on system resources, is
-modular. PyWPS solves the problem of exposing geospatial calculations to the
-web, taking care of security, data download, request acceptance, process running
-and final response construction. Therefore PyWPS has a bicycle in its logo.
-
-Why is PyWPS there
-------------------
-
-Many scientific researchers and geospatial services provider need to setup
-system, where the geospatial operations would be calculated on the server, while
-the system resources could be exposed to clients. PyWPS is here, so that you
-could set up the server fast, deploy your awesome geospatial calculation and
-expose it to the world. PyWPS is written in Python with support for many
-geospatial tools out there, like GRASS GIS, R-Project or GDAL. Python is the
-most geo-positive scripting language out there, therefore all the best tools
-have their bindings to Python in their pocket.
-
-PyWPS History
--------------
-
-PyWPS started in 2006 as scholarship funded by `German Foundation for
-Environment <http://dbu.de>`_. During the years, it grow to version 4.0.x. In
-2015, we officially entered to `OSGeo <http://osgeo.org>`_ incubation process.
-In 2016, `Project Steering Committee <http://pywps.org/development/psc.html>`_ has started.
-PyWPS was originally hosted by the `Wald server <http://wald.intevation.org>`_,
-nowadays, we moved to `GeoPython group on GitHub
-<http://gitub.com/geopython/>`_. Since 2016, we also have new domain `PyWPS.org
-<http://pywps.org>`_.
-
-You can find more at `history page <http://pywps.org/history>`_.
diff --git a/docs/_build/html/_sources/wps.txt b/docs/_build/html/_sources/wps.txt
deleted file mode 100644
index 29e4389..0000000
--- a/docs/_build/html/_sources/wps.txt
+++ /dev/null
@@ -1,228 +0,0 @@
-.. _wps:
-
-====================================
-OGC Web Processing Service (OGC WPS)
-====================================
-
-`OGC Web Processing Service <http://opengeospatial.org/standards>`_ standard
-provides rules for standardizing how inputs and outputs (requests and
-responses) for geospatial processing services. The standard also defines how a
-client can request the execution of a process, and how the output from the
-process is handled. It defines an interface that facilitates the publishing of
-geospatial processes and clients discovery of and binding to those processes.
-The data required by the WPS can be delivered across a network or they can be
-available at the server.
-
-.. note:: This description is mainly refering to 1.0.0 version standard, since
- PyWPS implements this version only. There is also 2.0.0 version, which
- we are about to implement in near future.
-
-WPS is intended to be state-less protocol (like any OGC services). For every
-request-response action, the negotiation between the server and the client has
-to start. There is no official way, how to make the server "remember", what was
-before, there is no communication history between the server and the client.
-
-Process
--------
-
-A process `p` is a function that for each input returns a corresponding output
-
-.. math::
-
- p: X \rightarrow Y
-
-where `X` denotes the domain of arguments `x` and `Y` denotes the co-domain of values `y`.
-
-Within the specification, process arguments are referred to as *process inputs* and result
-values are referred to as *process outputs*. Processes that have no process inputs represent
-value generators that deliver constant or random process outputs.
-
-*Process* is just some geospatial operation, which has it's in- and outputs and
-which is deployed on the server. It can be something relatively simple (adding
-two raster maps together) or very complicated (climate change model). It can
-take short time (seconds) or long (days) to be calculated. Process is, what you,
-as PyWPS user, want to expose to other people and let their data processed.
-
-Every process has
-
-Identifier
- Unique process identifier
-
-Title
- Human readable title
-
-Abstract
- Longer description of the process, what it does, how is it supposed to be
- used
-
-And list of in- and outputs.
-
-Data in- and outputs
---------------------
-OGC WPS defines 3 types of data inputs and data outputs *LiteralData*,
-*ComplexData* and *BoundingBoxData*.
-
-All data types do need to have following attributes:
-
-Identifier
- Unique input identifier
-
-Title
- Human readable title
-
-Abstract
- Longer description of data input or output, so that the user could get
- oriented.
-
-minOccurs
- Minimal occurrence of the input (e.g. there can be more bands of raster file
- and they all can be passed as input using the same identifier)
-
-maxOccurs
- Maxium number of times, the input or output is present
-
-Depending on the data type (Literal, Complex, BoundingBox), other attributes
-might occur too.
-
-LiteralData
-~~~~~~~~~~~
-Literal data is any text string, usually short. It's used for passing single
-parameters like numbers or text parameters. WPS enables to the server, to define
-`allowedValues` - list or intervals of allowed values, as well as data type
-(integer, float, string). Additional attributes can be set, such as `units` or
-`encoding`.
-
-ComplexData
-~~~~~~~~~~~
-Complex data are usually raster or vector files, but basically any (usually
-file based) data, which are usually processed (or result of the process). The
-input can be specified more using `mimeType`, XML `schema` or `encoding` (such
-as `base64` for raster data.
-
-.. note:: PyWPS (like every server) supports limited list `mimeTypes`. In case
- you need some new format, just create pull request in our repository.
- Refer :const:`pywps.inout.formats.FORMATS` for more details.
-
-Usually, the minimum requirement for input data identification is `mimeType`.
-That usually is `application/gml+xml` for `GML
-<http://opengeospatial.org/standards/gml>`_-encoded vector files, `image/tiff;
-subtype=geotiff` for raster files. The input or output can also be result of any
-OGC OWS service.
-
-BoundingBoxData
-~~~~~~~~~~~~~~~
-.. todo:: add reference to OGC OWS Common spec
-
-BoundingBox data are specified in OGC OWS Common specification as two pairs of
-coordinate (for 2D and 3D space). They can either be encoded in WGS84 or EPSG
-code can be passed too. They are intended to be used as definition of the target
-region.
-
-.. note:: In real life, BoundingBox data are not that commonly used
-
-Passing data to process instance
---------------------------------
-There are 3 typical ways, how to pass the input data from the client to the
-server:
-
-**Data are on the server already**
- In the first case, the data are already stored on the server (from the point
- of view of the client). This is the simplest case.
-
-**Data are send to the server along with the request**
- In this case, the data are directly part of the XML encoded document send via
- HTTP POST. Some clients/servers are expecting the data to be inserted in
- `CDATA` section. The data can be text based (JSON), XML based (GML) or even
- raster based - in this case, they are usually encoded using `base64
- <https://docs.python.org/3/library/base64.html>`_.
-
-**Reference link to target service is passed**
- Client does not have to pass the data itself, client can just send reference
- link to target data service (or file). In such case, for example OGC WFS
- `GetFeatureType` URL can be passed and server will download the data
- automatically.
-
- Although this is usually used for `ComplexData` input type, it can be used
- for literal and bounding box data too.
-
-Sychronous versus asynchronous process request
-----------------------------------------------
-
-There are two modes of process instance execution: Synchronous and asynchronous.
-
-Synchronous mode
- The client sends the `Execute` request to the server and waits with open
- server connection, till the process is calculated and final response is
- returned back. This is useful for fast calculations which do not take
- longer then a couple of seconds (`Apache2 httpd server uses 300 seconds <http://httpd.apache.org/docs/2.4/mod/core.html#timeout>`_ as default value for ConnectionTimeout).
-
-Asynchronous mode
- Client sends the `Execute` request with explicit request for asynchronous
- mode. If supported by the process (in PyWPS, we have a configuration for
- that), the server returns back `ProcessAccepted` response immediately with
- URL, where the client can regularly check for *process execution status*.
-
- .. note:: As you see, using WPS, the client has to apply *pull* method for
- the communication with the server. Client has to be the active element
- in the communication - server is just responding to clients request and
- is not actively *pushing* any information (like it would if e.g. web
- sockets would be implemented).
-
-Process status
---------------
-`Process status` is generic status of the process instance, reporting to the
-client, how does the calculation go. There are 4 types of process statuses
-
-ProcessAccepted
- Process was accepted by the server and the process execution will start
- soon.
-
-ProcessStarted
- Process calculation has started. The status also contains report about
- `percentDone` - calculation progress and `statusMessage` - text reporting
- current calculation state (example: *"Caculationg buffer"* - 33%).
-
-ProcessFinished
- Process instance performed the calculation successfully and the final
- `Execute` response is returned to the client and/or stored on final location
-
-ProcessFailed
- There was something wrong with the process instance and the server reports
- `server exception` (see :py:mod:`pywps.exceptions`) along with the message,
- what could possibly go wrong.
-
-Request encoding, HTTP GET and POST
------------------------------------
-The request can be encoded either using Key-value-pairs (KVP) or as the
-XML-formatted document.
-
-Key-value-pair
- is usually sent via `HTTP GET request method
- <https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods>`_
- encoded directly in the URL. The keys and values are separated with `=` sign and
- each pair is separated with `&` sign (with `?` at the beginning of the request.
- Example could be the *get capabilities reques*::
-
- http://server.domain/wps?service=WPS&request=GetCapabilities&version=1.0.0
-
- In this example, there are 3 pairs of input parameter: service, request and
- version with values `WPS`, `GetCapabilities` and `1.0.0` respectively.
-
-XML
- is document sent via `HTTP POST request method
- <https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods>`_.
- The XML document can be more rich, having more parameters, better to be
- parsed in complex structures. Client can also encode whole datasets to the
- request, including raster (encoded using base64) or vector data (usually as GML file).::
-
- <?xml version="1.0" encoding="UTF-8"?>
- <wps:GetCapabilities language="cz" service="WPS" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsGetCapabilities_request.xsd">
- <wps:AcceptVersions>
- <ows:Version>1.0.0</ows:Version>
- </wps:AcceptVersions>
- </wps:GetCapabilities>
-
-.. note:: Even it might be looking more complicated to use XML over KVP, for
- some complex request it usually is more safe and efficient to use XML
- encoding. The KVP way, especially for WPS Execute request can be tricky
- and lead to unpredictable errors.
diff --git a/docs/_build/html/_static/ajax-loader.gif b/docs/_build/html/_static/ajax-loader.gif
deleted file mode 100644
index 61faf8c..0000000
Binary files a/docs/_build/html/_static/ajax-loader.gif and /dev/null differ
diff --git a/docs/_build/html/_static/basic.css b/docs/_build/html/_static/basic.css
deleted file mode 100644
index c89fc7e..0000000
--- a/docs/_build/html/_static/basic.css
+++ /dev/null
@@ -1,599 +0,0 @@
-/*
- * basic.css
- * ~~~~~~~~~
- *
- * Sphinx stylesheet -- basic theme.
- *
- * :copyright: Copyright 2007-2016 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;
-}
-
-div.sphinxsidebar #searchbox input[type="text"] {
- width: 170px;
-}
-
-div.sphinxsidebar #searchbox input[type="submit"] {
- width: 30px;
-}
-
-img {
- border: 0;
- max-width: 100%;
-}
-
-/* -- 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,
-caption:hover > a.headerlink,
-p.caption:hover > a.headerlink,
-div.code-block-caption: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 {
- 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 caption span.caption-number {
- font-style: italic;
-}
-
-table caption span.caption-text {
-}
-
-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;
-}
-
-/* -- figures --------------------------------------------------------------- */
-
-div.figure {
- margin: 0.5em;
- padding: 0.5em;
-}
-
-div.figure p.caption {
- padding: 0.3em;
-}
-
-div.figure p.caption span.caption-number {
- font-style: italic;
-}
-
-div.figure p.caption span.caption-text {
-}
-
-
-/* -- 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;
-}
-
-.optional {
- font-size: 1.3em;
-}
-
-.sig-paren {
- font-size: larger;
-}
-
-.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;
-}
-
-abbr, acronym {
- border-bottom: dotted 1px;
- cursor: help;
-}
-
-/* -- 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;
-}
-
-div.code-block-caption {
- padding: 2px 5px;
- font-size: small;
-}
-
-div.code-block-caption code {
- background-color: transparent;
-}
-
-div.code-block-caption + div > div.highlight > pre {
- margin-top: 0;
-}
-
-div.code-block-caption span.caption-number {
- padding: 0.1em 0.3em;
- font-style: italic;
-}
-
-div.code-block-caption span.caption-text {
-}
-
-div.literal-block-wrapper {
- padding: 1em 1em 0;
-}
-
-div.literal-block-wrapper div.highlight {
- margin: 0;
-}
-
-code.descname {
- background-color: transparent;
- font-weight: bold;
- font-size: 1.2em;
-}
-
-code.descclassname {
- background-color: transparent;
-}
-
-code.xref, a code {
- background-color: transparent;
- font-weight: bold;
-}
-
-h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
- 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 --------------------------------------------------- */
-
- at media print {
- div.document,
- div.documentwrapper,
- div.bodywrapper {
- margin: 0 !important;
- width: 100%;
- }
-
- div.sphinxsidebar,
- div.related,
- div.footer,
- #top-link {
- display: none;
- }
-}
\ No newline at end of file
diff --git a/docs/_build/html/_static/classic.css b/docs/_build/html/_static/classic.css
deleted file mode 100644
index d98894b..0000000
--- a/docs/_build/html/_static/classic.css
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * default.css_t
- * ~~~~~~~~~~~~~
- *
- * Sphinx stylesheet -- default theme.
- *
- * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
- */
-
- at 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, div.body blockquote {
- 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;
-}
-
-code {
- background-color: #ecf0f3;
- padding: 0 1px 0 1px;
- font-size: 0.95em;
-}
-
-th {
- background-color: #ede;
-}
-
-.warning code {
- background: #efc2c2;
-}
-
-.note code {
- 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;
-}
-
-div.code-block-caption {
- color: #efefef;
- background-color: #1c4e63;
-}
\ No newline at end of file
diff --git a/docs/_build/html/_static/comment-bright.png b/docs/_build/html/_static/comment-bright.png
deleted file mode 100644
index 551517b..0000000
Binary files a/docs/_build/html/_static/comment-bright.png and /dev/null differ
diff --git a/docs/_build/html/_static/comment-close.png b/docs/_build/html/_static/comment-close.png
deleted file mode 100644
index 09b54be..0000000
Binary files a/docs/_build/html/_static/comment-close.png and /dev/null differ
diff --git a/docs/_build/html/_static/comment.png b/docs/_build/html/_static/comment.png
deleted file mode 100644
index 92feb52..0000000
Binary files a/docs/_build/html/_static/comment.png and /dev/null differ
diff --git a/docs/_build/html/_static/default.css b/docs/_build/html/_static/default.css
deleted file mode 100644
index 81b9363..0000000
--- a/docs/_build/html/_static/default.css
+++ /dev/null
@@ -1 +0,0 @@
- at import url("classic.css");
diff --git a/docs/_build/html/_static/doctools.js b/docs/_build/html/_static/doctools.js
deleted file mode 100644
index e2e70cc..0000000
--- a/docs/_build/html/_static/doctools.js
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * doctools.js
- * ~~~~~~~~~~~
- *
- * Sphinx JavaScript utilities for all documentation.
- *
- * :copyright: Copyright 2007-2016 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;
-};
-
-/**
- * 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);
- });
-};
-
-/*
- * backward compatibility for jQuery.browser
- * This will be supported until firefox bug is fixed.
- */
-if (!jQuery.browser) {
- jQuery.uaMatch = function(ua) {
- ua = ua.toLowerCase();
-
- var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
- /(webkit)[ \/]([\w.]+)/.exec(ua) ||
- /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
- /(msie) ([\w.]+)/.exec(ua) ||
- ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
- [];
-
- return {
- browser: match[ 1 ] || "",
- version: match[ 2 ] || "0"
- };
- };
- jQuery.browser = {};
- jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
-}
-
-/**
- * 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() {
- $('<a class="headerlink">\u00B6</a>').
- attr('href', '#' + this.id).
- attr('title', _('Permalink to this headline')).
- appendTo(this);
- });
- $('dt[id]').each(function() {
- $('<a class="headerlink">\u00B6</a>').
- attr('href', '#' + this.id).
- attr('title', _('Permalink to this definition')).
- appendTo(this);
- });
- },
-
- /**
- * workaround a firefox stupidity
- * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
- */
- fixFirefoxAnchorBug : function() {
- if (document.location.hash)
- 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');
- if (!body.length) {
- body = $('body');
- }
- window.setTimeout(function() {
- $.each(terms, function() {
- body.highlightText(this.toLowerCase(), 'highlighted');
- });
- }, 10);
- $('<p class="highlight-link"><a href="javascript:Documentation.' +
- 'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
- .appendTo($('#searchbox'));
- }
- },
-
- /**
- * 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() {
- $('#searchbox .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/docs/_build/html/_static/down-pressed.png b/docs/_build/html/_static/down-pressed.png
deleted file mode 100644
index 7c30d00..0000000
Binary files a/docs/_build/html/_static/down-pressed.png and /dev/null differ
diff --git a/docs/_build/html/_static/down.png b/docs/_build/html/_static/down.png
deleted file mode 100644
index f48098a..0000000
Binary files a/docs/_build/html/_static/down.png and /dev/null differ
diff --git a/docs/_build/html/_static/file.png b/docs/_build/html/_static/file.png
deleted file mode 100644
index 254c60b..0000000
Binary files a/docs/_build/html/_static/file.png and /dev/null differ
diff --git a/docs/_build/html/_static/jquery.js b/docs/_build/html/_static/jquery.js
deleted file mode 100644
index 415ff51..0000000
--- a/docs/_build/html/_static/jquery.js
+++ /dev/null
@@ -1,10351 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.11.3
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2015-09-23T12:31Z
- */
-
-(function( global, factory ) {
-
- if ( typeof module === "object" && typeof module.exports === "object" ) {
- // For CommonJS and CommonJS-like environments where a proper window is present,
- // execute the factory and get jQuery
- // For environments that do not inherently posses a window with a document
- // (such as Node.js), expose a jQuery-making factory as module.exports
- // This accentuates the need for the creation of a real window
- // e.g. var jQuery = require("jquery")(window);
- // See ticket #14549 for more info
- module.exports = global.document ?
- factory( global, true ) :
- function( w ) {
- if ( !w.document ) {
- throw new Error( "jQuery requires a window with a document" );
- }
- return factory( w );
- };
- } else {
- factory( global );
- }
-
-// Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
-
-// Can't do this because several apps including ASP.NET trace
-// the stack via arguments.caller.callee and Firefox dies if
-// you try to trace through "use strict" call chains. (#13335)
-// Support: Firefox 18+
-//
-var deletedIds = [];
-
-var slice = deletedIds.slice;
-
-var concat = deletedIds.concat;
-
-var push = deletedIds.push;
-
-var indexOf = deletedIds.indexOf;
-
-var class2type = {};
-
-var toString = class2type.toString;
-
-var hasOwn = class2type.hasOwnProperty;
-
-var support = {};
-
-
-
-var
- version = "1.11.3",
-
- // Define a local copy of jQuery
- jQuery = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- // Need init if jQuery is called (just allow error to be thrown if not included)
- return new jQuery.fn.init( selector, context );
- },
-
- // Support: Android<4.1, IE<9
- // Make sure we trim BOM and NBSP
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
- // Matches dashed string for camelizing
- rmsPrefix = /^-ms-/,
- rdashAlpha = /-([\da-z])/gi,
-
- // Used by jQuery.camelCase as callback to replace()
- fcamelCase = function( all, letter ) {
- return letter.toUpperCase();
- };
-
-jQuery.fn = jQuery.prototype = {
- // The current version of jQuery being used
- jquery: version,
-
- constructor: jQuery,
-
- // Start with an empty selector
- selector: "",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- toArray: function() {
- return slice.call( this );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num != null ?
-
- // Return just the one element from the set
- ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
-
- // Return all the elements in a clean array
- slice.call( this );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems ) {
-
- // Build a new jQuery matched element set
- var ret = jQuery.merge( this.constructor(), elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
- ret.context = this.context;
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function( elem, i ) {
- return callback.call( elem, i, elem );
- }));
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ) );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- eq: function( i ) {
- var len = this.length,
- j = +i + ( i < 0 ? len : 0 );
- return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
- },
-
- end: function() {
- return this.prevObject || this.constructor(null);
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: deletedIds.sort,
- splice: deletedIds.splice
-};
-
-jQuery.extend = jQuery.fn.extend = function() {
- var src, copyIsArray, copy, name, options, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
-
- // skip the boolean and the target
- target = arguments[ i ] || {};
- i++;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
- target = {};
- }
-
- // extend jQuery itself if only one argument is passed
- if ( i === length ) {
- target = this;
- i--;
- }
-
- for ( ; i < length; i++ ) {
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null ) {
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
- if ( copyIsArray ) {
- copyIsArray = false;
- clone = src && jQuery.isArray(src) ? src : [];
-
- } else {
- clone = src && jQuery.isPlainObject(src) ? src : {};
- }
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
-};
-
-jQuery.extend({
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
-
- // Assume jQuery is ready without the ready module
- isReady: true,
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- noop: function() {},
-
- // See test/unit/core.js for details concerning isFunction.
- // Since version 1.3, DOM methods and functions like alert
- // aren't supported. They return false on IE (#2968).
- isFunction: function( obj ) {
- return jQuery.type(obj) === "function";
- },
-
- isArray: Array.isArray || function( obj ) {
- return jQuery.type(obj) === "array";
- },
-
- isWindow: function( obj ) {
- /* jshint eqeqeq: false */
- return obj != null && obj == obj.window;
- },
-
- isNumeric: function( obj ) {
- // parseFloat NaNs numeric-cast false positives (null|true|false|"")
- // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
- // subtraction forces infinities to NaN
- // adding 1 corrects loss of precision from parseFloat (#15100)
- return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
- },
-
- isEmptyObject: function( obj ) {
- var name;
- for ( name in obj ) {
- return false;
- }
- return true;
- },
-
- isPlainObject: function( obj ) {
- var key;
-
- // Must be an Object.
- // Because of IE, we also have to check the presence of the constructor property.
- // Make sure that DOM nodes and window objects don't pass through, as well
- if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- try {
- // Not own constructor property must be Object
- if ( obj.constructor &&
- !hasOwn.call(obj, "constructor") &&
- !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
- return false;
- }
- } catch ( e ) {
- // IE8,9 Will throw exceptions on certain host objects #9897
- return false;
- }
-
- // Support: IE<9
- // Handle iteration over inherited properties before own properties.
- if ( support.ownLast ) {
- for ( key in obj ) {
- return hasOwn.call( obj, key );
- }
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
- for ( key in obj ) {}
-
- return key === undefined || hasOwn.call( obj, key );
- },
-
- type: function( obj ) {
- if ( obj == null ) {
- return obj + "";
- }
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ toString.call(obj) ] || "object" :
- typeof obj;
- },
-
- // Evaluates a script in a global context
- // Workarounds based on findings by Jim Driscoll
- // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
- globalEval: function( data ) {
- if ( data && jQuery.trim( data ) ) {
- // We use execScript on Internet Explorer
- // We use an anonymous function so that context is window
- // rather than jQuery in Firefox
- ( window.execScript || function( data ) {
- window[ "eval" ].call( window, data );
- } )( data );
- }
- },
-
- // Convert dashed to camelCase; used by the css and data modules
- // Microsoft forgot to hump their vendor prefix (#9572)
- camelCase: function( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
-
- // args is for internal usage only
- each: function( obj, callback, args ) {
- var value,
- i = 0,
- length = obj.length,
- isArray = isArraylike( obj );
-
- if ( args ) {
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback.apply( obj[ i ], args );
-
- if ( value === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- value = callback.apply( obj[ i ], args );
-
- if ( value === false ) {
- break;
- }
- }
- }
-
- // A special, fast, case for the most common use of each
- } else {
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback.call( obj[ i ], i, obj[ i ] );
-
- if ( value === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- value = callback.call( obj[ i ], i, obj[ i ] );
-
- if ( value === false ) {
- break;
- }
- }
- }
- }
-
- return obj;
- },
-
- // Support: Android<4.1, IE<9
- trim: function( text ) {
- return text == null ?
- "" :
- ( text + "" ).replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( arr, results ) {
- var ret = results || [];
-
- if ( arr != null ) {
- if ( isArraylike( Object(arr) ) ) {
- jQuery.merge( ret,
- typeof arr === "string" ?
- [ arr ] : arr
- );
- } else {
- push.call( ret, arr );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, arr, i ) {
- var len;
-
- if ( arr ) {
- if ( indexOf ) {
- return indexOf.call( arr, elem, i );
- }
-
- len = arr.length;
- i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
- for ( ; i < len; i++ ) {
- // Skip accessing in sparse arrays
- if ( i in arr && arr[ i ] === elem ) {
- return i;
- }
- }
- }
-
- return -1;
- },
-
- merge: function( first, second ) {
- var len = +second.length,
- j = 0,
- i = first.length;
-
- while ( j < len ) {
- first[ i++ ] = second[ j++ ];
- }
-
- // Support: IE<9
- // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
- if ( len !== len ) {
- while ( second[j] !== undefined ) {
- first[ i++ ] = second[ j++ ];
- }
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, invert ) {
- var callbackInverse,
- matches = [],
- i = 0,
- length = elems.length,
- callbackExpect = !invert;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( ; i < length; i++ ) {
- callbackInverse = !callback( elems[ i ], i );
- if ( callbackInverse !== callbackExpect ) {
- matches.push( elems[ i ] );
- }
- }
-
- return matches;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var value,
- i = 0,
- length = elems.length,
- isArray = isArraylike( elems ),
- ret = [];
-
- // Go through the array, translating each of the items to their new values
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( i in elems ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
- }
-
- // Flatten any nested arrays
- return concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- // Bind a function to a context, optionally partially applying any
- // arguments.
- proxy: function( fn, context ) {
- var args, proxy, tmp;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !jQuery.isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- },
-
- now: function() {
- return +( new Date() );
- },
-
- // jQuery.support is not used in Core but other projects attach their
- // properties to it so it needs to exist.
- support: support
-});
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-function isArraylike( obj ) {
-
- // Support: iOS 8.2 (not reproducible in simulator)
- // `in` check used to prevent JIT error (gh-2145)
- // hasOwn isn't used here due to false negatives
- // regarding Nodelist length in IE
- var length = "length" in obj && obj.length,
- type = jQuery.type( obj );
-
- if ( type === "function" || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- if ( obj.nodeType === 1 && length ) {
- return true;
- }
-
- return type === "array" || length === 0 ||
- typeof length === "number" && length > 0 && ( length - 1 ) in obj;
-}
-var Sizzle =
-/*!
- * Sizzle CSS Selector Engine v2.2.0-pre
- * http://sizzlejs.com/
- *
- * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2014-12-16
- */
-(function( window ) {
-
-var i,
- support,
- Expr,
- getText,
- isXML,
- tokenize,
- compile,
- select,
- outermostContext,
- sortInput,
- hasDuplicate,
-
- // Local document vars
- setDocument,
- document,
- docElem,
- documentIsHTML,
- rbuggyQSA,
- rbuggyMatches,
- matches,
- contains,
-
- // Instance-specific data
- expando = "sizzle" + 1 * new Date(),
- preferredDoc = window.document,
- dirruns = 0,
- done = 0,
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
- sortOrder = function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- }
- return 0;
- },
-
- // General-purpose constants
- MAX_NEGATIVE = 1 << 31,
-
- // Instance methods
- hasOwn = ({}).hasOwnProperty,
- arr = [],
- pop = arr.pop,
- push_native = arr.push,
- push = arr.push,
- slice = arr.slice,
- // Use a stripped-down indexOf as it's faster than native
- // http://jsperf.com/thor-indexof-vs-for/5
- indexOf = function( list, elem ) {
- var i = 0,
- len = list.length;
- for ( ; i < len; i++ ) {
- if ( list[i] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
-
- // Regular expressions
-
- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
- // http://www.w3.org/TR/css3-syntax/#characters
- characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
-
- // Loosely modeled on CSS identifier characters
- // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- identifier = characterEncoding.replace( "w", "w#" ),
-
- // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
- // Operator (capture 2)
- "*([*^$|!~]?=)" + whitespace +
- // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
- "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
- "*\\]",
-
- pseudos = ":(" + characterEncoding + ")(?:\\((" +
- // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
- // 1. quoted (capture 3; capture 4 or capture 5)
- "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
- // 2. simple (capture 6)
- "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
- // 3. anything else (capture 2)
- ".*" +
- ")\\)|)",
-
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
- rwhitespace = new RegExp( whitespace + "+", "g" ),
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
-
- rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
-
- rpseudo = new RegExp( pseudos ),
- ridentifier = new RegExp( "^" + identifier + "$" ),
-
- matchExpr = {
- "ID": new RegExp( "^#(" + characterEncoding + ")" ),
- "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
- "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
- // For use in libraries implementing .is()
- // We use this for POS matching in `select`
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
- whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
- },
-
- rinputs = /^(?:input|select|textarea|button)$/i,
- rheader = /^h\d$/i,
-
- rnative = /^[^{]+\{\s*\[native \w/,
-
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
- rsibling = /[+~]/,
- rescape = /'|\\/g,
-
- // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
- runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
- funescape = function( _, escaped, escapedWhitespace ) {
- var high = "0x" + escaped - 0x10000;
- // NaN means non-codepoint
- // Support: Firefox<24
- // Workaround erroneous numeric interpretation of +"0x"
- return high !== high || escapedWhitespace ?
- escaped :
- high < 0 ?
- // BMP codepoint
- String.fromCharCode( high + 0x10000 ) :
- // Supplemental Plane codepoint (surrogate pair)
- String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
- },
-
- // Used for iframes
- // See setDocument()
- // Removing the function wrapper causes a "Permission Denied"
- // error in IE
- unloadHandler = function() {
- setDocument();
- };
-
-// Optimize for push.apply( _, NodeList )
-try {
- push.apply(
- (arr = slice.call( preferredDoc.childNodes )),
- preferredDoc.childNodes
- );
- // Support: Android<4.0
- // Detect silently failing push.apply
- arr[ preferredDoc.childNodes.length ].nodeType;
-} catch ( e ) {
- push = { apply: arr.length ?
-
- // Leverage slice if possible
- function( target, els ) {
- push_native.apply( target, slice.call(els) );
- } :
-
- // Support: IE<9
- // Otherwise append directly
- function( target, els ) {
- var j = target.length,
- i = 0;
- // Can't trust NodeList.length
- while ( (target[j++] = els[i++]) ) {}
- target.length = j - 1;
- }
- };
-}
-
-function Sizzle( selector, context, results, seed ) {
- var match, elem, m, nodeType,
- // QSA vars
- i, groups, old, nid, newContext, newSelector;
-
- if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
- setDocument( context );
- }
-
- context = context || document;
- results = results || [];
- nodeType = context.nodeType;
-
- if ( typeof selector !== "string" || !selector ||
- nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
-
- return results;
- }
-
- if ( !seed && documentIsHTML ) {
-
- // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
- if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
- // Speed-up: Sizzle("#ID")
- if ( (m = match[1]) ) {
- if ( nodeType === 9 ) {
- elem = context.getElementById( m );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document (jQuery #6963)
- if ( elem && elem.parentNode ) {
- // Handle the case where IE, Opera, and Webkit return items
- // by name instead of ID
- if ( elem.id === m ) {
- results.push( elem );
- return results;
- }
- } else {
- return results;
- }
- } else {
- // Context is not a document
- if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
- contains( context, elem ) && elem.id === m ) {
- results.push( elem );
- return results;
- }
- }
-
- // Speed-up: Sizzle("TAG")
- } else if ( match[2] ) {
- push.apply( results, context.getElementsByTagName( selector ) );
- return results;
-
- // Speed-up: Sizzle(".CLASS")
- } else if ( (m = match[3]) && support.getElementsByClassName ) {
- push.apply( results, context.getElementsByClassName( m ) );
- return results;
- }
- }
-
- // QSA path
- if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
- nid = old = expando;
- newContext = context;
- newSelector = nodeType !== 1 && selector;
-
- // qSA works strangely on Element-rooted queries
- // We can work around this by specifying an extra ID on the root
- // and working up from there (Thanks to Andrew Dupont for the technique)
- // IE 8 doesn't work on object elements
- if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
- groups = tokenize( selector );
-
- if ( (old = context.getAttribute("id")) ) {
- nid = old.replace( rescape, "\\$&" );
- } else {
- context.setAttribute( "id", nid );
- }
- nid = "[id='" + nid + "'] ";
-
- i = groups.length;
- while ( i-- ) {
- groups[i] = nid + toSelector( groups[i] );
- }
- newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
- newSelector = groups.join(",");
- }
-
- if ( newSelector ) {
- try {
- push.apply( results,
- newContext.querySelectorAll( newSelector )
- );
- return results;
- } catch(qsaError) {
- } finally {
- if ( !old ) {
- context.removeAttribute("id");
- }
- }
- }
- }
- }
-
- // All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed );
-}
-
-/**
- * Create key-value caches of limited size
- * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
- * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- * deleting the oldest entry
- */
-function createCache() {
- var keys = [];
-
- function cache( key, value ) {
- // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
- if ( keys.push( key + " " ) > Expr.cacheLength ) {
- // Only keep the most recent entries
- delete cache[ keys.shift() ];
- }
- return (cache[ key + " " ] = value);
- }
- return cache;
-}
-
-/**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
-function markFunction( fn ) {
- fn[ expando ] = true;
- return fn;
-}
-
-/**
- * Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
- */
-function assert( fn ) {
- var div = document.createElement("div");
-
- try {
- return !!fn( div );
- } catch (e) {
- return false;
- } finally {
- // Remove from its parent by default
- if ( div.parentNode ) {
- div.parentNode.removeChild( div );
- }
- // release memory in IE
- div = null;
- }
-}
-
-/**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
-function addHandle( attrs, handler ) {
- var arr = attrs.split("|"),
- i = attrs.length;
-
- while ( i-- ) {
- Expr.attrHandle[ arr[i] ] = handler;
- }
-}
-
-/**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
-function siblingCheck( a, b ) {
- var cur = b && a,
- diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
- ( ~b.sourceIndex || MAX_NEGATIVE ) -
- ( ~a.sourceIndex || MAX_NEGATIVE );
-
- // Use IE sourceIndex if available on both nodes
- if ( diff ) {
- return diff;
- }
-
- // Check if b follows a
- if ( cur ) {
- while ( (cur = cur.nextSibling) ) {
- if ( cur === b ) {
- return -1;
- }
- }
- }
-
- return a ? 1 : -1;
-}
-
-/**
- * Returns a function to use in pseudos for input types
- * @param {String} type
- */
-function createInputPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === type;
- };
-}
-
-/**
- * Returns a function to use in pseudos for buttons
- * @param {String} type
- */
-function createButtonPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && elem.type === type;
- };
-}
-
-/**
- * Returns a function to use in pseudos for positionals
- * @param {Function} fn
- */
-function createPositionalPseudo( fn ) {
- return markFunction(function( argument ) {
- argument = +argument;
- return markFunction(function( seed, matches ) {
- var j,
- matchIndexes = fn( [], seed.length, argument ),
- i = matchIndexes.length;
-
- // Match elements found at the specified indexes
- while ( i-- ) {
- if ( seed[ (j = matchIndexes[i]) ] ) {
- seed[j] = !(matches[j] = seed[j]);
- }
- }
- });
- });
-}
-
-/**
- * Checks a node for validity as a Sizzle context
- * @param {Element|Object=} context
- * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
- */
-function testContext( context ) {
- return context && typeof context.getElementsByTagName !== "undefined" && context;
-}
-
-// Expose support vars for convenience
-support = Sizzle.support = {};
-
-/**
- * Detects XML nodes
- * @param {Element|Object} elem An element or a document
- * @returns {Boolean} True iff elem is a non-HTML XML node
- */
-isXML = Sizzle.isXML = function( elem ) {
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
- return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-/**
- * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
- * @returns {Object} Returns the current document
- */
-setDocument = Sizzle.setDocument = function( node ) {
- var hasCompare, parent,
- doc = node ? node.ownerDocument || node : preferredDoc;
-
- // If no document and documentElement is available, return
- if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
- return document;
- }
-
- // Set our document
- document = doc;
- docElem = doc.documentElement;
- parent = doc.defaultView;
-
- // Support: IE>8
- // If iframe document is assigned to "document" variable and if iframe has been reloaded,
- // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
- // IE6-8 do not support the defaultView property so parent will be undefined
- if ( parent && parent !== parent.top ) {
- // IE11 does not have attachEvent, so all must suffer
- if ( parent.addEventListener ) {
- parent.addEventListener( "unload", unloadHandler, false );
- } else if ( parent.attachEvent ) {
- parent.attachEvent( "onunload", unloadHandler );
- }
- }
-
- /* Support tests
- ---------------------------------------------------------------------- */
- documentIsHTML = !isXML( doc );
-
- /* Attributes
- ---------------------------------------------------------------------- */
-
- // Support: IE<8
- // Verify that getAttribute really returns attributes and not properties
- // (excepting IE8 booleans)
- support.attributes = assert(function( div ) {
- div.className = "i";
- return !div.getAttribute("className");
- });
-
- /* getElement(s)By*
- ---------------------------------------------------------------------- */
-
- // Check if getElementsByTagName("*") returns only elements
- support.getElementsByTagName = assert(function( div ) {
- div.appendChild( doc.createComment("") );
- return !div.getElementsByTagName("*").length;
- });
-
- // Support: IE<9
- support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
-
- // Support: IE<10
- // Check if getElementById returns elements by name
- // The broken getElementById methods don't pick up programatically-set names,
- // so use a roundabout getElementsByName test
- support.getById = assert(function( div ) {
- docElem.appendChild( div ).id = expando;
- return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
- });
-
- // ID find and filter
- if ( support.getById ) {
- Expr.find["ID"] = function( id, context ) {
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
- var m = context.getElementById( id );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- return m && m.parentNode ? [ m ] : [];
- }
- };
- Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- return elem.getAttribute("id") === attrId;
- };
- };
- } else {
- // Support: IE6/7
- // getElementById is not reliable as a find shortcut
- delete Expr.find["ID"];
-
- Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
- return node && node.value === attrId;
- };
- };
- }
-
- // Tag
- Expr.find["TAG"] = support.getElementsByTagName ?
- function( tag, context ) {
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- return context.getElementsByTagName( tag );
-
- // DocumentFragment nodes don't have gEBTN
- } else if ( support.qsa ) {
- return context.querySelectorAll( tag );
- }
- } :
-
- function( tag, context ) {
- var elem,
- tmp = [],
- i = 0,
- // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
- results = context.getElementsByTagName( tag );
-
- // Filter out possible comments
- if ( tag === "*" ) {
- while ( (elem = results[i++]) ) {
- if ( elem.nodeType === 1 ) {
- tmp.push( elem );
- }
- }
-
- return tmp;
- }
- return results;
- };
-
- // Class
- Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
- if ( documentIsHTML ) {
- return context.getElementsByClassName( className );
- }
- };
-
- /* QSA/matchesSelector
- ---------------------------------------------------------------------- */
-
- // QSA and matchesSelector support
-
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
- rbuggyMatches = [];
-
- // qSa(:focus) reports false when true (Chrome 21)
- // We allow this because of a bug in IE8/9 that throws an error
- // whenever `document.activeElement` is accessed on an iframe
- // So, we allow :focus to pass through QSA all the time to avoid the IE error
- // See http://bugs.jquery.com/ticket/13378
- rbuggyQSA = [];
-
- if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
- // Build QSA regex
- // Regex strategy adopted from Diego Perini
- assert(function( div ) {
- // Select is set to empty string on purpose
- // This is to test IE's treatment of not explicitly
- // setting a boolean content attribute,
- // since its presence should be enough
- // http://bugs.jquery.com/ticket/12359
- docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
- "<select id='" + expando + "-\f]' msallowcapture=''>" +
- "<option selected=''></option></select>";
-
- // Support: IE8, Opera 11-12.16
- // Nothing should be selected when empty strings follow ^= or $= or *=
- // The test attribute must be unknown in Opera but "safe" for WinRT
- // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
- if ( div.querySelectorAll("[msallowcapture^='']").length ) {
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
- }
-
- // Support: IE8
- // Boolean attributes and "value" are not treated correctly
- if ( !div.querySelectorAll("[selected]").length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
- }
-
- // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
- if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
- rbuggyQSA.push("~=");
- }
-
- // Webkit/Opera - :checked should return selected option elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- // IE8 throws error here and will not see later tests
- if ( !div.querySelectorAll(":checked").length ) {
- rbuggyQSA.push(":checked");
- }
-
- // Support: Safari 8+, iOS 8+
- // https://bugs.webkit.org/show_bug.cgi?id=136851
- // In-page `selector#id sibing-combinator selector` fails
- if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
- rbuggyQSA.push(".#.+[+~]");
- }
- });
-
- assert(function( div ) {
- // Support: Windows 8 Native Apps
- // The type and name attributes are restricted during .innerHTML assignment
- var input = doc.createElement("input");
- input.setAttribute( "type", "hidden" );
- div.appendChild( input ).setAttribute( "name", "D" );
-
- // Support: IE8
- // Enforce case-sensitivity of name attribute
- if ( div.querySelectorAll("[name=d]").length ) {
- rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
- }
-
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
- // IE8 throws error here and will not see later tests
- if ( !div.querySelectorAll(":enabled").length ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
-
- // Opera 10-11 does not throw on post-comma invalid pseudos
- div.querySelectorAll("*,:x");
- rbuggyQSA.push(",.*:");
- });
- }
-
- if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
- docElem.webkitMatchesSelector ||
- docElem.mozMatchesSelector ||
- docElem.oMatchesSelector ||
- docElem.msMatchesSelector) )) ) {
-
- assert(function( div ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9)
- support.disconnectedMatch = matches.call( div, "div" );
-
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call( div, "[s!='']:x" );
- rbuggyMatches.push( "!=", pseudos );
- });
- }
-
- rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
- rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
-
- /* Contains
- ---------------------------------------------------------------------- */
- hasCompare = rnative.test( docElem.compareDocumentPosition );
-
- // Element contains another
- // Purposefully does not implement inclusive descendent
- // As in, an element does not contain itself
- contains = hasCompare || rnative.test( docElem.contains ) ?
- function( a, b ) {
- var adown = a.nodeType === 9 ? a.documentElement : a,
- bup = b && b.parentNode;
- return a === bup || !!( bup && bup.nodeType === 1 && (
- adown.contains ?
- adown.contains( bup ) :
- a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
- ));
- } :
- function( a, b ) {
- if ( b ) {
- while ( (b = b.parentNode) ) {
- if ( b === a ) {
- return true;
- }
- }
- }
- return false;
- };
-
- /* Sorting
- ---------------------------------------------------------------------- */
-
- // Document order sorting
- sortOrder = hasCompare ?
- function( a, b ) {
-
- // Flag for duplicate removal
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- // Sort on method existence if only one input has compareDocumentPosition
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- if ( compare ) {
- return compare;
- }
-
- // Calculate position if both inputs belong to the same document
- compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
- a.compareDocumentPosition( b ) :
-
- // Otherwise we know they are disconnected
- 1;
-
- // Disconnected nodes
- if ( compare & 1 ||
- (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
-
- // Choose the first element that is related to our preferred document
- if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
- return -1;
- }
- if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
- return 1;
- }
-
- // Maintain original order
- return sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
- }
-
- return compare & 4 ? -1 : 1;
- } :
- function( a, b ) {
- // Exit early if the nodes are identical
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- var cur,
- i = 0,
- aup = a.parentNode,
- bup = b.parentNode,
- ap = [ a ],
- bp = [ b ];
-
- // Parentless nodes are either documents or disconnected
- if ( !aup || !bup ) {
- return a === doc ? -1 :
- b === doc ? 1 :
- aup ? -1 :
- bup ? 1 :
- sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
-
- // If the nodes are siblings, we can do a quick check
- } else if ( aup === bup ) {
- return siblingCheck( a, b );
- }
-
- // Otherwise we need full lists of their ancestors for comparison
- cur = a;
- while ( (cur = cur.parentNode) ) {
- ap.unshift( cur );
- }
- cur = b;
- while ( (cur = cur.parentNode) ) {
- bp.unshift( cur );
- }
-
- // Walk down the tree looking for a discrepancy
- while ( ap[i] === bp[i] ) {
- i++;
- }
-
- return i ?
- // Do a sibling check if the nodes have a common ancestor
- siblingCheck( ap[i], bp[i] ) :
-
- // Otherwise nodes in our document sort first
- ap[i] === preferredDoc ? -1 :
- bp[i] === preferredDoc ? 1 :
- 0;
- };
-
- return doc;
-};
-
-Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
- // Set document vars if needed
- if ( ( elem.ownerDocument || elem ) !== document ) {
- setDocument( elem );
- }
-
- // Make sure that attribute selectors are quoted
- expr = expr.replace( rattributeQuotes, "='$1']" );
-
- if ( support.matchesSelector && documentIsHTML &&
- ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
- ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
-
- try {
- var ret = matches.call( elem, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || support.disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11 ) {
- return ret;
- }
- } catch (e) {}
- }
-
- return Sizzle( expr, document, null, [ elem ] ).length > 0;
-};
-
-Sizzle.contains = function( context, elem ) {
- // Set document vars if needed
- if ( ( context.ownerDocument || context ) !== document ) {
- setDocument( context );
- }
- return contains( context, elem );
-};
-
-Sizzle.attr = function( elem, name ) {
- // Set document vars if needed
- if ( ( elem.ownerDocument || elem ) !== document ) {
- setDocument( elem );
- }
-
- var fn = Expr.attrHandle[ name.toLowerCase() ],
- // Don't get fooled by Object.prototype properties (jQuery #13807)
- val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
- fn( elem, name, !documentIsHTML ) :
- undefined;
-
- return val !== undefined ?
- val :
- support.attributes || !documentIsHTML ?
- elem.getAttribute( name ) :
- (val = elem.getAttributeNode(name)) && val.specified ?
- val.value :
- null;
-};
-
-Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-/**
- * Document sorting and removing duplicates
- * @param {ArrayLike} results
- */
-Sizzle.uniqueSort = function( results ) {
- var elem,
- duplicates = [],
- j = 0,
- i = 0;
-
- // Unless we *know* we can detect duplicates, assume their presence
- hasDuplicate = !support.detectDuplicates;
- sortInput = !support.sortStable && results.slice( 0 );
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- while ( (elem = results[i++]) ) {
- if ( elem === results[ i ] ) {
- j = duplicates.push( i );
- }
- }
- while ( j-- ) {
- results.splice( duplicates[ j ], 1 );
- }
- }
-
- // Clear input after sorting to release objects
- // See https://github.com/jquery/sizzle/pull/225
- sortInput = null;
-
- return results;
-};
-
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
- var node,
- ret = "",
- i = 0,
- nodeType = elem.nodeType;
-
- if ( !nodeType ) {
- // If no nodeType, this is expected to be an array
- while ( (node = elem[i++]) ) {
- // Do not traverse comment nodes
- ret += getText( node );
- }
- } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
- // Use textContent for elements
- // innerText usage removed for consistency of new lines (jQuery #11153)
- if ( typeof elem.textContent === "string" ) {
- return elem.textContent;
- } else {
- // Traverse its children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
- // Do not include comment or processing instruction nodes
-
- return ret;
-};
-
-Expr = Sizzle.selectors = {
-
- // Can be adjusted by the user
- cacheLength: 50,
-
- createPseudo: markFunction,
-
- match: matchExpr,
-
- attrHandle: {},
-
- find: {},
-
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
-
- preFilter: {
- "ATTR": function( match ) {
- match[1] = match[1].replace( runescape, funescape );
-
- // Move the given value to match[3] whether quoted or unquoted
- match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
-
- if ( match[2] === "~=" ) {
- match[3] = " " + match[3] + " ";
- }
-
- return match.slice( 0, 4 );
- },
-
- "CHILD": function( match ) {
- /* matches from matchExpr["CHILD"]
- 1 type (only|nth|...)
- 2 what (child|of-type)
- 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
- 4 xn-component of xn+y argument ([+-]?\d*n|)
- 5 sign of xn-component
- 6 x of xn-component
- 7 sign of y-component
- 8 y of y-component
- */
- match[1] = match[1].toLowerCase();
-
- if ( match[1].slice( 0, 3 ) === "nth" ) {
- // nth-* requires argument
- if ( !match[3] ) {
- Sizzle.error( match[0] );
- }
-
- // numeric x and y parameters for Expr.filter.CHILD
- // remember that false/true cast respectively to 0/1
- match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
- match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
-
- // other types prohibit arguments
- } else if ( match[3] ) {
- Sizzle.error( match[0] );
- }
-
- return match;
- },
-
- "PSEUDO": function( match ) {
- var excess,
- unquoted = !match[6] && match[2];
-
- if ( matchExpr["CHILD"].test( match[0] ) ) {
- return null;
- }
-
- // Accept quoted arguments as-is
- if ( match[3] ) {
- match[2] = match[4] || match[5] || "";
-
- // Strip excess characters from unquoted arguments
- } else if ( unquoted && rpseudo.test( unquoted ) &&
- // Get excess from tokenize (recursively)
- (excess = tokenize( unquoted, true )) &&
- // advance to the next closing parenthesis
- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
- // excess is a negative index
- match[0] = match[0].slice( 0, excess );
- match[2] = unquoted.slice( 0, excess );
- }
-
- // Return only captures needed by the pseudo filter method (type and argument)
- return match.slice( 0, 3 );
- }
- },
-
- filter: {
-
- "TAG": function( nodeNameSelector ) {
- var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
- return nodeNameSelector === "*" ?
- function() { return true; } :
- function( elem ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
-
- "CLASS": function( className ) {
- var pattern = classCache[ className + " " ];
-
- return pattern ||
- (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
- classCache( className, function( elem ) {
- return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
- });
- },
-
- "ATTR": function( name, operator, check ) {
- return function( elem ) {
- var result = Sizzle.attr( elem, name );
-
- if ( result == null ) {
- return operator === "!=";
- }
- if ( !operator ) {
- return true;
- }
-
- result += "";
-
- return operator === "=" ? result === check :
- operator === "!=" ? result !== check :
- operator === "^=" ? check && result.indexOf( check ) === 0 :
- operator === "*=" ? check && result.indexOf( check ) > -1 :
- operator === "$=" ? check && result.slice( -check.length ) === check :
- operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
- operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
- false;
- };
- },
-
- "CHILD": function( type, what, argument, first, last ) {
- var simple = type.slice( 0, 3 ) !== "nth",
- forward = type.slice( -4 ) !== "last",
- ofType = what === "of-type";
-
- return first === 1 && last === 0 ?
-
- // Shortcut for :nth-*(n)
- function( elem ) {
- return !!elem.parentNode;
- } :
-
- function( elem, context, xml ) {
- var cache, outerCache, node, diff, nodeIndex, start,
- dir = simple !== forward ? "nextSibling" : "previousSibling",
- parent = elem.parentNode,
- name = ofType && elem.nodeName.toLowerCase(),
- useCache = !xml && !ofType;
-
- if ( parent ) {
-
- // :(first|last|only)-(child|of-type)
- if ( simple ) {
- while ( dir ) {
- node = elem;
- while ( (node = node[ dir ]) ) {
- if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
- return false;
- }
- }
- // Reverse direction for :only-* (if we haven't yet done so)
- start = dir = type === "only" && !start && "nextSibling";
- }
- return true;
- }
-
- start = [ forward ? parent.firstChild : parent.lastChild ];
-
- // non-xml :nth-child(...) stores cache data on `parent`
- if ( forward && useCache ) {
- // Seek `elem` from a previously-cached index
- outerCache = parent[ expando ] || (parent[ expando ] = {});
- cache = outerCache[ type ] || [];
- nodeIndex = cache[0] === dirruns && cache[1];
- diff = cache[0] === dirruns && cache[2];
- node = nodeIndex && parent.childNodes[ nodeIndex ];
-
- while ( (node = ++nodeIndex && node && node[ dir ] ||
-
- // Fallback to seeking `elem` from the start
- (diff = nodeIndex = 0) || start.pop()) ) {
-
- // When found, cache indexes on `parent` and break
- if ( node.nodeType === 1 && ++diff && node === elem ) {
- outerCache[ type ] = [ dirruns, nodeIndex, diff ];
- break;
- }
- }
-
- // Use previously-cached element index if available
- } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
- diff = cache[1];
-
- // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
- } else {
- // Use the same loop as above to seek `elem` from the start
- while ( (node = ++nodeIndex && node && node[ dir ] ||
- (diff = nodeIndex = 0) || start.pop()) ) {
-
- if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
- // Cache the index of each encountered element
- if ( useCache ) {
- (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
- }
-
- if ( node === elem ) {
- break;
- }
- }
- }
- }
-
- // Incorporate the offset, then check against cycle size
- diff -= last;
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
- }
- };
- },
-
- "PSEUDO": function( pseudo, argument ) {
- // pseudo-class names are case-insensitive
- // http://www.w3.org/TR/selectors/#pseudo-classes
- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
- // Remember that setFilters inherits from pseudos
- var args,
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
- Sizzle.error( "unsupported pseudo: " + pseudo );
-
- // The user may use createPseudo to indicate that
- // arguments are needed to create the filter function
- // just as Sizzle does
- if ( fn[ expando ] ) {
- return fn( argument );
- }
-
- // But maintain support for old signatures
- if ( fn.length > 1 ) {
- args = [ pseudo, pseudo, "", argument ];
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
- markFunction(function( seed, matches ) {
- var idx,
- matched = fn( seed, argument ),
- i = matched.length;
- while ( i-- ) {
- idx = indexOf( seed, matched[i] );
- seed[ idx ] = !( matches[ idx ] = matched[i] );
- }
- }) :
- function( elem ) {
- return fn( elem, 0, args );
- };
- }
-
- return fn;
- }
- },
-
- pseudos: {
- // Potentially complex pseudos
- "not": markFunction(function( selector ) {
- // Trim the selector passed to compile
- // to avoid treating leading and trailing
- // spaces as combinators
- var input = [],
- results = [],
- matcher = compile( selector.replace( rtrim, "$1" ) );
-
- return matcher[ expando ] ?
- markFunction(function( seed, matches, context, xml ) {
- var elem,
- unmatched = matcher( seed, null, xml, [] ),
- i = seed.length;
-
- // Match elements unmatched by `matcher`
- while ( i-- ) {
- if ( (elem = unmatched[i]) ) {
- seed[i] = !(matches[i] = elem);
- }
- }
- }) :
- function( elem, context, xml ) {
- input[0] = elem;
- matcher( input, null, xml, results );
- // Don't keep the element (issue #299)
- input[0] = null;
- return !results.pop();
- };
- }),
-
- "has": markFunction(function( selector ) {
- return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
- };
- }),
-
- "contains": markFunction(function( text ) {
- text = text.replace( runescape, funescape );
- return function( elem ) {
- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
- };
- }),
-
- // "Whether an element is represented by a :lang() selector
- // is based solely on the element's language value
- // being equal to the identifier C,
- // or beginning with the identifier C immediately followed by "-".
- // The matching of C against the element's language value is performed case-insensitively.
- // The identifier C does not have to be a valid language name."
- // http://www.w3.org/TR/selectors/#lang-pseudo
- "lang": markFunction( function( lang ) {
- // lang value must be a valid identifier
- if ( !ridentifier.test(lang || "") ) {
- Sizzle.error( "unsupported lang: " + lang );
- }
- lang = lang.replace( runescape, funescape ).toLowerCase();
- return function( elem ) {
- var elemLang;
- do {
- if ( (elemLang = documentIsHTML ?
- elem.lang :
- elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
-
- elemLang = elemLang.toLowerCase();
- return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
- }
- } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
- return false;
- };
- }),
-
- // Miscellaneous
- "target": function( elem ) {
- var hash = window.location && window.location.hash;
- return hash && hash.slice( 1 ) === elem.id;
- },
-
- "root": function( elem ) {
- return elem === docElem;
- },
-
- "focus": function( elem ) {
- return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
- },
-
- // Boolean properties
- "enabled": function( elem ) {
- return elem.disabled === false;
- },
-
- "disabled": function( elem ) {
- return elem.disabled === true;
- },
-
- "checked": function( elem ) {
- // In CSS3, :checked should return both checked and selected elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- var nodeName = elem.nodeName.toLowerCase();
- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
- },
-
- "selected": function( elem ) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if ( elem.parentNode ) {
- elem.parentNode.selectedIndex;
- }
-
- return elem.selected === true;
- },
-
- // Contents
- "empty": function( elem ) {
- // http://www.w3.org/TR/selectors/#empty-pseudo
- // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
- // but not by others (comment: 8; processing instruction: 7; etc.)
- // nodeType < 6 works because attributes (2) do not appear as children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- if ( elem.nodeType < 6 ) {
- return false;
- }
- }
- return true;
- },
-
- "parent": function( elem ) {
- return !Expr.pseudos["empty"]( elem );
- },
-
- // Element/input types
- "header": function( elem ) {
- return rheader.test( elem.nodeName );
- },
-
- "input": function( elem ) {
- return rinputs.test( elem.nodeName );
- },
-
- "button": function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === "button" || name === "button";
- },
-
- "text": function( elem ) {
- var attr;
- return elem.nodeName.toLowerCase() === "input" &&
- elem.type === "text" &&
-
- // Support: IE<8
- // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
- },
-
- // Position-in-collection
- "first": createPositionalPseudo(function() {
- return [ 0 ];
- }),
-
- "last": createPositionalPseudo(function( matchIndexes, length ) {
- return [ length - 1 ];
- }),
-
- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ argument < 0 ? argument + length : argument ];
- }),
-
- "even": createPositionalPseudo(function( matchIndexes, length ) {
- var i = 0;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "odd": createPositionalPseudo(function( matchIndexes, length ) {
- var i = 1;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ? argument + length : argument;
- for ( ; --i >= 0; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ? argument + length : argument;
- for ( ; ++i < length; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- })
- }
-};
-
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
-// Add button/input type pseudos
-for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
- Expr.pseudos[ i ] = createInputPseudo( i );
-}
-for ( i in { submit: true, reset: true } ) {
- Expr.pseudos[ i ] = createButtonPseudo( i );
-}
-
-// Easy API for creating new setFilters
-function setFilters() {}
-setFilters.prototype = Expr.filters = Expr.pseudos;
-Expr.setFilters = new setFilters();
-
-tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
- var matched, match, tokens, type,
- soFar, groups, preFilters,
- cached = tokenCache[ selector + " " ];
-
- if ( cached ) {
- return parseOnly ? 0 : cached.slice( 0 );
- }
-
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
-
- while ( soFar ) {
-
- // Comma and first run
- if ( !matched || (match = rcomma.exec( soFar )) ) {
- if ( match ) {
- // Don't consume trailing commas as valid
- soFar = soFar.slice( match[0].length ) || soFar;
- }
- groups.push( (tokens = []) );
- }
-
- matched = false;
-
- // Combinators
- if ( (match = rcombinators.exec( soFar )) ) {
- matched = match.shift();
- tokens.push({
- value: matched,
- // Cast descendant combinators to space
- type: match[0].replace( rtrim, " " )
- });
- soFar = soFar.slice( matched.length );
- }
-
- // Filters
- for ( type in Expr.filter ) {
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
- (match = preFilters[ type ]( match ))) ) {
- matched = match.shift();
- tokens.push({
- value: matched,
- type: type,
- matches: match
- });
- soFar = soFar.slice( matched.length );
- }
- }
-
- if ( !matched ) {
- break;
- }
- }
-
- // Return the length of the invalid excess
- // if we're just parsing
- // Otherwise, throw an error or return tokens
- return parseOnly ?
- soFar.length :
- soFar ?
- Sizzle.error( selector ) :
- // Cache the tokens
- tokenCache( selector, groups ).slice( 0 );
-};
-
-function toSelector( tokens ) {
- var i = 0,
- len = tokens.length,
- selector = "";
- for ( ; i < len; i++ ) {
- selector += tokens[i].value;
- }
- return selector;
-}
-
-function addCombinator( matcher, combinator, base ) {
- var dir = combinator.dir,
- checkNonElements = base && dir === "parentNode",
- doneName = done++;
-
- return combinator.first ?
- // Check against closest ancestor/preceding element
- function( elem, context, xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- return matcher( elem, context, xml );
- }
- }
- } :
-
- // Check against all ancestor/preceding elements
- function( elem, context, xml ) {
- var oldCache, outerCache,
- newCache = [ dirruns, doneName ];
-
- // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
- if ( xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- if ( matcher( elem, context, xml ) ) {
- return true;
- }
- }
- }
- } else {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- outerCache = elem[ expando ] || (elem[ expando ] = {});
- if ( (oldCache = outerCache[ dir ]) &&
- oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
-
- // Assign to newCache so results back-propagate to previous elements
- return (newCache[ 2 ] = oldCache[ 2 ]);
- } else {
- // Reuse newcache so results back-propagate to previous elements
- outerCache[ dir ] = newCache;
-
- // A match means we're done; a fail means we have to keep checking
- if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
- return true;
- }
- }
- }
- }
- }
- };
-}
-
-function elementMatcher( matchers ) {
- return matchers.length > 1 ?
- function( elem, context, xml ) {
- var i = matchers.length;
- while ( i-- ) {
- if ( !matchers[i]( elem, context, xml ) ) {
- return false;
- }
- }
- return true;
- } :
- matchers[0];
-}
-
-function multipleContexts( selector, contexts, results ) {
- var i = 0,
- len = contexts.length;
- for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[i], results );
- }
- return results;
-}
-
-function condense( unmatched, map, filter, context, xml ) {
- var elem,
- newUnmatched = [],
- i = 0,
- len = unmatched.length,
- mapped = map != null;
-
- for ( ; i < len; i++ ) {
- if ( (elem = unmatched[i]) ) {
- if ( !filter || filter( elem, context, xml ) ) {
- newUnmatched.push( elem );
- if ( mapped ) {
- map.push( i );
- }
- }
- }
- }
-
- return newUnmatched;
-}
-
-function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
- if ( postFilter && !postFilter[ expando ] ) {
- postFilter = setMatcher( postFilter );
- }
- if ( postFinder && !postFinder[ expando ] ) {
- postFinder = setMatcher( postFinder, postSelector );
- }
- return markFunction(function( seed, results, context, xml ) {
- var temp, i, elem,
- preMap = [],
- postMap = [],
- preexisting = results.length,
-
- // Get initial elements from seed or context
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
-
- // Prefilter to get matcher input, preserving a map for seed-results synchronization
- matcherIn = preFilter && ( seed || !selector ) ?
- condense( elems, preMap, preFilter, context, xml ) :
- elems,
-
- matcherOut = matcher ?
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
- // ...intermediate processing is necessary
- [] :
-
- // ...otherwise use results directly
- results :
- matcherIn;
-
- // Find primary matches
- if ( matcher ) {
- matcher( matcherIn, matcherOut, context, xml );
- }
-
- // Apply postFilter
- if ( postFilter ) {
- temp = condense( matcherOut, postMap );
- postFilter( temp, [], context, xml );
-
- // Un-match failing elements by moving them back to matcherIn
- i = temp.length;
- while ( i-- ) {
- if ( (elem = temp[i]) ) {
- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
- }
- }
- }
-
- if ( seed ) {
- if ( postFinder || preFilter ) {
- if ( postFinder ) {
- // Get the final matcherOut by condensing this intermediate into postFinder contexts
- temp = [];
- i = matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) ) {
- // Restore matcherIn since elem is not yet a final match
- temp.push( (matcherIn[i] = elem) );
- }
- }
- postFinder( null, (matcherOut = []), temp, xml );
- }
-
- // Move matched elements from seed to results to keep them synchronized
- i = matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) &&
- (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
-
- seed[temp] = !(results[temp] = elem);
- }
- }
- }
-
- // Add elements to results, through postFinder if defined
- } else {
- matcherOut = condense(
- matcherOut === results ?
- matcherOut.splice( preexisting, matcherOut.length ) :
- matcherOut
- );
- if ( postFinder ) {
- postFinder( null, results, matcherOut, xml );
- } else {
- push.apply( results, matcherOut );
- }
- }
- });
-}
-
-function matcherFromTokens( tokens ) {
- var checkContext, matcher, j,
- len = tokens.length,
- leadingRelative = Expr.relative[ tokens[0].type ],
- implicitRelative = leadingRelative || Expr.relative[" "],
- i = leadingRelative ? 1 : 0,
-
- // The foundational matcher ensures that elements are reachable from top-level context(s)
- matchContext = addCombinator( function( elem ) {
- return elem === checkContext;
- }, implicitRelative, true ),
- matchAnyContext = addCombinator( function( elem ) {
- return indexOf( checkContext, elem ) > -1;
- }, implicitRelative, true ),
- matchers = [ function( elem, context, xml ) {
- var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
- (checkContext = context).nodeType ?
- matchContext( elem, context, xml ) :
- matchAnyContext( elem, context, xml ) );
- // Avoid hanging onto element (issue #299)
- checkContext = null;
- return ret;
- } ];
-
- for ( ; i < len; i++ ) {
- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
- matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
- } else {
- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
- // Return special upon seeing a positional matcher
- if ( matcher[ expando ] ) {
- // Find the next relative operator (if any) for proper handling
- j = ++i;
- for ( ; j < len; j++ ) {
- if ( Expr.relative[ tokens[j].type ] ) {
- break;
- }
- }
- return setMatcher(
- i > 1 && elementMatcher( matchers ),
- i > 1 && toSelector(
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
- tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
- ).replace( rtrim, "$1" ),
- matcher,
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
- j < len && toSelector( tokens )
- );
- }
- matchers.push( matcher );
- }
- }
-
- return elementMatcher( matchers );
-}
-
-function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
- var bySet = setMatchers.length > 0,
- byElement = elementMatchers.length > 0,
- superMatcher = function( seed, context, xml, results, outermost ) {
- var elem, j, matcher,
- matchedCount = 0,
- i = "0",
- unmatched = seed && [],
- setMatched = [],
- contextBackup = outermostContext,
- // We must always have either seed elements or outermost context
- elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
- // Use integer dirruns iff this is the outermost matcher
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
- len = elems.length;
-
- if ( outermost ) {
- outermostContext = context !== document && context;
- }
-
- // Add elements passing elementMatchers directly to results
- // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
- // Support: IE<9, Safari
- // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
- for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
- if ( byElement && elem ) {
- j = 0;
- while ( (matcher = elementMatchers[j++]) ) {
- if ( matcher( elem, context, xml ) ) {
- results.push( elem );
- break;
- }
- }
- if ( outermost ) {
- dirruns = dirrunsUnique;
- }
- }
-
- // Track unmatched elements for set filters
- if ( bySet ) {
- // They will have gone through all possible matchers
- if ( (elem = !matcher && elem) ) {
- matchedCount--;
- }
-
- // Lengthen the array for every element, matched or not
- if ( seed ) {
- unmatched.push( elem );
- }
- }
- }
-
- // Apply set filters to unmatched elements
- matchedCount += i;
- if ( bySet && i !== matchedCount ) {
- j = 0;
- while ( (matcher = setMatchers[j++]) ) {
- matcher( unmatched, setMatched, context, xml );
- }
-
- if ( seed ) {
- // Reintegrate element matches to eliminate the need for sorting
- if ( matchedCount > 0 ) {
- while ( i-- ) {
- if ( !(unmatched[i] || setMatched[i]) ) {
- setMatched[i] = pop.call( results );
- }
- }
- }
-
- // Discard index placeholder values to get only actual matches
- setMatched = condense( setMatched );
- }
-
- // Add matches to results
- push.apply( results, setMatched );
-
- // Seedless set matches succeeding multiple successful matchers stipulate sorting
- if ( outermost && !seed && setMatched.length > 0 &&
- ( matchedCount + setMatchers.length ) > 1 ) {
-
- Sizzle.uniqueSort( results );
- }
- }
-
- // Override manipulation of globals by nested matchers
- if ( outermost ) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
-
- return unmatched;
- };
-
- return bySet ?
- markFunction( superMatcher ) :
- superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
- var i,
- setMatchers = [],
- elementMatchers = [],
- cached = compilerCache[ selector + " " ];
-
- if ( !cached ) {
- // Generate a function of recursive functions that can be used to check each element
- if ( !match ) {
- match = tokenize( selector );
- }
- i = match.length;
- while ( i-- ) {
- cached = matcherFromTokens( match[i] );
- if ( cached[ expando ] ) {
- setMatchers.push( cached );
- } else {
- elementMatchers.push( cached );
- }
- }
-
- // Cache the compiled function
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
-
- // Save selector and tokenization
- cached.selector = selector;
- }
- return cached;
-};
-
-/**
- * A low-level selection function that works with Sizzle's compiled
- * selector functions
- * @param {String|Function} selector A selector or a pre-compiled
- * selector function built with Sizzle.compile
- * @param {Element} context
- * @param {Array} [results]
- * @param {Array} [seed] A set of elements to match against
- */
-select = Sizzle.select = function( selector, context, results, seed ) {
- var i, tokens, token, type, find,
- compiled = typeof selector === "function" && selector,
- match = !seed && tokenize( (selector = compiled.selector || selector) );
-
- results = results || [];
-
- // Try to minimize operations if there is no seed and only one group
- if ( match.length === 1 ) {
-
- // Take a shortcut and set the context if the root selector is an ID
- tokens = match[0] = match[0].slice( 0 );
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
- support.getById && context.nodeType === 9 && documentIsHTML &&
- Expr.relative[ tokens[1].type ] ) {
-
- context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
- if ( !context ) {
- return results;
-
- // Precompiled matchers will still verify ancestry, so step up a level
- } else if ( compiled ) {
- context = context.parentNode;
- }
-
- selector = selector.slice( tokens.shift().value.length );
- }
-
- // Fetch a seed set for right-to-left matching
- i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
- while ( i-- ) {
- token = tokens[i];
-
- // Abort if we hit a combinator
- if ( Expr.relative[ (type = token.type) ] ) {
- break;
- }
- if ( (find = Expr.find[ type ]) ) {
- // Search, expanding context for leading sibling combinators
- if ( (seed = find(
- token.matches[0].replace( runescape, funescape ),
- rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
- )) ) {
-
- // If seed is empty or no tokens remain, we can return early
- tokens.splice( i, 1 );
- selector = seed.length && toSelector( tokens );
- if ( !selector ) {
- push.apply( results, seed );
- return results;
- }
-
- break;
- }
- }
- }
- }
-
- // Compile and execute a filtering function if one is not provided
- // Provide `match` to avoid retokenization if we modified the selector above
- ( compiled || compile( selector, match ) )(
- seed,
- context,
- !documentIsHTML,
- results,
- rsibling.test( selector ) && testContext( context.parentNode ) || context
- );
- return results;
-};
-
-// One-time assignments
-
-// Sort stability
-support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
-
-// Support: Chrome 14-35+
-// Always assume duplicates if they aren't passed to the comparison function
-support.detectDuplicates = !!hasDuplicate;
-
-// Initialize against the default document
-setDocument();
-
-// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
-// Detached nodes confoundingly follow *each other*
-support.sortDetached = assert(function( div1 ) {
- // Should return 1, but returns 4 (following)
- return div1.compareDocumentPosition( document.createElement("div") ) & 1;
-});
-
-// Support: IE<8
-// Prevent attribute/property "interpolation"
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !assert(function( div ) {
- div.innerHTML = "<a href='#'></a>";
- return div.firstChild.getAttribute("href") === "#" ;
-}) ) {
- addHandle( "type|href|height|width", function( elem, name, isXML ) {
- if ( !isXML ) {
- return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
- }
- });
-}
-
-// Support: IE<9
-// Use defaultValue in place of getAttribute("value")
-if ( !support.attributes || !assert(function( div ) {
- div.innerHTML = "<input/>";
- div.firstChild.setAttribute( "value", "" );
- return div.firstChild.getAttribute( "value" ) === "";
-}) ) {
- addHandle( "value", function( elem, name, isXML ) {
- if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
- return elem.defaultValue;
- }
- });
-}
-
-// Support: IE<9
-// Use getAttributeNode to fetch booleans when getAttribute lies
-if ( !assert(function( div ) {
- return div.getAttribute("disabled") == null;
-}) ) {
- addHandle( booleans, function( elem, name, isXML ) {
- var val;
- if ( !isXML ) {
- return elem[ name ] === true ? name.toLowerCase() :
- (val = elem.getAttributeNode( name )) && val.specified ?
- val.value :
- null;
- }
- });
-}
-
-return Sizzle;
-
-})( window );
-
-
-
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.pseudos;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-
-var rneedsContext = jQuery.expr.match.needsContext;
-
-var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
-
-
-
-var risSimple = /^.[^:#\[\.,]*$/;
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, not ) {
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep( elements, function( elem, i ) {
- /* jshint -W018 */
- return !!qualifier.call( elem, i, elem ) !== not;
- });
-
- }
-
- if ( qualifier.nodeType ) {
- return jQuery.grep( elements, function( elem ) {
- return ( elem === qualifier ) !== not;
- });
-
- }
-
- if ( typeof qualifier === "string" ) {
- if ( risSimple.test( qualifier ) ) {
- return jQuery.filter( qualifier, elements, not );
- }
-
- qualifier = jQuery.filter( qualifier, elements );
- }
-
- return jQuery.grep( elements, function( elem ) {
- return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
- });
-}
-
-jQuery.filter = function( expr, elems, not ) {
- var elem = elems[ 0 ];
-
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return elems.length === 1 && elem.nodeType === 1 ?
- jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
- jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
- return elem.nodeType === 1;
- }));
-};
-
-jQuery.fn.extend({
- find: function( selector ) {
- var i,
- ret = [],
- self = this,
- len = self.length;
-
- if ( typeof selector !== "string" ) {
- return this.pushStack( jQuery( selector ).filter(function() {
- for ( i = 0; i < len; i++ ) {
- if ( jQuery.contains( self[ i ], this ) ) {
- return true;
- }
- }
- }) );
- }
-
- for ( i = 0; i < len; i++ ) {
- jQuery.find( selector, self[ i ], ret );
- }
-
- // Needed because $( selector, context ) becomes $( context ).find( selector )
- ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
- ret.selector = this.selector ? this.selector + " " + selector : selector;
- return ret;
- },
- filter: function( selector ) {
- return this.pushStack( winnow(this, selector || [], false) );
- },
- not: function( selector ) {
- return this.pushStack( winnow(this, selector || [], true) );
- },
- is: function( selector ) {
- return !!winnow(
- this,
-
- // If this is a positional/relative selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- typeof selector === "string" && rneedsContext.test( selector ) ?
- jQuery( selector ) :
- selector || [],
- false
- ).length;
- }
-});
-
-
-// Initialize a jQuery object
-
-
-// A central reference to the root jQuery(document)
-var rootjQuery,
-
- // Use the correct document accordingly with window argument (sandbox)
- document = window.document,
-
- // A simple way to check for HTML strings
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
- // Strict HTML recognition (#11290: must start with <)
- rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
-
- init = jQuery.fn.init = function( selector, context ) {
- var match, elem;
-
- // HANDLE: $(""), $(null), $(undefined), $(false)
- if ( !selector ) {
- return this;
- }
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
- // Assume that strings that start and end with <> are HTML and skip the regex check
- match = [ null, selector, null ];
-
- } else {
- match = rquickExpr.exec( selector );
- }
-
- // Match html or make sure no context is specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] ) {
- context = context instanceof jQuery ? context[0] : context;
-
- // scripts is true for back-compat
- // Intentionally let the error be thrown if parseHTML is not present
- jQuery.merge( this, jQuery.parseHTML(
- match[1],
- context && context.nodeType ? context.ownerDocument || context : document,
- true
- ) );
-
- // HANDLE: $(html, props)
- if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
- for ( match in context ) {
- // Properties of context are called as methods if possible
- if ( jQuery.isFunction( this[ match ] ) ) {
- this[ match ]( context[ match ] );
-
- // ...and otherwise set as attributes
- } else {
- this.attr( match, context[ match ] );
- }
- }
- }
-
- return this;
-
- // HANDLE: $(#id)
- } else {
- elem = document.getElementById( match[2] );
-
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- if ( elem && elem.parentNode ) {
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( elem.id !== match[2] ) {
- return rootjQuery.find( selector );
- }
-
- // Otherwise, we inject the element directly into the jQuery object
- this.length = 1;
- this[0] = elem;
- }
-
- this.context = document;
- this.selector = selector;
- return this;
- }
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return ( context || rootjQuery ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(DOMElement)
- } else if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return typeof rootjQuery.ready !== "undefined" ?
- rootjQuery.ready( selector ) :
- // Execute immediately if ready is not present
- selector( jQuery );
- }
-
- if ( selector.selector !== undefined ) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.makeArray( selector, this );
- };
-
-// Give the init function the jQuery prototype for later instantiation
-init.prototype = jQuery.fn;
-
-// Initialize central reference
-rootjQuery = jQuery( document );
-
-
-var rparentsprev = /^(?:parents|prev(?:Until|All))/,
- // methods guaranteed to produce a unique set when starting from a unique set
- guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
-
-jQuery.extend({
- dir: function( elem, dir, until ) {
- var matched = [],
- cur = elem[ dir ];
-
- while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
- if ( cur.nodeType === 1 ) {
- matched.push( cur );
- }
- cur = cur[dir];
- }
- return matched;
- },
-
- sibling: function( n, elem ) {
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- r.push( n );
- }
- }
-
- return r;
- }
-});
-
-jQuery.fn.extend({
- has: function( target ) {
- var i,
- targets = jQuery( target, this ),
- len = targets.length;
-
- return this.filter(function() {
- for ( i = 0; i < len; i++ ) {
- if ( jQuery.contains( this, targets[i] ) ) {
- return true;
- }
- }
- });
- },
-
- closest: function( selectors, context ) {
- var cur,
- i = 0,
- l = this.length,
- matched = [],
- pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
- jQuery( selectors, context || this.context ) :
- 0;
-
- for ( ; i < l; i++ ) {
- for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
- // Always skip document fragments
- if ( cur.nodeType < 11 && (pos ?
- pos.index(cur) > -1 :
-
- // Don't pass non-elements to Sizzle
- cur.nodeType === 1 &&
- jQuery.find.matchesSelector(cur, selectors)) ) {
-
- matched.push( cur );
- break;
- }
- }
- }
-
- return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
- },
-
- // Determine the position of an element within
- // the matched set of elements
- index: function( elem ) {
-
- // No argument, return index in parent
- if ( !elem ) {
- return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
- }
-
- // index in selector
- if ( typeof elem === "string" ) {
- return jQuery.inArray( this[0], jQuery( elem ) );
- }
-
- // Locate the position of the desired element
- return jQuery.inArray(
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[0] : elem, this );
- },
-
- add: function( selector, context ) {
- return this.pushStack(
- jQuery.unique(
- jQuery.merge( this.get(), jQuery( selector, context ) )
- )
- );
- },
-
- addBack: function( selector ) {
- return this.add( selector == null ?
- this.prevObject : this.prevObject.filter(selector)
- );
- }
-});
-
-function sibling( cur, dir ) {
- do {
- cur = cur[ dir ];
- } while ( cur && cur.nodeType !== 1 );
-
- return cur;
-}
-
-jQuery.each({
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return jQuery.dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return sibling( elem, "nextSibling" );
- },
- prev: function( elem ) {
- return sibling( elem, "previousSibling" );
- },
- nextAll: function( elem ) {
- return jQuery.dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return jQuery.dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
- },
- children: function( elem ) {
- return jQuery.sibling( elem.firstChild );
- },
- contents: function( elem ) {
- return jQuery.nodeName( elem, "iframe" ) ?
- elem.contentDocument || elem.contentWindow.document :
- jQuery.merge( [], elem.childNodes );
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var ret = jQuery.map( this, fn, until );
-
- if ( name.slice( -5 ) !== "Until" ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- ret = jQuery.filter( selector, ret );
- }
-
- if ( this.length > 1 ) {
- // Remove duplicates
- if ( !guaranteedUnique[ name ] ) {
- ret = jQuery.unique( ret );
- }
-
- // Reverse order for parents* and prev-derivatives
- if ( rparentsprev.test( name ) ) {
- ret = ret.reverse();
- }
- }
-
- return this.pushStack( ret );
- };
-});
-var rnotwhite = (/\S+/g);
-
-
-
-// String to Object options format cache
-var optionsCache = {};
-
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
- var object = optionsCache[ options ] = {};
- jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
- object[ flag ] = true;
- });
- return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- * options: an optional list of space-separated options that will change how
- * the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- * once: will ensure the callback list can only be fired once (like a Deferred)
- *
- * memory: will keep track of previous values and will call any callback added
- * after the list has been fired right away with the latest "memorized"
- * values (like a Deferred)
- *
- * unique: will ensure a callback can only be added once (no duplicate in the list)
- *
- * stopOnFalse: interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( options ) {
-
- // Convert options from String-formatted to Object-formatted if needed
- // (we check in cache first)
- options = typeof options === "string" ?
- ( optionsCache[ options ] || createOptions( options ) ) :
- jQuery.extend( {}, options );
-
- var // Flag to know if list is currently firing
- firing,
- // Last fire value (for non-forgettable lists)
- memory,
- // Flag to know if list was already fired
- fired,
- // End of the loop when firing
- firingLength,
- // Index of currently firing callback (modified by remove if needed)
- firingIndex,
- // First callback to fire (used internally by add and fireWith)
- firingStart,
- // Actual callback list
- list = [],
- // Stack of fire calls for repeatable lists
- stack = !options.once && [],
- // Fire callbacks
- fire = function( data ) {
- memory = options.memory && data;
- fired = true;
- firingIndex = firingStart || 0;
- firingStart = 0;
- firingLength = list.length;
- firing = true;
- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
- if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
- memory = false; // To prevent further calls using add
- break;
- }
- }
- firing = false;
- if ( list ) {
- if ( stack ) {
- if ( stack.length ) {
- fire( stack.shift() );
- }
- } else if ( memory ) {
- list = [];
- } else {
- self.disable();
- }
- }
- },
- // Actual Callbacks object
- self = {
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
- // First, we save the current length
- var start = list.length;
- (function add( args ) {
- jQuery.each( args, function( _, arg ) {
- var type = jQuery.type( arg );
- if ( type === "function" ) {
- if ( !options.unique || !self.has( arg ) ) {
- list.push( arg );
- }
- } else if ( arg && arg.length && type !== "string" ) {
- // Inspect recursively
- add( arg );
- }
- });
- })( arguments );
- // Do we need to add the callbacks to the
- // current firing batch?
- if ( firing ) {
- firingLength = list.length;
- // With memory, if we're not firing then
- // we should call right away
- } else if ( memory ) {
- firingStart = start;
- fire( memory );
- }
- }
- return this;
- },
- // Remove a callback from the list
- remove: function() {
- if ( list ) {
- jQuery.each( arguments, function( _, arg ) {
- var index;
- while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
- list.splice( index, 1 );
- // Handle firing indexes
- if ( firing ) {
- if ( index <= firingLength ) {
- firingLength--;
- }
- if ( index <= firingIndex ) {
- firingIndex--;
- }
- }
- }
- });
- }
- return this;
- },
- // Check if a given callback is in the list.
- // If no argument is given, return whether or not list has callbacks attached.
- has: function( fn ) {
- return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
- },
- // Remove all callbacks from the list
- empty: function() {
- list = [];
- firingLength = 0;
- return this;
- },
- // Have the list do nothing anymore
- disable: function() {
- list = stack = memory = undefined;
- return this;
- },
- // Is it disabled?
- disabled: function() {
- return !list;
- },
- // Lock the list in its current state
- lock: function() {
- stack = undefined;
- if ( !memory ) {
- self.disable();
- }
- return this;
- },
- // Is it locked?
- locked: function() {
- return !stack;
- },
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- if ( list && ( !fired || stack ) ) {
- args = args || [];
- args = [ context, args.slice ? args.slice() : args ];
- if ( firing ) {
- stack.push( args );
- } else {
- fire( args );
- }
- }
- return this;
- },
- // Call all the callbacks with the given arguments
- fire: function() {
- self.fireWith( this, arguments );
- return this;
- },
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
-
- return self;
-};
-
-
-jQuery.extend({
-
- Deferred: function( func ) {
- var tuples = [
- // action, add listener, listener list, final state
- [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
- [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
- [ "notify", "progress", jQuery.Callbacks("memory") ]
- ],
- state = "pending",
- promise = {
- state: function() {
- return state;
- },
- always: function() {
- deferred.done( arguments ).fail( arguments );
- return this;
- },
- then: function( /* fnDone, fnFail, fnProgress */ ) {
- var fns = arguments;
- return jQuery.Deferred(function( newDefer ) {
- jQuery.each( tuples, function( i, tuple ) {
- var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
- // deferred[ done | fail | progress ] for forwarding actions to newDefer
- deferred[ tuple[1] ](function() {
- var returned = fn && fn.apply( this, arguments );
- if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise()
- .done( newDefer.resolve )
- .fail( newDefer.reject )
- .progress( newDefer.notify );
- } else {
- newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
- }
- });
- });
- fns = null;
- }).promise();
- },
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function( obj ) {
- return obj != null ? jQuery.extend( obj, promise ) : promise;
- }
- },
- deferred = {};
-
- // Keep pipe for back-compat
- promise.pipe = promise.then;
-
- // Add list-specific methods
- jQuery.each( tuples, function( i, tuple ) {
- var list = tuple[ 2 ],
- stateString = tuple[ 3 ];
-
- // promise[ done | fail | progress ] = list.add
- promise[ tuple[1] ] = list.add;
-
- // Handle state
- if ( stateString ) {
- list.add(function() {
- // state = [ resolved | rejected ]
- state = stateString;
-
- // [ reject_list | resolve_list ].disable; progress_list.lock
- }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
- }
-
- // deferred[ resolve | reject | notify ]
- deferred[ tuple[0] ] = function() {
- deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
- return this;
- };
- deferred[ tuple[0] + "With" ] = list.fireWith;
- });
-
- // Make the deferred a promise
- promise.promise( deferred );
-
- // Call given func if any
- if ( func ) {
- func.call( deferred, deferred );
- }
-
- // All done!
- return deferred;
- },
-
- // Deferred helper
- when: function( subordinate /* , ..., subordinateN */ ) {
- var i = 0,
- resolveValues = slice.call( arguments ),
- length = resolveValues.length,
-
- // the count of uncompleted subordinates
- remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
-
- // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
- deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
-
- // Update function for both resolve and progress values
- updateFunc = function( i, contexts, values ) {
- return function( value ) {
- contexts[ i ] = this;
- values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
- if ( values === progressValues ) {
- deferred.notifyWith( contexts, values );
-
- } else if ( !(--remaining) ) {
- deferred.resolveWith( contexts, values );
- }
- };
- },
-
- progressValues, progressContexts, resolveContexts;
-
- // add listeners to Deferred subordinates; treat others as resolved
- if ( length > 1 ) {
- progressValues = new Array( length );
- progressContexts = new Array( length );
- resolveContexts = new Array( length );
- for ( ; i < length; i++ ) {
- if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
- resolveValues[ i ].promise()
- .done( updateFunc( i, resolveContexts, resolveValues ) )
- .fail( deferred.reject )
- .progress( updateFunc( i, progressContexts, progressValues ) );
- } else {
- --remaining;
- }
- }
- }
-
- // if we're not waiting on anything, resolve the master
- if ( !remaining ) {
- deferred.resolveWith( resolveContexts, resolveValues );
- }
-
- return deferred.promise();
- }
-});
-
-
-// The deferred used on DOM ready
-var readyList;
-
-jQuery.fn.ready = function( fn ) {
- // Add the callback
- jQuery.ready.promise().done( fn );
-
- return this;
-};
-
-jQuery.extend({
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // A counter to track how many items to wait for before
- // the ready event fires. See #6781
- readyWait: 1,
-
- // Hold (or release) the ready event
- holdReady: function( hold ) {
- if ( hold ) {
- jQuery.readyWait++;
- } else {
- jQuery.ready( true );
- }
- },
-
- // Handle when the DOM is ready
- ready: function( wait ) {
-
- // Abort if there are pending holds or we're already ready
- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
- return;
- }
-
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( !document.body ) {
- return setTimeout( jQuery.ready );
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- readyList.resolveWith( document, [ jQuery ] );
-
- // Trigger any bound ready events
- if ( jQuery.fn.triggerHandler ) {
- jQuery( document ).triggerHandler( "ready" );
- jQuery( document ).off( "ready" );
- }
- }
-});
-
-/**
- * Clean-up method for dom ready events
- */
-function detach() {
- if ( document.addEventListener ) {
- document.removeEventListener( "DOMContentLoaded", completed, false );
- window.removeEventListener( "load", completed, false );
-
- } else {
- document.detachEvent( "onreadystatechange", completed );
- window.detachEvent( "onload", completed );
- }
-}
-
-/**
- * The ready event handler and self cleanup method
- */
-function completed() {
- // readyState === "complete" is good enough for us to call the dom ready in oldIE
- if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
- detach();
- jQuery.ready();
- }
-}
-
-jQuery.ready.promise = function( obj ) {
- if ( !readyList ) {
-
- readyList = jQuery.Deferred();
-
- // Catch cases where $(document).ready() is called after the browser event has already occurred.
- // we once tried to use readyState "interactive" here, but it caused issues like the one
- // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
- if ( document.readyState === "complete" ) {
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- setTimeout( jQuery.ready );
-
- // Standards-based browsers support DOMContentLoaded
- } else if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", completed, false );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", completed, false );
-
- // If IE event model is used
- } else {
- // Ensure firing before onload, maybe late but safe also for iframes
- document.attachEvent( "onreadystatechange", completed );
-
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", completed );
-
- // If IE and not a frame
- // continually check to see if the document is ready
- var top = false;
-
- try {
- top = window.frameElement == null && document.documentElement;
- } catch(e) {}
-
- if ( top && top.doScroll ) {
- (function doScrollCheck() {
- if ( !jQuery.isReady ) {
-
- try {
- // Use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- top.doScroll("left");
- } catch(e) {
- return setTimeout( doScrollCheck, 50 );
- }
-
- // detach all dom ready events
- detach();
-
- // and execute any waiting functions
- jQuery.ready();
- }
- })();
- }
- }
- }
- return readyList.promise( obj );
-};
-
-
-var strundefined = typeof undefined;
-
-
-
-// Support: IE<9
-// Iteration over object's inherited properties before its own
-var i;
-for ( i in jQuery( support ) ) {
- break;
-}
-support.ownLast = i !== "0";
-
-// Note: most support tests are defined in their respective modules.
-// false until the test is run
-support.inlineBlockNeedsLayout = false;
-
-// Execute ASAP in case we need to set body.style.zoom
-jQuery(function() {
- // Minified: var a,b,c,d
- var val, div, body, container;
-
- body = document.getElementsByTagName( "body" )[ 0 ];
- if ( !body || !body.style ) {
- // Return for frameset docs that don't have a body
- return;
- }
-
- // Setup
- div = document.createElement( "div" );
- container = document.createElement( "div" );
- container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
- body.appendChild( container ).appendChild( div );
-
- if ( typeof div.style.zoom !== strundefined ) {
- // Support: IE<8
- // Check if natively block-level elements act like inline-block
- // elements when setting their display to 'inline' and giving
- // them layout
- div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
-
- support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
- if ( val ) {
- // Prevent IE 6 from affecting layout for positioned elements #11048
- // Prevent IE from shrinking the body in IE 7 mode #12869
- // Support: IE<8
- body.style.zoom = 1;
- }
- }
-
- body.removeChild( container );
-});
-
-
-
-
-(function() {
- var div = document.createElement( "div" );
-
- // Execute the test only if not already executed in another module.
- if (support.deleteExpando == null) {
- // Support: IE<9
- support.deleteExpando = true;
- try {
- delete div.test;
- } catch( e ) {
- support.deleteExpando = false;
- }
- }
-
- // Null elements to avoid leaks in IE.
- div = null;
-})();
-
-
-/**
- * Determines whether an object can have data
- */
-jQuery.acceptData = function( elem ) {
- var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
- nodeType = +elem.nodeType || 1;
-
- // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
- return nodeType !== 1 && nodeType !== 9 ?
- false :
-
- // Nodes accept data unless otherwise specified; rejection can be conditional
- !noData || noData !== true && elem.getAttribute("classid") === noData;
-};
-
-
-var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
- rmultiDash = /([A-Z])/g;
-
-function dataAttr( elem, key, data ) {
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if ( data === undefined && elem.nodeType === 1 ) {
-
- var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
- data = elem.getAttribute( name );
-
- if ( typeof data === "string" ) {
- try {
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null :
- // Only convert to a number if it doesn't change the string
- +data + "" === data ? +data :
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
- data;
- } catch( e ) {}
-
- // Make sure we set the data so it isn't changed later
- jQuery.data( elem, key, data );
-
- } else {
- data = undefined;
- }
- }
-
- return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
- var name;
- for ( name in obj ) {
-
- // if the public data object is empty, the private is still empty
- if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
- continue;
- }
- if ( name !== "toJSON" ) {
- return false;
- }
- }
-
- return true;
-}
-
-function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var ret, thisCache,
- internalKey = jQuery.expando,
-
- // We have to handle DOM nodes and JS objects differently because IE6-7
- // can't GC object references properly across the DOM-JS boundary
- isNode = elem.nodeType,
-
- // Only DOM nodes need the global jQuery cache; JS object data is
- // attached directly to the object so GC can occur automatically
- cache = isNode ? jQuery.cache : elem,
-
- // Only defining an ID for JS objects if its cache already exists allows
- // the code to shortcut on the same path as a DOM node with no cache
- id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
-
- // Avoid doing any more work than we need to when trying to get data on an
- // object that has no data at all
- if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
- return;
- }
-
- if ( !id ) {
- // Only DOM nodes need a new unique ID for each element since their data
- // ends up in the global cache
- if ( isNode ) {
- id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
- } else {
- id = internalKey;
- }
- }
-
- if ( !cache[ id ] ) {
- // Avoid exposing jQuery metadata on plain JS objects when the object
- // is serialized using JSON.stringify
- cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
- }
-
- // An object can be passed to jQuery.data instead of a key/value pair; this gets
- // shallow copied over onto the existing cache
- if ( typeof name === "object" || typeof name === "function" ) {
- if ( pvt ) {
- cache[ id ] = jQuery.extend( cache[ id ], name );
- } else {
- cache[ id ].data = jQuery.extend( cache[ id ].data, name );
- }
- }
-
- thisCache = cache[ id ];
-
- // jQuery data() is stored in a separate object inside the object's internal data
- // cache in order to avoid key collisions between internal data and user-defined
- // data.
- if ( !pvt ) {
- if ( !thisCache.data ) {
- thisCache.data = {};
- }
-
- thisCache = thisCache.data;
- }
-
- if ( data !== undefined ) {
- thisCache[ jQuery.camelCase( name ) ] = data;
- }
-
- // Check for both converted-to-camel and non-converted data property names
- // If a data property was specified
- if ( typeof name === "string" ) {
-
- // First Try to find as-is property data
- ret = thisCache[ name ];
-
- // Test for null|undefined property data
- if ( ret == null ) {
-
- // Try to find the camelCased property
- ret = thisCache[ jQuery.camelCase( name ) ];
- }
- } else {
- ret = thisCache;
- }
-
- return ret;
-}
-
-function internalRemoveData( elem, name, pvt ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var thisCache, i,
- isNode = elem.nodeType,
-
- // See jQuery.data for more information
- cache = isNode ? jQuery.cache : elem,
- id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
-
- // If there is already no cache entry for this object, there is no
- // purpose in continuing
- if ( !cache[ id ] ) {
- return;
- }
-
- if ( name ) {
-
- thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
- if ( thisCache ) {
-
- // Support array or space separated string names for data keys
- if ( !jQuery.isArray( name ) ) {
-
- // try the string as a key before any manipulation
- if ( name in thisCache ) {
- name = [ name ];
- } else {
-
- // split the camel cased version by spaces unless a key with the spaces exists
- name = jQuery.camelCase( name );
- if ( name in thisCache ) {
- name = [ name ];
- } else {
- name = name.split(" ");
- }
- }
- } else {
- // If "name" is an array of keys...
- // When data is initially created, via ("key", "val") signature,
- // keys will be converted to camelCase.
- // Since there is no way to tell _how_ a key was added, remove
- // both plain key and camelCase key. #12786
- // This will only penalize the array argument path.
- name = name.concat( jQuery.map( name, jQuery.camelCase ) );
- }
-
- i = name.length;
- while ( i-- ) {
- delete thisCache[ name[i] ];
- }
-
- // If there is no data left in the cache, we want to continue
- // and let the cache object itself get destroyed
- if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
- return;
- }
- }
- }
-
- // See jQuery.data for more information
- if ( !pvt ) {
- delete cache[ id ].data;
-
- // Don't destroy the parent cache unless the internal data object
- // had been the only thing left in it
- if ( !isEmptyDataObject( cache[ id ] ) ) {
- return;
- }
- }
-
- // Destroy the cache
- if ( isNode ) {
- jQuery.cleanData( [ elem ], true );
-
- // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
- /* jshint eqeqeq: false */
- } else if ( support.deleteExpando || cache != cache.window ) {
- /* jshint eqeqeq: true */
- delete cache[ id ];
-
- // When all else fails, null
- } else {
- cache[ id ] = null;
- }
-}
-
-jQuery.extend({
- cache: {},
-
- // The following elements (space-suffixed to avoid Object.prototype collisions)
- // throw uncatchable exceptions if you attempt to set expando properties
- noData: {
- "applet ": true,
- "embed ": true,
- // ...but Flash objects (which have this classid) *can* handle expandos
- "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
- },
-
- hasData: function( elem ) {
- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
- return !!elem && !isEmptyDataObject( elem );
- },
-
- data: function( elem, name, data ) {
- return internalData( elem, name, data );
- },
-
- removeData: function( elem, name ) {
- return internalRemoveData( elem, name );
- },
-
- // For internal use only.
- _data: function( elem, name, data ) {
- return internalData( elem, name, data, true );
- },
-
- _removeData: function( elem, name ) {
- return internalRemoveData( elem, name, true );
- }
-});
-
-jQuery.fn.extend({
- data: function( key, value ) {
- var i, name, data,
- elem = this[0],
- attrs = elem && elem.attributes;
-
- // Special expections of .data basically thwart jQuery.access,
- // so implement the relevant behavior ourselves
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = jQuery.data( elem );
-
- if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
- i = attrs.length;
- while ( i-- ) {
-
- // Support: IE11+
- // The attrs elements can be null (#14894)
- if ( attrs[ i ] ) {
- name = attrs[ i ].name;
- if ( name.indexOf( "data-" ) === 0 ) {
- name = jQuery.camelCase( name.slice(5) );
- dataAttr( elem, name, data[ name ] );
- }
- }
- }
- jQuery._data( elem, "parsedAttrs", true );
- }
- }
-
- return data;
- }
-
- // Sets multiple values
- if ( typeof key === "object" ) {
- return this.each(function() {
- jQuery.data( this, key );
- });
- }
-
- return arguments.length > 1 ?
-
- // Sets one value
- this.each(function() {
- jQuery.data( this, key, value );
- }) :
-
- // Gets one value
- // Try to fetch any internally stored data first
- elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
- },
-
- removeData: function( key ) {
- return this.each(function() {
- jQuery.removeData( this, key );
- });
- }
-});
-
-
-jQuery.extend({
- queue: function( elem, type, data ) {
- var queue;
-
- if ( elem ) {
- type = ( type || "fx" ) + "queue";
- queue = jQuery._data( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( data ) {
- if ( !queue || jQuery.isArray(data) ) {
- queue = jQuery._data( elem, type, jQuery.makeArray(data) );
- } else {
- queue.push( data );
- }
- }
- return queue || [];
- }
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- startLength = queue.length,
- fn = queue.shift(),
- hooks = jQuery._queueHooks( elem, type ),
- next = function() {
- jQuery.dequeue( elem, type );
- };
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- startLength--;
- }
-
- if ( fn ) {
-
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift( "inprogress" );
- }
-
- // clear up the last queue stop function
- delete hooks.stop;
- fn.call( elem, next, hooks );
- }
-
- if ( !startLength && hooks ) {
- hooks.empty.fire();
- }
- },
-
- // not intended for public consumption - generates a queueHooks object, or returns the current one
- _queueHooks: function( elem, type ) {
- var key = type + "queueHooks";
- return jQuery._data( elem, key ) || jQuery._data( elem, key, {
- empty: jQuery.Callbacks("once memory").add(function() {
- jQuery._removeData( elem, type + "queue" );
- jQuery._removeData( elem, key );
- })
- });
- }
-});
-
-jQuery.fn.extend({
- queue: function( type, data ) {
- var setter = 2;
-
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- setter--;
- }
-
- if ( arguments.length < setter ) {
- return jQuery.queue( this[0], type );
- }
-
- return data === undefined ?
- this :
- this.each(function() {
- var queue = jQuery.queue( this, type, data );
-
- // ensure a hooks for this queue
- jQuery._queueHooks( this, type );
-
- if ( type === "fx" && queue[0] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- dequeue: function( type ) {
- return this.each(function() {
- jQuery.dequeue( this, type );
- });
- },
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- },
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function( type, obj ) {
- var tmp,
- count = 1,
- defer = jQuery.Deferred(),
- elements = this,
- i = this.length,
- resolve = function() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- };
-
- if ( typeof type !== "string" ) {
- obj = type;
- type = undefined;
- }
- type = type || "fx";
-
- while ( i-- ) {
- tmp = jQuery._data( elements[ i ], type + "queueHooks" );
- if ( tmp && tmp.empty ) {
- count++;
- tmp.empty.add( resolve );
- }
- }
- resolve();
- return defer.promise( obj );
- }
-});
-var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
-
-var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
-
-var isHidden = function( elem, el ) {
- // isHidden might be called from jQuery#filter function;
- // in that case, element will be second argument
- elem = el || elem;
- return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
- };
-
-
-
-// Multifunctional method to get and set values of a collection
-// The value/s can optionally be executed if it's a function
-var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
- var i = 0,
- length = elems.length,
- bulk = key == null;
-
- // Sets many values
- if ( jQuery.type( key ) === "object" ) {
- chainable = true;
- for ( i in key ) {
- jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
- }
-
- // Sets one value
- } else if ( value !== undefined ) {
- chainable = true;
-
- if ( !jQuery.isFunction( value ) ) {
- raw = true;
- }
-
- if ( bulk ) {
- // Bulk operations run against the entire set
- if ( raw ) {
- fn.call( elems, value );
- fn = null;
-
- // ...except when executing function values
- } else {
- bulk = fn;
- fn = function( elem, key, value ) {
- return bulk.call( jQuery( elem ), value );
- };
- }
- }
-
- if ( fn ) {
- for ( ; i < length; i++ ) {
- fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
- }
- }
- }
-
- return chainable ?
- elems :
-
- // Gets
- bulk ?
- fn.call( elems ) :
- length ? fn( elems[0], key ) : emptyGet;
-};
-var rcheckableType = (/^(?:checkbox|radio)$/i);
-
-
-
-(function() {
- // Minified: var a,b,c
- var input = document.createElement( "input" ),
- div = document.createElement( "div" ),
- fragment = document.createDocumentFragment();
-
- // Setup
- div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
-
- // IE strips leading whitespace when .innerHTML is used
- support.leadingWhitespace = div.firstChild.nodeType === 3;
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- support.tbody = !div.getElementsByTagName( "tbody" ).length;
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
-
- // Makes sure cloning an html5 element does not cause problems
- // Where outerHTML is undefined, this still works
- support.html5Clone =
- document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
-
- // Check if a disconnected checkbox will retain its checked
- // value of true after appended to the DOM (IE6/7)
- input.type = "checkbox";
- input.checked = true;
- fragment.appendChild( input );
- support.appendChecked = input.checked;
-
- // Make sure textarea (and checkbox) defaultValue is properly cloned
- // Support: IE6-IE11+
- div.innerHTML = "<textarea>x</textarea>";
- support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
-
- // #11217 - WebKit loses check when the name is after the checked attribute
- fragment.appendChild( div );
- div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
-
- // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
- // old WebKit doesn't clone checked state correctly in fragments
- support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Support: IE<9
- // Opera does not clone events (and typeof div.attachEvent === undefined).
- // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
- support.noCloneEvent = true;
- if ( div.attachEvent ) {
- div.attachEvent( "onclick", function() {
- support.noCloneEvent = false;
- });
-
- div.cloneNode( true ).click();
- }
-
- // Execute the test only if not already executed in another module.
- if (support.deleteExpando == null) {
- // Support: IE<9
- support.deleteExpando = true;
- try {
- delete div.test;
- } catch( e ) {
- support.deleteExpando = false;
- }
- }
-})();
-
-
-(function() {
- var i, eventName,
- div = document.createElement( "div" );
-
- // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
- for ( i in { submit: true, change: true, focusin: true }) {
- eventName = "on" + i;
-
- if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
- // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
- div.setAttribute( eventName, "t" );
- support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
- }
- }
-
- // Null elements to avoid leaks in IE.
- div = null;
-})();
-
-
-var rformElems = /^(?:input|select|textarea)$/i,
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
- rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
-
-function returnTrue() {
- return true;
-}
-
-function returnFalse() {
- return false;
-}
-
-function safeActiveElement() {
- try {
- return document.activeElement;
- } catch ( err ) { }
-}
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
- global: {},
-
- add: function( elem, types, handler, data, selector ) {
- var tmp, events, t, handleObjIn,
- special, eventHandle, handleObj,
- handlers, type, namespaces, origType,
- elemData = jQuery._data( elem );
-
- // Don't attach events to noData or text/comment nodes (but allow plain objects)
- if ( !elemData ) {
- return;
- }
-
- // Caller can pass in an object of custom data in lieu of the handler
- if ( handler.handler ) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
-
- // Make sure that the handler has a unique ID, used to find/remove it later
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // Init the element's event structure and main handler, if this is the first
- if ( !(events = elemData.events) ) {
- events = elemData.events = {};
- }
- if ( !(eventHandle = elemData.handle) ) {
- eventHandle = elemData.handle = function( e ) {
- // Discard the second event of a jQuery.event.trigger() and
- // when an event is called after a page has unloaded
- return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
- jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
- undefined;
- };
- // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
- eventHandle.elem = elem;
- }
-
- // Handle multiple events separated by a space
- types = ( types || "" ).match( rnotwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[t] ) || [];
- type = origType = tmp[1];
- namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
- // There *must* be a type, no attaching namespace-only handlers
- if ( !type ) {
- continue;
- }
-
- // If event changes its type, use the special event handlers for the changed type
- special = jQuery.event.special[ type ] || {};
-
- // If selector defined, determine special event api type, otherwise given type
- type = ( selector ? special.delegateType : special.bindType ) || type;
-
- // Update special based on newly reset type
- special = jQuery.event.special[ type ] || {};
-
- // handleObj is passed to all event handlers
- handleObj = jQuery.extend({
- type: type,
- origType: origType,
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
- namespace: namespaces.join(".")
- }, handleObjIn );
-
- // Init the event handler queue if we're the first
- if ( !(handlers = events[ type ]) ) {
- handlers = events[ type ] = [];
- handlers.delegateCount = 0;
-
- // Only use addEventListener/attachEvent if the special events handler returns false
- if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
- // Bind the global event handler to the element
- if ( elem.addEventListener ) {
- elem.addEventListener( type, eventHandle, false );
-
- } else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, eventHandle );
- }
- }
- }
-
- if ( special.add ) {
- special.add.call( elem, handleObj );
-
- if ( !handleObj.handler.guid ) {
- handleObj.handler.guid = handler.guid;
- }
- }
-
- // Add to the element's handler list, delegates in front
- if ( selector ) {
- handlers.splice( handlers.delegateCount++, 0, handleObj );
- } else {
- handlers.push( handleObj );
- }
-
- // Keep track of which events have ever been used, for event optimization
- jQuery.event.global[ type ] = true;
- }
-
- // Nullify elem to prevent memory leaks in IE
- elem = null;
- },
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
- var j, handleObj, tmp,
- origCount, t, events,
- special, handlers, type,
- namespaces, origType,
- elemData = jQuery.hasData( elem ) && jQuery._data( elem );
-
- if ( !elemData || !(events = elemData.events) ) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = ( types || "" ).match( rnotwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[t] ) || [];
- type = origType = tmp[1];
- namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
- // Unbind all events (on this namespace, if provided) for the element
- if ( !type ) {
- for ( type in events ) {
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
- }
- continue;
- }
-
- special = jQuery.event.special[ type ] || {};
- type = ( selector ? special.delegateType : special.bindType ) || type;
- handlers = events[ type ] || [];
- tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
-
- // Remove matching events
- origCount = j = handlers.length;
- while ( j-- ) {
- handleObj = handlers[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !tmp || tmp.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
- handlers.splice( j, 1 );
-
- if ( handleObj.selector ) {
- handlers.delegateCount--;
- }
- if ( special.remove ) {
- special.remove.call( elem, handleObj );
- }
- }
- }
-
- // Remove generic event handler if we removed something and no more handlers exist
- // (avoids potential for endless recursion during removal of special event handlers)
- if ( origCount && !handlers.length ) {
- if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
- jQuery.removeEvent( elem, type, elemData.handle );
- }
-
- delete events[ type ];
- }
- }
-
- // Remove the expando if it's no longer used
- if ( jQuery.isEmptyObject( events ) ) {
- delete elemData.handle;
-
- // removeData also checks for emptiness and clears the expando if empty
- // so use it instead of delete
- jQuery._removeData( elem, "events" );
- }
- },
-
- trigger: function( event, data, elem, onlyHandlers ) {
- var handle, ontype, cur,
- bubbleType, special, tmp, i,
- eventPath = [ elem || document ],
- type = hasOwn.call( event, "type" ) ? event.type : event,
- namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
-
- cur = tmp = elem = elem || document;
-
- // Don't do events on text and comment nodes
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
- return;
- }
-
- // focus/blur morphs to focusin/out; ensure we're not firing them right now
- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
- return;
- }
-
- if ( type.indexOf(".") >= 0 ) {
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split(".");
- type = namespaces.shift();
- namespaces.sort();
- }
- ontype = type.indexOf(":") < 0 && "on" + type;
-
- // Caller can pass in a jQuery.Event object, Object, or just an event type string
- event = event[ jQuery.expando ] ?
- event :
- new jQuery.Event( type, typeof event === "object" && event );
-
- // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
- event.isTrigger = onlyHandlers ? 2 : 3;
- event.namespace = namespaces.join(".");
- event.namespace_re = event.namespace ?
- new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
- null;
-
- // Clean up the event in case it is being reused
- event.result = undefined;
- if ( !event.target ) {
- event.target = elem;
- }
-
- // Clone any incoming data and prepend the event, creating the handler arg list
- data = data == null ?
- [ event ] :
- jQuery.makeArray( data, [ event ] );
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
- return;
- }
-
- // Determine event propagation path in advance, per W3C events spec (#9951)
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
- bubbleType = special.delegateType || type;
- if ( !rfocusMorph.test( bubbleType + type ) ) {
- cur = cur.parentNode;
- }
- for ( ; cur; cur = cur.parentNode ) {
- eventPath.push( cur );
- tmp = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( tmp === (elem.ownerDocument || document) ) {
- eventPath.push( tmp.defaultView || tmp.parentWindow || window );
- }
- }
-
- // Fire handlers on the event path
- i = 0;
- while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
-
- event.type = i > 1 ?
- bubbleType :
- special.bindType || type;
-
- // jQuery handler
- handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
- if ( handle ) {
- handle.apply( cur, data );
- }
-
- // Native handler
- handle = ontype && cur[ ontype ];
- if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
- event.result = handle.apply( cur, data );
- if ( event.result === false ) {
- event.preventDefault();
- }
- }
- }
- event.type = type;
-
- // If nobody prevented the default action, do it now
- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
- if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
- jQuery.acceptData( elem ) ) {
-
- // Call a native DOM method on the target with the same name name as the event.
- // Can't use an .isFunction() check here because IE6/7 fails that test.
- // Don't do default actions on window, that's where global variables be (#6170)
- if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- tmp = elem[ ontype ];
-
- if ( tmp ) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
- try {
- elem[ type ]();
- } catch ( e ) {
- // IE<9 dies on focus/blur to hidden element (#1486,#12518)
- // only reproducible on winXP IE8 native, not IE9 in IE8 mode
- }
- jQuery.event.triggered = undefined;
-
- if ( tmp ) {
- elem[ ontype ] = tmp;
- }
- }
- }
- }
-
- return event.result;
- },
-
- dispatch: function( event ) {
-
- // Make a writable jQuery.Event from the native event object
- event = jQuery.event.fix( event );
-
- var i, ret, handleObj, matched, j,
- handlerQueue = [],
- args = slice.call( arguments ),
- handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
- special = jQuery.event.special[ event.type ] || {};
-
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
- args[0] = event;
- event.delegateTarget = this;
-
- // Call the preDispatch hook for the mapped type, and let it bail if desired
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
- return;
- }
-
- // Determine handlers
- handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
- // Run delegates first; they may want to stop propagation beneath us
- i = 0;
- while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
- event.currentTarget = matched.elem;
-
- j = 0;
- while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
-
- // Triggered event must either 1) have no namespace, or
- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
- if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
-
- event.handleObj = handleObj;
- event.data = handleObj.data;
-
- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
- .apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- if ( (event.result = ret) === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
-
- // Call the postDispatch hook for the mapped type
- if ( special.postDispatch ) {
- special.postDispatch.call( this, event );
- }
-
- return event.result;
- },
-
- handlers: function( event, handlers ) {
- var sel, handleObj, matches, i,
- handlerQueue = [],
- delegateCount = handlers.delegateCount,
- cur = event.target;
-
- // Find delegate handlers
- // Black-hole SVG <use> instance trees (#13180)
- // Avoid non-left-click bubbling in Firefox (#3861)
- if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
-
- /* jshint eqeqeq: false */
- for ( ; cur != this; cur = cur.parentNode || this ) {
- /* jshint eqeqeq: true */
-
- // Don't check non-elements (#13208)
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
- if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
- matches = [];
- for ( i = 0; i < delegateCount; i++ ) {
- handleObj = handlers[ i ];
-
- // Don't conflict with Object.prototype properties (#13203)
- sel = handleObj.selector + " ";
-
- if ( matches[ sel ] === undefined ) {
- matches[ sel ] = handleObj.needsContext ?
- jQuery( sel, this ).index( cur ) >= 0 :
- jQuery.find( sel, this, null, [ cur ] ).length;
- }
- if ( matches[ sel ] ) {
- matches.push( handleObj );
- }
- }
- if ( matches.length ) {
- handlerQueue.push({ elem: cur, handlers: matches });
- }
- }
- }
- }
-
- // Add the remaining (directly-bound) handlers
- if ( delegateCount < handlers.length ) {
- handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
- }
-
- return handlerQueue;
- },
-
- fix: function( event ) {
- if ( event[ jQuery.expando ] ) {
- return event;
- }
-
- // Create a writable copy of the event object and normalize some properties
- var i, prop, copy,
- type = event.type,
- originalEvent = event,
- fixHook = this.fixHooks[ type ];
-
- if ( !fixHook ) {
- this.fixHooks[ type ] = fixHook =
- rmouseEvent.test( type ) ? this.mouseHooks :
- rkeyEvent.test( type ) ? this.keyHooks :
- {};
- }
- copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
- event = new jQuery.Event( originalEvent );
-
- i = copy.length;
- while ( i-- ) {
- prop = copy[ i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Support: IE<9
- // Fix target property (#1925)
- if ( !event.target ) {
- event.target = originalEvent.srcElement || document;
- }
-
- // Support: Chrome 23+, Safari?
- // Target should not be a text node (#504, #13143)
- if ( event.target.nodeType === 3 ) {
- event.target = event.target.parentNode;
- }
-
- // Support: IE<9
- // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
- event.metaKey = !!event.metaKey;
-
- return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
- },
-
- // Includes some event props shared by KeyEvent and MouseEvent
- props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
- fixHooks: {},
-
- keyHooks: {
- props: "char charCode key keyCode".split(" "),
- filter: function( event, original ) {
-
- // Add which for key events
- if ( event.which == null ) {
- event.which = original.charCode != null ? original.charCode : original.keyCode;
- }
-
- return event;
- }
- },
-
- mouseHooks: {
- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
- filter: function( event, original ) {
- var body, eventDoc, doc,
- button = original.button,
- fromElement = original.fromElement;
-
- // Calculate pageX/Y if missing and clientX/Y available
- if ( event.pageX == null && original.clientX != null ) {
- eventDoc = event.target.ownerDocument || document;
- doc = eventDoc.documentElement;
- body = eventDoc.body;
-
- event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
- event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
- }
-
- // Add relatedTarget, if necessary
- if ( !event.relatedTarget && fromElement ) {
- event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- // Note: button is not normalized, so don't use it
- if ( !event.which && button !== undefined ) {
- event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
- }
-
- return event;
- }
- },
-
- special: {
- load: {
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
- focus: {
- // Fire native event if possible so blur/focus sequence is correct
- trigger: function() {
- if ( this !== safeActiveElement() && this.focus ) {
- try {
- this.focus();
- return false;
- } catch ( e ) {
- // Support: IE<9
- // If we error on focus to hidden element (#1486, #12518),
- // let .trigger() run the handlers
- }
- }
- },
- delegateType: "focusin"
- },
- blur: {
- trigger: function() {
- if ( this === safeActiveElement() && this.blur ) {
- this.blur();
- return false;
- }
- },
- delegateType: "focusout"
- },
- click: {
- // For checkbox, fire native event so checked state will be right
- trigger: function() {
- if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
- this.click();
- return false;
- }
- },
-
- // For cross-browser consistency, don't fire native .click() on links
- _default: function( event ) {
- return jQuery.nodeName( event.target, "a" );
- }
- },
-
- beforeunload: {
- postDispatch: function( event ) {
-
- // Support: Firefox 20+
- // Firefox doesn't alert if the returnValue field is not set.
- if ( event.result !== undefined && event.originalEvent ) {
- event.originalEvent.returnValue = event.result;
- }
- }
- }
- },
-
- simulate: function( type, elem, event, bubble ) {
- // Piggyback on a donor event to simulate a different one.
- // Fake originalEvent to avoid donor's stopPropagation, but if the
- // simulated event prevents default then we do the same on the donor.
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- {
- type: type,
- isSimulated: true,
- originalEvent: {}
- }
- );
- if ( bubble ) {
- jQuery.event.trigger( e, null, elem );
- } else {
- jQuery.event.dispatch.call( elem, e );
- }
- if ( e.isDefaultPrevented() ) {
- event.preventDefault();
- }
- }
-};
-
-jQuery.removeEvent = document.removeEventListener ?
- function( elem, type, handle ) {
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, handle, false );
- }
- } :
- function( elem, type, handle ) {
- var name = "on" + type;
-
- if ( elem.detachEvent ) {
-
- // #8545, #7054, preventing memory leaks for custom events in IE6-8
- // detachEvent needed property on element, by name of that event, to properly expose it to GC
- if ( typeof elem[ name ] === strundefined ) {
- elem[ name ] = null;
- }
-
- elem.detachEvent( name, handle );
- }
- };
-
-jQuery.Event = function( src, props ) {
- // Allow instantiation without the 'new' keyword
- if ( !(this instanceof jQuery.Event) ) {
- return new jQuery.Event( src, props );
- }
-
- // Event object
- if ( src && src.type ) {
- this.originalEvent = src;
- this.type = src.type;
-
- // Events bubbling up the document may have been marked as prevented
- // by a handler lower down the tree; reflect the correct value.
- this.isDefaultPrevented = src.defaultPrevented ||
- src.defaultPrevented === undefined &&
- // Support: IE < 9, Android < 4.0
- src.returnValue === false ?
- returnTrue :
- returnFalse;
-
- // Event type
- } else {
- this.type = src;
- }
-
- // Put explicitly provided properties onto the event object
- if ( props ) {
- jQuery.extend( this, props );
- }
-
- // Create a timestamp if incoming event doesn't have one
- this.timeStamp = src && src.timeStamp || jQuery.now();
-
- // Mark it as fixed
- this[ jQuery.expando ] = true;
-};
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse,
-
- preventDefault: function() {
- var e = this.originalEvent;
-
- this.isDefaultPrevented = returnTrue;
- if ( !e ) {
- return;
- }
-
- // If preventDefault exists, run it on the original event
- if ( e.preventDefault ) {
- e.preventDefault();
-
- // Support: IE
- // Otherwise set the returnValue property of the original event to false
- } else {
- e.returnValue = false;
- }
- },
- stopPropagation: function() {
- var e = this.originalEvent;
-
- this.isPropagationStopped = returnTrue;
- if ( !e ) {
- return;
- }
- // If stopPropagation exists, run it on the original event
- if ( e.stopPropagation ) {
- e.stopPropagation();
- }
-
- // Support: IE
- // Set the cancelBubble property of the original event to true
- e.cancelBubble = true;
- },
- stopImmediatePropagation: function() {
- var e = this.originalEvent;
-
- this.isImmediatePropagationStopped = returnTrue;
-
- if ( e && e.stopImmediatePropagation ) {
- e.stopImmediatePropagation();
- }
-
- this.stopPropagation();
- }
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
-}, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- delegateType: fix,
- bindType: fix,
-
- handle: function( event ) {
- var ret,
- target = this,
- related = event.relatedTarget,
- handleObj = event.handleObj;
-
- // For mousenter/leave call the handler if related is outside the target.
- // NB: No relatedTarget if the mouse left/entered the browser window
- if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
- event.type = handleObj.origType;
- ret = handleObj.handler.apply( this, arguments );
- event.type = fix;
- }
- return ret;
- }
- };
-});
-
-// IE submit delegation
-if ( !support.submitBubbles ) {
-
- jQuery.event.special.submit = {
- setup: function() {
- // Only need this for delegated form submit events
- if ( jQuery.nodeName( this, "form" ) ) {
- return false;
- }
-
- // Lazy-add a submit handler when a descendant form may potentially be submitted
- jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
- // Node name check avoids a VML-related crash in IE (#9807)
- var elem = e.target,
- form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
- if ( form && !jQuery._data( form, "submitBubbles" ) ) {
- jQuery.event.add( form, "submit._submit", function( event ) {
- event._submit_bubble = true;
- });
- jQuery._data( form, "submitBubbles", true );
- }
- });
- // return undefined since we don't need an event listener
- },
-
- postDispatch: function( event ) {
- // If form was submitted by the user, bubble the event up the tree
- if ( event._submit_bubble ) {
- delete event._submit_bubble;
- if ( this.parentNode && !event.isTrigger ) {
- jQuery.event.simulate( "submit", this.parentNode, event, true );
- }
- }
- },
-
- teardown: function() {
- // Only need this for delegated form submit events
- if ( jQuery.nodeName( this, "form" ) ) {
- return false;
- }
-
- // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
- jQuery.event.remove( this, "._submit" );
- }
- };
-}
-
-// IE change delegation and checkbox/radio fix
-if ( !support.changeBubbles ) {
-
- jQuery.event.special.change = {
-
- setup: function() {
-
- if ( rformElems.test( this.nodeName ) ) {
- // IE doesn't fire change on a check/radio until blur; trigger it on click
- // after a propertychange. Eat the blur-change in special.change.handle.
- // This still fires onchange a second time for check/radio after blur.
- if ( this.type === "checkbox" || this.type === "radio" ) {
- jQuery.event.add( this, "propertychange._change", function( event ) {
- if ( event.originalEvent.propertyName === "checked" ) {
- this._just_changed = true;
- }
- });
- jQuery.event.add( this, "click._change", function( event ) {
- if ( this._just_changed && !event.isTrigger ) {
- this._just_changed = false;
- }
- // Allow triggered, simulated change events (#11500)
- jQuery.event.simulate( "change", this, event, true );
- });
- }
- return false;
- }
- // Delegated event; lazy-add a change handler on descendant inputs
- jQuery.event.add( this, "beforeactivate._change", function( e ) {
- var elem = e.target;
-
- if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
- jQuery.event.add( elem, "change._change", function( event ) {
- if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
- jQuery.event.simulate( "change", this.parentNode, event, true );
- }
- });
- jQuery._data( elem, "changeBubbles", true );
- }
- });
- },
-
- handle: function( event ) {
- var elem = event.target;
-
- // Swallow native change events from checkbox/radio, we already triggered them above
- if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
- return event.handleObj.handler.apply( this, arguments );
- }
- },
-
- teardown: function() {
- jQuery.event.remove( this, "._change" );
-
- return !rformElems.test( this.nodeName );
- }
- };
-}
-
-// Create "bubbling" focus and blur events
-if ( !support.focusinBubbles ) {
- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
- // Attach a single capturing handler on the document while someone wants focusin/focusout
- var handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
- };
-
- jQuery.event.special[ fix ] = {
- setup: function() {
- var doc = this.ownerDocument || this,
- attaches = jQuery._data( doc, fix );
-
- if ( !attaches ) {
- doc.addEventListener( orig, handler, true );
- }
- jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
- },
- teardown: function() {
- var doc = this.ownerDocument || this,
- attaches = jQuery._data( doc, fix ) - 1;
-
- if ( !attaches ) {
- doc.removeEventListener( orig, handler, true );
- jQuery._removeData( doc, fix );
- } else {
- jQuery._data( doc, fix, attaches );
- }
- }
- };
- });
-}
-
-jQuery.fn.extend({
-
- on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
- var type, origFn;
-
- // Types can be a map of types/handlers
- if ( typeof types === "object" ) {
- // ( types-Object, selector, data )
- if ( typeof selector !== "string" ) {
- // ( types-Object, data )
- data = data || selector;
- selector = undefined;
- }
- for ( type in types ) {
- this.on( type, selector, data, types[ type ], one );
- }
- return this;
- }
-
- if ( data == null && fn == null ) {
- // ( types, fn )
- fn = selector;
- data = selector = undefined;
- } else if ( fn == null ) {
- if ( typeof selector === "string" ) {
- // ( types, selector, fn )
- fn = data;
- data = undefined;
- } else {
- // ( types, data, fn )
- fn = data;
- data = selector;
- selector = undefined;
- }
- }
- if ( fn === false ) {
- fn = returnFalse;
- } else if ( !fn ) {
- return this;
- }
-
- if ( one === 1 ) {
- origFn = fn;
- fn = function( event ) {
- // Can use an empty set, since event contains the info
- jQuery().off( event );
- return origFn.apply( this, arguments );
- };
- // Use same guid so caller can remove using origFn
- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
- }
- return this.each( function() {
- jQuery.event.add( this, types, fn, data, selector );
- });
- },
- one: function( types, selector, data, fn ) {
- return this.on( types, selector, data, fn, 1 );
- },
- off: function( types, selector, fn ) {
- var handleObj, type;
- if ( types && types.preventDefault && types.handleObj ) {
- // ( event ) dispatched jQuery.Event
- handleObj = types.handleObj;
- jQuery( types.delegateTarget ).off(
- handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
- handleObj.selector,
- handleObj.handler
- );
- return this;
- }
- if ( typeof types === "object" ) {
- // ( types-object [, selector] )
- for ( type in types ) {
- this.off( type, selector, types[ type ] );
- }
- return this;
- }
- if ( selector === false || typeof selector === "function" ) {
- // ( types [, fn] )
- fn = selector;
- selector = undefined;
- }
- if ( fn === false ) {
- fn = returnFalse;
- }
- return this.each(function() {
- jQuery.event.remove( this, types, fn, selector );
- });
- },
-
- trigger: function( type, data ) {
- return this.each(function() {
- jQuery.event.trigger( type, data, this );
- });
- },
- triggerHandler: function( type, data ) {
- var elem = this[0];
- if ( elem ) {
- return jQuery.event.trigger( type, data, elem, true );
- }
- }
-});
-
-
-function createSafeFragment( document ) {
- var list = nodeNames.split( "|" ),
- safeFrag = document.createDocumentFragment();
-
- if ( safeFrag.createElement ) {
- while ( list.length ) {
- safeFrag.createElement(
- list.pop()
- );
- }
- }
- return safeFrag;
-}
-
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
- "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
- rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
- rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
- rleadingWhitespace = /^\s+/,
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
- rtagName = /<([\w:]+)/,
- rtbody = /<tbody/i,
- rhtml = /<|&#?\w+;/,
- rnoInnerhtml = /<(?:script|style|link)/i,
- // checked="checked" or checked
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- rscriptType = /^$|\/(?:java|ecma)script/i,
- rscriptTypeMasked = /^true\/(.*)/,
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
-
- // We have to close these tags to support XHTML (#13200)
- wrapMap = {
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
- legend: [ 1, "<fieldset>", "</fieldset>" ],
- area: [ 1, "<map>", "</map>" ],
- param: [ 1, "<object>", "</object>" ],
- thead: [ 1, "<table>", "</table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
-
- // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
- // unless wrapped in a div with non-breaking characters in front of it.
- _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
- },
- safeFragment = createSafeFragment( document ),
- fragmentDiv = safeFragment.appendChild( document.createElement("div") );
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-function getAll( context, tag ) {
- var elems, elem,
- i = 0,
- found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
- typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
- undefined;
-
- if ( !found ) {
- for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
- if ( !tag || jQuery.nodeName( elem, tag ) ) {
- found.push( elem );
- } else {
- jQuery.merge( found, getAll( elem, tag ) );
- }
- }
- }
-
- return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
- jQuery.merge( [ context ], found ) :
- found;
-}
-
-// Used in buildFragment, fixes the defaultChecked property
-function fixDefaultChecked( elem ) {
- if ( rcheckableType.test( elem.type ) ) {
- elem.defaultChecked = elem.checked;
- }
-}
-
-// Support: IE<8
-// Manipulating tables requires a tbody
-function manipulationTarget( elem, content ) {
- return jQuery.nodeName( elem, "table" ) &&
- jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
-
- elem.getElementsByTagName("tbody")[0] ||
- elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
- elem;
-}
-
-// Replace/restore the type attribute of script elements for safe DOM manipulation
-function disableScript( elem ) {
- elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
- return elem;
-}
-function restoreScript( elem ) {
- var match = rscriptTypeMasked.exec( elem.type );
- if ( match ) {
- elem.type = match[1];
- } else {
- elem.removeAttribute("type");
- }
- return elem;
-}
-
-// Mark scripts as having already been evaluated
-function setGlobalEval( elems, refElements ) {
- var elem,
- i = 0;
- for ( ; (elem = elems[i]) != null; i++ ) {
- jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
- }
-}
-
-function cloneCopyEvent( src, dest ) {
-
- if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
- return;
- }
-
- var type, i, l,
- oldData = jQuery._data( src ),
- curData = jQuery._data( dest, oldData ),
- events = oldData.events;
-
- if ( events ) {
- delete curData.handle;
- curData.events = {};
-
- for ( type in events ) {
- for ( i = 0, l = events[ type ].length; i < l; i++ ) {
- jQuery.event.add( dest, type, events[ type ][ i ] );
- }
- }
- }
-
- // make the cloned public data object a copy from the original
- if ( curData.data ) {
- curData.data = jQuery.extend( {}, curData.data );
- }
-}
-
-function fixCloneNodeIssues( src, dest ) {
- var nodeName, e, data;
-
- // We do not need to do anything for non-Elements
- if ( dest.nodeType !== 1 ) {
- return;
- }
-
- nodeName = dest.nodeName.toLowerCase();
-
- // IE6-8 copies events bound via attachEvent when using cloneNode.
- if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
- data = jQuery._data( dest );
-
- for ( e in data.events ) {
- jQuery.removeEvent( dest, e, data.handle );
- }
-
- // Event data gets referenced instead of copied if the expando gets copied too
- dest.removeAttribute( jQuery.expando );
- }
-
- // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
- if ( nodeName === "script" && dest.text !== src.text ) {
- disableScript( dest ).text = src.text;
- restoreScript( dest );
-
- // IE6-10 improperly clones children of object elements using classid.
- // IE10 throws NoModificationAllowedError if parent is null, #12132.
- } else if ( nodeName === "object" ) {
- if ( dest.parentNode ) {
- dest.outerHTML = src.outerHTML;
- }
-
- // This path appears unavoidable for IE9. When cloning an object
- // element in IE9, the outerHTML strategy above is not sufficient.
- // If the src has innerHTML and the destination does not,
- // copy the src.innerHTML into the dest.innerHTML. #10324
- if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
- dest.innerHTML = src.innerHTML;
- }
-
- } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
- // IE6-8 fails to persist the checked state of a cloned checkbox
- // or radio button. Worse, IE6-7 fail to give the cloned element
- // a checked appearance if the defaultChecked value isn't also set
-
- dest.defaultChecked = dest.checked = src.checked;
-
- // IE6-7 get confused and end up setting the value of a cloned
- // checkbox/radio button to an empty string instead of "on"
- if ( dest.value !== src.value ) {
- dest.value = src.value;
- }
-
- // IE6-8 fails to return the selected option to the default selected
- // state when cloning options
- } else if ( nodeName === "option" ) {
- dest.defaultSelected = dest.selected = src.defaultSelected;
-
- // IE6-8 fails to set the defaultValue to the correct value when
- // cloning other types of input fields
- } else if ( nodeName === "input" || nodeName === "textarea" ) {
- dest.defaultValue = src.defaultValue;
- }
-}
-
-jQuery.extend({
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
- var destElements, node, clone, i, srcElements,
- inPage = jQuery.contains( elem.ownerDocument, elem );
-
- if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
- clone = elem.cloneNode( true );
-
- // IE<=8 does not properly clone detached, unknown element nodes
- } else {
- fragmentDiv.innerHTML = elem.outerHTML;
- fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
- }
-
- if ( (!support.noCloneEvent || !support.noCloneChecked) &&
- (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
-
- // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
- destElements = getAll( clone );
- srcElements = getAll( elem );
-
- // Fix all IE cloning issues
- for ( i = 0; (node = srcElements[i]) != null; ++i ) {
- // Ensure that the destination node is not null; Fixes #9587
- if ( destElements[i] ) {
- fixCloneNodeIssues( node, destElements[i] );
- }
- }
- }
-
- // Copy the events from the original to the clone
- if ( dataAndEvents ) {
- if ( deepDataAndEvents ) {
- srcElements = srcElements || getAll( elem );
- destElements = destElements || getAll( clone );
-
- for ( i = 0; (node = srcElements[i]) != null; i++ ) {
- cloneCopyEvent( node, destElements[i] );
- }
- } else {
- cloneCopyEvent( elem, clone );
- }
- }
-
- // Preserve script evaluation history
- destElements = getAll( clone, "script" );
- if ( destElements.length > 0 ) {
- setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
- }
-
- destElements = srcElements = node = null;
-
- // Return the cloned set
- return clone;
- },
-
- buildFragment: function( elems, context, scripts, selection ) {
- var j, elem, contains,
- tmp, tag, tbody, wrap,
- l = elems.length,
-
- // Ensure a safe fragment
- safe = createSafeFragment( context ),
-
- nodes = [],
- i = 0;
-
- for ( ; i < l; i++ ) {
- elem = elems[ i ];
-
- if ( elem || elem === 0 ) {
-
- // Add nodes directly
- if ( jQuery.type( elem ) === "object" ) {
- jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
-
- // Convert non-html into a text node
- } else if ( !rhtml.test( elem ) ) {
- nodes.push( context.createTextNode( elem ) );
-
- // Convert html into DOM nodes
- } else {
- tmp = tmp || safe.appendChild( context.createElement("div") );
-
- // Deserialize a standard representation
- tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
- wrap = wrapMap[ tag ] || wrapMap._default;
-
- tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
-
- // Descend through wrappers to the right content
- j = wrap[0];
- while ( j-- ) {
- tmp = tmp.lastChild;
- }
-
- // Manually add leading whitespace removed by IE
- if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
- nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
- }
-
- // Remove IE's autoinserted <tbody> from table fragments
- if ( !support.tbody ) {
-
- // String was a <table>, *may* have spurious <tbody>
- elem = tag === "table" && !rtbody.test( elem ) ?
- tmp.firstChild :
-
- // String was a bare <thead> or <tfoot>
- wrap[1] === "<table>" && !rtbody.test( elem ) ?
- tmp :
- 0;
-
- j = elem && elem.childNodes.length;
- while ( j-- ) {
- if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
- elem.removeChild( tbody );
- }
- }
- }
-
- jQuery.merge( nodes, tmp.childNodes );
-
- // Fix #12392 for WebKit and IE > 9
- tmp.textContent = "";
-
- // Fix #12392 for oldIE
- while ( tmp.firstChild ) {
- tmp.removeChild( tmp.firstChild );
- }
-
- // Remember the top-level container for proper cleanup
- tmp = safe.lastChild;
- }
- }
- }
-
- // Fix #11356: Clear elements from fragment
- if ( tmp ) {
- safe.removeChild( tmp );
- }
-
- // Reset defaultChecked for any radios and checkboxes
- // about to be appended to the DOM in IE 6/7 (#8060)
- if ( !support.appendChecked ) {
- jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
- }
-
- i = 0;
- while ( (elem = nodes[ i++ ]) ) {
-
- // #4087 - If origin and destination elements are the same, and this is
- // that element, do not do anything
- if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
- continue;
- }
-
- contains = jQuery.contains( elem.ownerDocument, elem );
-
- // Append to fragment
- tmp = getAll( safe.appendChild( elem ), "script" );
-
- // Preserve script evaluation history
- if ( contains ) {
- setGlobalEval( tmp );
- }
-
- // Capture executables
- if ( scripts ) {
- j = 0;
- while ( (elem = tmp[ j++ ]) ) {
- if ( rscriptType.test( elem.type || "" ) ) {
- scripts.push( elem );
- }
- }
- }
- }
-
- tmp = null;
-
- return safe;
- },
-
- cleanData: function( elems, /* internal */ acceptData ) {
- var elem, type, id, data,
- i = 0,
- internalKey = jQuery.expando,
- cache = jQuery.cache,
- deleteExpando = support.deleteExpando,
- special = jQuery.event.special;
-
- for ( ; (elem = elems[i]) != null; i++ ) {
- if ( acceptData || jQuery.acceptData( elem ) ) {
-
- id = elem[ internalKey ];
- data = id && cache[ id ];
-
- if ( data ) {
- if ( data.events ) {
- for ( type in data.events ) {
- if ( special[ type ] ) {
- jQuery.event.remove( elem, type );
-
- // This is a shortcut to avoid jQuery.event.remove's overhead
- } else {
- jQuery.removeEvent( elem, type, data.handle );
- }
- }
- }
-
- // Remove cache only if it was not already removed by jQuery.event.remove
- if ( cache[ id ] ) {
-
- delete cache[ id ];
-
- // IE does not allow us to delete expando properties from nodes,
- // nor does it have a removeAttribute function on Document nodes;
- // we must handle all of these cases
- if ( deleteExpando ) {
- delete elem[ internalKey ];
-
- } else if ( typeof elem.removeAttribute !== strundefined ) {
- elem.removeAttribute( internalKey );
-
- } else {
- elem[ internalKey ] = null;
- }
-
- deletedIds.push( id );
- }
- }
- }
- }
- }
-});
-
-jQuery.fn.extend({
- text: function( value ) {
- return access( this, function( value ) {
- return value === undefined ?
- jQuery.text( this ) :
- this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
- }, null, value, arguments.length );
- },
-
- append: function() {
- return this.domManip( arguments, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- var target = manipulationTarget( this, elem );
- target.appendChild( elem );
- }
- });
- },
-
- prepend: function() {
- return this.domManip( arguments, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- var target = manipulationTarget( this, elem );
- target.insertBefore( elem, target.firstChild );
- }
- });
- },
-
- before: function() {
- return this.domManip( arguments, function( elem ) {
- if ( this.parentNode ) {
- this.parentNode.insertBefore( elem, this );
- }
- });
- },
-
- after: function() {
- return this.domManip( arguments, function( elem ) {
- if ( this.parentNode ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- }
- });
- },
-
- remove: function( selector, keepData /* Internal Use Only */ ) {
- var elem,
- elems = selector ? jQuery.filter( selector, this ) : this,
- i = 0;
-
- for ( ; (elem = elems[i]) != null; i++ ) {
-
- if ( !keepData && elem.nodeType === 1 ) {
- jQuery.cleanData( getAll( elem ) );
- }
-
- if ( elem.parentNode ) {
- if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
- setGlobalEval( getAll( elem, "script" ) );
- }
- elem.parentNode.removeChild( elem );
- }
- }
-
- return this;
- },
-
- empty: function() {
- var elem,
- i = 0;
-
- for ( ; (elem = this[i]) != null; i++ ) {
- // Remove element nodes and prevent memory leaks
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( getAll( elem, false ) );
- }
-
- // Remove any remaining nodes
- while ( elem.firstChild ) {
- elem.removeChild( elem.firstChild );
- }
-
- // If this is a select, ensure that it displays empty (#12336)
- // Support: IE<9
- if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
- elem.options.length = 0;
- }
- }
-
- return this;
- },
-
- clone: function( dataAndEvents, deepDataAndEvents ) {
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
- return this.map(function() {
- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
- });
- },
-
- html: function( value ) {
- return access( this, function( value ) {
- var elem = this[ 0 ] || {},
- i = 0,
- l = this.length;
-
- if ( value === undefined ) {
- return elem.nodeType === 1 ?
- elem.innerHTML.replace( rinlinejQuery, "" ) :
- undefined;
- }
-
- // See if we can take a shortcut and just use innerHTML
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
- ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
- ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
- !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
-
- value = value.replace( rxhtmlTag, "<$1></$2>" );
-
- try {
- for (; i < l; i++ ) {
- // Remove element nodes and prevent memory leaks
- elem = this[i] || {};
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( getAll( elem, false ) );
- elem.innerHTML = value;
- }
- }
-
- elem = 0;
-
- // If using innerHTML throws an exception, use the fallback method
- } catch(e) {}
- }
-
- if ( elem ) {
- this.empty().append( value );
- }
- }, null, value, arguments.length );
- },
-
- replaceWith: function() {
- var arg = arguments[ 0 ];
-
- // Make the changes, replacing each context element with the new content
- this.domManip( arguments, function( elem ) {
- arg = this.parentNode;
-
- jQuery.cleanData( getAll( this ) );
-
- if ( arg ) {
- arg.replaceChild( elem, this );
- }
- });
-
- // Force removal if there was no new content (e.g., from empty arguments)
- return arg && (arg.length || arg.nodeType) ? this : this.remove();
- },
-
- detach: function( selector ) {
- return this.remove( selector, true );
- },
-
- domManip: function( args, callback ) {
-
- // Flatten any nested arrays
- args = concat.apply( [], args );
-
- var first, node, hasScripts,
- scripts, doc, fragment,
- i = 0,
- l = this.length,
- set = this,
- iNoClone = l - 1,
- value = args[0],
- isFunction = jQuery.isFunction( value );
-
- // We can't cloneNode fragments that contain checked, in WebKit
- if ( isFunction ||
- ( l > 1 && typeof value === "string" &&
- !support.checkClone && rchecked.test( value ) ) ) {
- return this.each(function( index ) {
- var self = set.eq( index );
- if ( isFunction ) {
- args[0] = value.call( this, index, self.html() );
- }
- self.domManip( args, callback );
- });
- }
-
- if ( l ) {
- fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
- first = fragment.firstChild;
-
- if ( fragment.childNodes.length === 1 ) {
- fragment = first;
- }
-
- if ( first ) {
- scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
- hasScripts = scripts.length;
-
- // Use the original fragment for the last item instead of the first because it can end up
- // being emptied incorrectly in certain situations (#8070).
- for ( ; i < l; i++ ) {
- node = fragment;
-
- if ( i !== iNoClone ) {
- node = jQuery.clone( node, true, true );
-
- // Keep references to cloned scripts for later restoration
- if ( hasScripts ) {
- jQuery.merge( scripts, getAll( node, "script" ) );
- }
- }
-
- callback.call( this[i], node, i );
- }
-
- if ( hasScripts ) {
- doc = scripts[ scripts.length - 1 ].ownerDocument;
-
- // Reenable scripts
- jQuery.map( scripts, restoreScript );
-
- // Evaluate executable scripts on first document insertion
- for ( i = 0; i < hasScripts; i++ ) {
- node = scripts[ i ];
- if ( rscriptType.test( node.type || "" ) &&
- !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
-
- if ( node.src ) {
- // Optional AJAX dependency, but won't run scripts if not present
- if ( jQuery._evalUrl ) {
- jQuery._evalUrl( node.src );
- }
- } else {
- jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
- }
- }
- }
- }
-
- // Fix #11809: Avoid leaking memory
- fragment = first = null;
- }
- }
-
- return this;
- }
-});
-
-jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
-}, function( name, original ) {
- jQuery.fn[ name ] = function( selector ) {
- var elems,
- i = 0,
- ret = [],
- insert = jQuery( selector ),
- last = insert.length - 1;
-
- for ( ; i <= last; i++ ) {
- elems = i === last ? this : this.clone(true);
- jQuery( insert[i] )[ original ]( elems );
-
- // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
- push.apply( ret, elems.get() );
- }
-
- return this.pushStack( ret );
- };
-});
-
-
-var iframe,
- elemdisplay = {};
-
-/**
- * Retrieve the actual display of a element
- * @param {String} name nodeName of the element
- * @param {Object} doc Document object
- */
-// Called only from within defaultDisplay
-function actualDisplay( name, doc ) {
- var style,
- elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
-
- // getDefaultComputedStyle might be reliably used only on attached element
- display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
-
- // Use of this method is a temporary fix (more like optmization) until something better comes along,
- // since it was removed from specification and supported only in FF
- style.display : jQuery.css( elem[ 0 ], "display" );
-
- // We don't have any data stored on the element,
- // so use "detach" method as fast way to get rid of the element
- elem.detach();
-
- return display;
-}
-
-/**
- * Try to determine the default display value of an element
- * @param {String} nodeName
- */
-function defaultDisplay( nodeName ) {
- var doc = document,
- display = elemdisplay[ nodeName ];
-
- if ( !display ) {
- display = actualDisplay( nodeName, doc );
-
- // If the simple way fails, read from inside an iframe
- if ( display === "none" || !display ) {
-
- // Use the already-created iframe if possible
- iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
-
- // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
- doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
-
- // Support: IE
- doc.write();
- doc.close();
-
- display = actualDisplay( nodeName, doc );
- iframe.detach();
- }
-
- // Store the correct default display
- elemdisplay[ nodeName ] = display;
- }
-
- return display;
-}
-
-
-(function() {
- var shrinkWrapBlocksVal;
-
- support.shrinkWrapBlocks = function() {
- if ( shrinkWrapBlocksVal != null ) {
- return shrinkWrapBlocksVal;
- }
-
- // Will be changed later if needed.
- shrinkWrapBlocksVal = false;
-
- // Minified: var b,c,d
- var div, body, container;
-
- body = document.getElementsByTagName( "body" )[ 0 ];
- if ( !body || !body.style ) {
- // Test fired too early or in an unsupported environment, exit.
- return;
- }
-
- // Setup
- div = document.createElement( "div" );
- container = document.createElement( "div" );
- container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
- body.appendChild( container ).appendChild( div );
-
- // Support: IE6
- // Check if elements with layout shrink-wrap their children
- if ( typeof div.style.zoom !== strundefined ) {
- // Reset CSS: box-sizing; display; margin; border
- div.style.cssText =
- // Support: Firefox<29, Android 2.3
- // Vendor-prefix box-sizing
- "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
- "box-sizing:content-box;display:block;margin:0;border:0;" +
- "padding:1px;width:1px;zoom:1";
- div.appendChild( document.createElement( "div" ) ).style.width = "5px";
- shrinkWrapBlocksVal = div.offsetWidth !== 3;
- }
-
- body.removeChild( container );
-
- return shrinkWrapBlocksVal;
- };
-
-})();
-var rmargin = (/^margin/);
-
-var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
-
-
-
-var getStyles, curCSS,
- rposition = /^(top|right|bottom|left)$/;
-
-if ( window.getComputedStyle ) {
- getStyles = function( elem ) {
- // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
- // IE throws on elements created in popups
- // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
- if ( elem.ownerDocument.defaultView.opener ) {
- return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
- }
-
- return window.getComputedStyle( elem, null );
- };
-
- curCSS = function( elem, name, computed ) {
- var width, minWidth, maxWidth, ret,
- style = elem.style;
-
- computed = computed || getStyles( elem );
-
- // getPropertyValue is only needed for .css('filter') in IE9, see #12537
- ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
-
- if ( computed ) {
-
- if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
- ret = jQuery.style( elem, name );
- }
-
- // A tribute to the "awesome hack by Dean Edwards"
- // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
- // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
- // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
- if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
-
- // Remember the original values
- width = style.width;
- minWidth = style.minWidth;
- maxWidth = style.maxWidth;
-
- // Put in the new values to get a computed value out
- style.minWidth = style.maxWidth = style.width = ret;
- ret = computed.width;
-
- // Revert the changed values
- style.width = width;
- style.minWidth = minWidth;
- style.maxWidth = maxWidth;
- }
- }
-
- // Support: IE
- // IE returns zIndex value as an integer.
- return ret === undefined ?
- ret :
- ret + "";
- };
-} else if ( document.documentElement.currentStyle ) {
- getStyles = function( elem ) {
- return elem.currentStyle;
- };
-
- curCSS = function( elem, name, computed ) {
- var left, rs, rsLeft, ret,
- style = elem.style;
-
- computed = computed || getStyles( elem );
- ret = computed ? computed[ name ] : undefined;
-
- // Avoid setting ret to empty string here
- // so we don't default to auto
- if ( ret == null && style && style[ name ] ) {
- ret = style[ name ];
- }
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- // but not position css attributes, as those are proportional to the parent element instead
- // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
- if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
-
- // Remember the original values
- left = style.left;
- rs = elem.runtimeStyle;
- rsLeft = rs && rs.left;
-
- // Put in the new values to get a computed value out
- if ( rsLeft ) {
- rs.left = elem.currentStyle.left;
- }
- style.left = name === "fontSize" ? "1em" : ret;
- ret = style.pixelLeft + "px";
-
- // Revert the changed values
- style.left = left;
- if ( rsLeft ) {
- rs.left = rsLeft;
- }
- }
-
- // Support: IE
- // IE returns zIndex value as an integer.
- return ret === undefined ?
- ret :
- ret + "" || "auto";
- };
-}
-
-
-
-
-function addGetHookIf( conditionFn, hookFn ) {
- // Define the hook, we'll check on the first run if it's really needed.
- return {
- get: function() {
- var condition = conditionFn();
-
- if ( condition == null ) {
- // The test was not ready at this point; screw the hook this time
- // but check again when needed next time.
- return;
- }
-
- if ( condition ) {
- // Hook not needed (or it's not possible to use it due to missing dependency),
- // remove it.
- // Since there are no other hooks for marginRight, remove the whole object.
- delete this.get;
- return;
- }
-
- // Hook needed; redefine it so that the support test is not executed again.
-
- return (this.get = hookFn).apply( this, arguments );
- }
- };
-}
-
-
-(function() {
- // Minified: var b,c,d,e,f,g, h,i
- var div, style, a, pixelPositionVal, boxSizingReliableVal,
- reliableHiddenOffsetsVal, reliableMarginRightVal;
-
- // Setup
- div = document.createElement( "div" );
- div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
- a = div.getElementsByTagName( "a" )[ 0 ];
- style = a && a.style;
-
- // Finish early in limited (non-browser) environments
- if ( !style ) {
- return;
- }
-
- style.cssText = "float:left;opacity:.5";
-
- // Support: IE<9
- // Make sure that element opacity exists (as opposed to filter)
- support.opacity = style.opacity === "0.5";
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- support.cssFloat = !!style.cssFloat;
-
- div.style.backgroundClip = "content-box";
- div.cloneNode( true ).style.backgroundClip = "";
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
- // Support: Firefox<29, Android 2.3
- // Vendor-prefix box-sizing
- support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
- style.WebkitBoxSizing === "";
-
- jQuery.extend(support, {
- reliableHiddenOffsets: function() {
- if ( reliableHiddenOffsetsVal == null ) {
- computeStyleTests();
- }
- return reliableHiddenOffsetsVal;
- },
-
- boxSizingReliable: function() {
- if ( boxSizingReliableVal == null ) {
- computeStyleTests();
- }
- return boxSizingReliableVal;
- },
-
- pixelPosition: function() {
- if ( pixelPositionVal == null ) {
- computeStyleTests();
- }
- return pixelPositionVal;
- },
-
- // Support: Android 2.3
- reliableMarginRight: function() {
- if ( reliableMarginRightVal == null ) {
- computeStyleTests();
- }
- return reliableMarginRightVal;
- }
- });
-
- function computeStyleTests() {
- // Minified: var b,c,d,j
- var div, body, container, contents;
-
- body = document.getElementsByTagName( "body" )[ 0 ];
- if ( !body || !body.style ) {
- // Test fired too early or in an unsupported environment, exit.
- return;
- }
-
- // Setup
- div = document.createElement( "div" );
- container = document.createElement( "div" );
- container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
- body.appendChild( container ).appendChild( div );
-
- div.style.cssText =
- // Support: Firefox<29, Android 2.3
- // Vendor-prefix box-sizing
- "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
- "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
- "border:1px;padding:1px;width:4px;position:absolute";
-
- // Support: IE<9
- // Assume reasonable values in the absence of getComputedStyle
- pixelPositionVal = boxSizingReliableVal = false;
- reliableMarginRightVal = true;
-
- // Check for getComputedStyle so that this code is not run in IE<9.
- if ( window.getComputedStyle ) {
- pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
- boxSizingReliableVal =
- ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
-
- // Support: Android 2.3
- // Div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container (#3333)
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- contents = div.appendChild( document.createElement( "div" ) );
-
- // Reset CSS: box-sizing; display; margin; border; padding
- contents.style.cssText = div.style.cssText =
- // Support: Firefox<29, Android 2.3
- // Vendor-prefix box-sizing
- "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
- "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
- contents.style.marginRight = contents.style.width = "0";
- div.style.width = "1px";
-
- reliableMarginRightVal =
- !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
-
- div.removeChild( contents );
- }
-
- // Support: IE8
- // Check if table cells still have offsetWidth/Height when they are set
- // to display:none and there are still other visible table cells in a
- // table row; if so, offsetWidth/Height are not reliable for use when
- // determining if an element has been hidden directly using
- // display:none (it is still safe to use offsets if a parent element is
- // hidden; don safety goggles and see bug #4512 for more information).
- div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
- contents = div.getElementsByTagName( "td" );
- contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
- reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
- if ( reliableHiddenOffsetsVal ) {
- contents[ 0 ].style.display = "";
- contents[ 1 ].style.display = "none";
- reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
- }
-
- body.removeChild( container );
- }
-
-})();
-
-
-// A method for quickly swapping in/out CSS properties to get correct calculations.
-jQuery.swap = function( elem, options, callback, args ) {
- var ret, name,
- old = {};
-
- // Remember the old values, and insert the new ones
- for ( name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- ret = callback.apply( elem, args || [] );
-
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
-
- return ret;
-};
-
-
-var
- ralpha = /alpha\([^)]*\)/i,
- ropacity = /opacity\s*=\s*([^)]*)/,
-
- // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
- // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
- rdisplayswap = /^(none|table(?!-c[ea]).+)/,
- rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
- rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
-
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
- cssNormalTransform = {
- letterSpacing: "0",
- fontWeight: "400"
- },
-
- cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
-
-
-// return a css property mapped to a potentially vendor prefixed property
-function vendorPropName( style, name ) {
-
- // shortcut for names that are not vendor prefixed
- if ( name in style ) {
- return name;
- }
-
- // check for vendor prefixed names
- var capName = name.charAt(0).toUpperCase() + name.slice(1),
- origName = name,
- i = cssPrefixes.length;
-
- while ( i-- ) {
- name = cssPrefixes[ i ] + capName;
- if ( name in style ) {
- return name;
- }
- }
-
- return origName;
-}
-
-function showHide( elements, show ) {
- var display, elem, hidden,
- values = [],
- index = 0,
- length = elements.length;
-
- for ( ; index < length; index++ ) {
- elem = elements[ index ];
- if ( !elem.style ) {
- continue;
- }
-
- values[ index ] = jQuery._data( elem, "olddisplay" );
- display = elem.style.display;
- if ( show ) {
- // Reset the inline display of this element to learn if it is
- // being hidden by cascaded rules or not
- if ( !values[ index ] && display === "none" ) {
- elem.style.display = "";
- }
-
- // Set elements which have been overridden with display: none
- // in a stylesheet to whatever the default browser style is
- // for such an element
- if ( elem.style.display === "" && isHidden( elem ) ) {
- values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
- }
- } else {
- hidden = isHidden( elem );
-
- if ( display && display !== "none" || !hidden ) {
- jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
- }
- }
- }
-
- // Set the display of most of the elements in a second loop
- // to avoid the constant reflow
- for ( index = 0; index < length; index++ ) {
- elem = elements[ index ];
- if ( !elem.style ) {
- continue;
- }
- if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
- elem.style.display = show ? values[ index ] || "" : "none";
- }
- }
-
- return elements;
-}
-
-function setPositiveNumber( elem, value, subtract ) {
- var matches = rnumsplit.exec( value );
- return matches ?
- // Guard against undefined "subtract", e.g., when used as in cssHooks
- Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
- value;
-}
-
-function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
- var i = extra === ( isBorderBox ? "border" : "content" ) ?
- // If we already have the right measurement, avoid augmentation
- 4 :
- // Otherwise initialize for horizontal or vertical properties
- name === "width" ? 1 : 0,
-
- val = 0;
-
- for ( ; i < 4; i += 2 ) {
- // both box models exclude margin, so add it if we want it
- if ( extra === "margin" ) {
- val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
- }
-
- if ( isBorderBox ) {
- // border-box includes padding, so remove it if we want content
- if ( extra === "content" ) {
- val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
- }
-
- // at this point, extra isn't border nor margin, so remove border
- if ( extra !== "margin" ) {
- val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
- }
- } else {
- // at this point, extra isn't content, so add padding
- val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-
- // at this point, extra isn't content nor padding, so add border
- if ( extra !== "padding" ) {
- val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
- }
- }
- }
-
- return val;
-}
-
-function getWidthOrHeight( elem, name, extra ) {
-
- // Start with offset property, which is equivalent to the border-box value
- var valueIsBorderBox = true,
- val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
- styles = getStyles( elem ),
- isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
-
- // some non-html elements return undefined for offsetWidth, so check for null/undefined
- // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
- // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
- if ( val <= 0 || val == null ) {
- // Fall back to computed then uncomputed css if necessary
- val = curCSS( elem, name, styles );
- if ( val < 0 || val == null ) {
- val = elem.style[ name ];
- }
-
- // Computed unit is not pixels. Stop here and return.
- if ( rnumnonpx.test(val) ) {
- return val;
- }
-
- // we need the check for style in case a browser which returns unreliable values
- // for getComputedStyle silently falls back to the reliable elem.style
- valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
-
- // Normalize "", auto, and prepare for extra
- val = parseFloat( val ) || 0;
- }
-
- // use the active box-sizing model to add/subtract irrelevant styles
- return ( val +
- augmentWidthOrHeight(
- elem,
- name,
- extra || ( isBorderBox ? "border" : "content" ),
- valueIsBorderBox,
- styles
- )
- ) + "px";
-}
-
-jQuery.extend({
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function( elem, computed ) {
- if ( computed ) {
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity" );
- return ret === "" ? "1" : ret;
- }
- }
- }
- },
-
- // Don't automatically add "px" to these possibly-unitless properties
- cssNumber: {
- "columnCount": true,
- "fillOpacity": true,
- "flexGrow": true,
- "flexShrink": true,
- "fontWeight": true,
- "lineHeight": true,
- "opacity": true,
- "order": true,
- "orphans": true,
- "widows": true,
- "zIndex": true,
- "zoom": true
- },
-
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {
- // normalize float css property
- "float": support.cssFloat ? "cssFloat" : "styleFloat"
- },
-
- // Get and set the style property on a DOM Node
- style: function( elem, name, value, extra ) {
- // Don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
- return;
- }
-
- // Make sure that we're working with the right name
- var ret, type, hooks,
- origName = jQuery.camelCase( name ),
- style = elem.style;
-
- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
-
- // gets hook for the prefixed version
- // followed by the unprefixed version
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // Check if we're setting a value
- if ( value !== undefined ) {
- type = typeof value;
-
- // convert relative number strings (+= or -=) to relative numbers. #7345
- if ( type === "string" && (ret = rrelNum.exec( value )) ) {
- value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
- // Fixes bug #9237
- type = "number";
- }
-
- // Make sure that null and NaN values aren't set. See: #7116
- if ( value == null || value !== value ) {
- return;
- }
-
- // If a number was passed in, add 'px' to the (except for certain CSS properties)
- if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
- value += "px";
- }
-
- // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
- // but it would mean to define eight (for every problematic property) identical functions
- if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
- style[ name ] = "inherit";
- }
-
- // If a hook was provided, use that value, otherwise just set the specified value
- if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
-
- // Support: IE
- // Swallow errors from 'invalid' CSS values (#5509)
- try {
- style[ name ] = value;
- } catch(e) {}
- }
-
- } else {
- // If a hook was provided get the non-computed value from there
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
- return ret;
- }
-
- // Otherwise just get the value from the style object
- return style[ name ];
- }
- },
-
- css: function( elem, name, extra, styles ) {
- var num, val, hooks,
- origName = jQuery.camelCase( name );
-
- // Make sure that we're working with the right name
- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
-
- // gets hook for the prefixed version
- // followed by the unprefixed version
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // If a hook was provided get the computed value from there
- if ( hooks && "get" in hooks ) {
- val = hooks.get( elem, true, extra );
- }
-
- // Otherwise, if a way to get the computed value exists, use that
- if ( val === undefined ) {
- val = curCSS( elem, name, styles );
- }
-
- //convert "normal" to computed value
- if ( val === "normal" && name in cssNormalTransform ) {
- val = cssNormalTransform[ name ];
- }
-
- // Return, converting to number if forced or a qualifier was provided and val looks numeric
- if ( extra === "" || extra ) {
- num = parseFloat( val );
- return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
- }
- return val;
- }
-});
-
-jQuery.each([ "height", "width" ], function( i, name ) {
- jQuery.cssHooks[ name ] = {
- get: function( elem, computed, extra ) {
- if ( computed ) {
- // certain elements can have dimension info if we invisibly show them
- // however, it must have a current display style that would benefit from this
- return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
- jQuery.swap( elem, cssShow, function() {
- return getWidthOrHeight( elem, name, extra );
- }) :
- getWidthOrHeight( elem, name, extra );
- }
- },
-
- set: function( elem, value, extra ) {
- var styles = extra && getStyles( elem );
- return setPositiveNumber( elem, value, extra ?
- augmentWidthOrHeight(
- elem,
- name,
- extra,
- support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
- styles
- ) : 0
- );
- }
- };
-});
-
-if ( !support.opacity ) {
- jQuery.cssHooks.opacity = {
- get: function( elem, computed ) {
- // IE uses filters for opacity
- return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
- ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
- computed ? "1" : "";
- },
-
- set: function( elem, value ) {
- var style = elem.style,
- currentStyle = elem.currentStyle,
- opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
- filter = currentStyle && currentStyle.filter || style.filter || "";
-
- // IE has trouble with opacity if it does not have layout
- // Force it by setting the zoom level
- style.zoom = 1;
-
- // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
- // if value === "", then remove inline opacity #12685
- if ( ( value >= 1 || value === "" ) &&
- jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
- style.removeAttribute ) {
-
- // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
- // if "filter:" is present at all, clearType is disabled, we want to avoid this
- // style.removeAttribute is IE Only, but so apparently is this code path...
- style.removeAttribute( "filter" );
-
- // if there is no filter style applied in a css rule or unset inline opacity, we are done
- if ( value === "" || currentStyle && !currentStyle.filter ) {
- return;
- }
- }
-
- // otherwise, set new filter values
- style.filter = ralpha.test( filter ) ?
- filter.replace( ralpha, opacity ) :
- filter + " " + opacity;
- }
- };
-}
-
-jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
- function( elem, computed ) {
- if ( computed ) {
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- // Work around by temporarily setting element display to inline-block
- return jQuery.swap( elem, { "display": "inline-block" },
- curCSS, [ elem, "marginRight" ] );
- }
- }
-);
-
-// These hooks are used by animate to expand properties
-jQuery.each({
- margin: "",
- padding: "",
- border: "Width"
-}, function( prefix, suffix ) {
- jQuery.cssHooks[ prefix + suffix ] = {
- expand: function( value ) {
- var i = 0,
- expanded = {},
-
- // assumes a single number if not a string
- parts = typeof value === "string" ? value.split(" ") : [ value ];
-
- for ( ; i < 4; i++ ) {
- expanded[ prefix + cssExpand[ i ] + suffix ] =
- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
- }
-
- return expanded;
- }
- };
-
- if ( !rmargin.test( prefix ) ) {
- jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
- }
-});
-
-jQuery.fn.extend({
- css: function( name, value ) {
- return access( this, function( elem, name, value ) {
- var styles, len,
- map = {},
- i = 0;
-
- if ( jQuery.isArray( name ) ) {
- styles = getStyles( elem );
- len = name.length;
-
- for ( ; i < len; i++ ) {
- map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
- }
-
- return map;
- }
-
- return value !== undefined ?
- jQuery.style( elem, name, value ) :
- jQuery.css( elem, name );
- }, name, value, arguments.length > 1 );
- },
- show: function() {
- return showHide( this, true );
- },
- hide: function() {
- return showHide( this );
- },
- toggle: function( state ) {
- if ( typeof state === "boolean" ) {
- return state ? this.show() : this.hide();
- }
-
- return this.each(function() {
- if ( isHidden( this ) ) {
- jQuery( this ).show();
- } else {
- jQuery( this ).hide();
- }
- });
- }
-});
-
-
-function Tween( elem, options, prop, end, easing ) {
- return new Tween.prototype.init( elem, options, prop, end, easing );
-}
-jQuery.Tween = Tween;
-
-Tween.prototype = {
- constructor: Tween,
- init: function( elem, options, prop, end, easing, unit ) {
- this.elem = elem;
- this.prop = prop;
- this.easing = easing || "swing";
- this.options = options;
- this.start = this.now = this.cur();
- this.end = end;
- this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
- },
- cur: function() {
- var hooks = Tween.propHooks[ this.prop ];
-
- return hooks && hooks.get ?
- hooks.get( this ) :
- Tween.propHooks._default.get( this );
- },
- run: function( percent ) {
- var eased,
- hooks = Tween.propHooks[ this.prop ];
-
- if ( this.options.duration ) {
- this.pos = eased = jQuery.easing[ this.easing ](
- percent, this.options.duration * percent, 0, 1, this.options.duration
- );
- } else {
- this.pos = eased = percent;
- }
- this.now = ( this.end - this.start ) * eased + this.start;
-
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- if ( hooks && hooks.set ) {
- hooks.set( this );
- } else {
- Tween.propHooks._default.set( this );
- }
- return this;
- }
-};
-
-Tween.prototype.init.prototype = Tween.prototype;
-
-Tween.propHooks = {
- _default: {
- get: function( tween ) {
- var result;
-
- if ( tween.elem[ tween.prop ] != null &&
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
- return tween.elem[ tween.prop ];
- }
-
- // passing an empty string as a 3rd parameter to .css will automatically
- // attempt a parseFloat and fallback to a string if the parse fails
- // so, simple values such as "10px" are parsed to Float.
- // complex values such as "rotate(1rad)" are returned as is.
- result = jQuery.css( tween.elem, tween.prop, "" );
- // Empty strings, null, undefined and "auto" are converted to 0.
- return !result || result === "auto" ? 0 : result;
- },
- set: function( tween ) {
- // use step hook for back compat - use cssHook if its there - use .style if its
- // available and use plain properties where available
- if ( jQuery.fx.step[ tween.prop ] ) {
- jQuery.fx.step[ tween.prop ]( tween );
- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
- } else {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
- }
-};
-
-// Support: IE <=9
-// Panic based approach to setting things on disconnected nodes
-
-Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- set: function( tween ) {
- if ( tween.elem.nodeType && tween.elem.parentNode ) {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
-};
-
-jQuery.easing = {
- linear: function( p ) {
- return p;
- },
- swing: function( p ) {
- return 0.5 - Math.cos( p * Math.PI ) / 2;
- }
-};
-
-jQuery.fx = Tween.prototype.init;
-
-// Back Compat <1.8 extension point
-jQuery.fx.step = {};
-
-
-
-
-var
- fxNow, timerId,
- rfxtypes = /^(?:toggle|show|hide)$/,
- rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
- rrun = /queueHooks$/,
- animationPrefilters = [ defaultPrefilter ],
- tweeners = {
- "*": [ function( prop, value ) {
- var tween = this.createTween( prop, value ),
- target = tween.cur(),
- parts = rfxnum.exec( value ),
- unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
-
- // Starting value computation is required for potential unit mismatches
- start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
- rfxnum.exec( jQuery.css( tween.elem, prop ) ),
- scale = 1,
- maxIterations = 20;
-
- if ( start && start[ 3 ] !== unit ) {
- // Trust units reported by jQuery.css
- unit = unit || start[ 3 ];
-
- // Make sure we update the tween properties later on
- parts = parts || [];
-
- // Iteratively approximate from a nonzero starting point
- start = +target || 1;
-
- do {
- // If previous iteration zeroed out, double until we get *something*
- // Use a string for doubling factor so we don't accidentally see scale as unchanged below
- scale = scale || ".5";
-
- // Adjust and apply
- start = start / scale;
- jQuery.style( tween.elem, prop, start + unit );
-
- // Update scale, tolerating zero or NaN from tween.cur()
- // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
- } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
- }
-
- // Update tween properties
- if ( parts ) {
- start = tween.start = +start || +target || 0;
- tween.unit = unit;
- // If a +=/-= token was provided, we're doing a relative animation
- tween.end = parts[ 1 ] ?
- start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
- +parts[ 2 ];
- }
-
- return tween;
- } ]
- };
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
- setTimeout(function() {
- fxNow = undefined;
- });
- return ( fxNow = jQuery.now() );
-}
-
-// Generate parameters to create a standard animation
-function genFx( type, includeWidth ) {
- var which,
- attrs = { height: type },
- i = 0;
-
- // if we include width, step value is 1 to do all cssExpand values,
- // if we don't include width, step value is 2 to skip over Left and Right
- includeWidth = includeWidth ? 1 : 0;
- for ( ; i < 4 ; i += 2 - includeWidth ) {
- which = cssExpand[ i ];
- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
- }
-
- if ( includeWidth ) {
- attrs.opacity = attrs.width = type;
- }
-
- return attrs;
-}
-
-function createTween( value, prop, animation ) {
- var tween,
- collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
- index = 0,
- length = collection.length;
- for ( ; index < length; index++ ) {
- if ( (tween = collection[ index ].call( animation, prop, value )) ) {
-
- // we're done with this property
- return tween;
- }
- }
-}
-
-function defaultPrefilter( elem, props, opts ) {
- /* jshint validthis: true */
- var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
- anim = this,
- orig = {},
- style = elem.style,
- hidden = elem.nodeType && isHidden( elem ),
- dataShow = jQuery._data( elem, "fxshow" );
-
- // handle queue: false promises
- if ( !opts.queue ) {
- hooks = jQuery._queueHooks( elem, "fx" );
- if ( hooks.unqueued == null ) {
- hooks.unqueued = 0;
- oldfire = hooks.empty.fire;
- hooks.empty.fire = function() {
- if ( !hooks.unqueued ) {
- oldfire();
- }
- };
- }
- hooks.unqueued++;
-
- anim.always(function() {
- // doing this makes sure that the complete handler will be called
- // before this completes
- anim.always(function() {
- hooks.unqueued--;
- if ( !jQuery.queue( elem, "fx" ).length ) {
- hooks.empty.fire();
- }
- });
- });
- }
-
- // height/width overflow pass
- if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
- // Make sure that nothing sneaks out
- // Record all 3 overflow attributes because IE does not
- // change the overflow attribute when overflowX and
- // overflowY are set to the same value
- opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-
- // Set display property to inline-block for height/width
- // animations on inline elements that are having width/height animated
- display = jQuery.css( elem, "display" );
-
- // Test default display if display is currently "none"
- checkDisplay = display === "none" ?
- jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
-
- if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
-
- // inline-level elements accept inline-block;
- // block-level elements need to be inline with layout
- if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
- style.display = "inline-block";
- } else {
- style.zoom = 1;
- }
- }
- }
-
- if ( opts.overflow ) {
- style.overflow = "hidden";
- if ( !support.shrinkWrapBlocks() ) {
- anim.always(function() {
- style.overflow = opts.overflow[ 0 ];
- style.overflowX = opts.overflow[ 1 ];
- style.overflowY = opts.overflow[ 2 ];
- });
- }
- }
-
- // show/hide pass
- for ( prop in props ) {
- value = props[ prop ];
- if ( rfxtypes.exec( value ) ) {
- delete props[ prop ];
- toggle = toggle || value === "toggle";
- if ( value === ( hidden ? "hide" : "show" ) ) {
-
- // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
- if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
- hidden = true;
- } else {
- continue;
- }
- }
- orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
-
- // Any non-fx value stops us from restoring the original display value
- } else {
- display = undefined;
- }
- }
-
- if ( !jQuery.isEmptyObject( orig ) ) {
- if ( dataShow ) {
- if ( "hidden" in dataShow ) {
- hidden = dataShow.hidden;
- }
- } else {
- dataShow = jQuery._data( elem, "fxshow", {} );
- }
-
- // store state if its toggle - enables .stop().toggle() to "reverse"
- if ( toggle ) {
- dataShow.hidden = !hidden;
- }
- if ( hidden ) {
- jQuery( elem ).show();
- } else {
- anim.done(function() {
- jQuery( elem ).hide();
- });
- }
- anim.done(function() {
- var prop;
- jQuery._removeData( elem, "fxshow" );
- for ( prop in orig ) {
- jQuery.style( elem, prop, orig[ prop ] );
- }
- });
- for ( prop in orig ) {
- tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
-
- if ( !( prop in dataShow ) ) {
- dataShow[ prop ] = tween.start;
- if ( hidden ) {
- tween.end = tween.start;
- tween.start = prop === "width" || prop === "height" ? 1 : 0;
- }
- }
- }
-
- // If this is a noop like .hide().hide(), restore an overwritten display value
- } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
- style.display = display;
- }
-}
-
-function propFilter( props, specialEasing ) {
- var index, name, easing, value, hooks;
-
- // camelCase, specialEasing and expand cssHook pass
- for ( index in props ) {
- name = jQuery.camelCase( index );
- easing = specialEasing[ name ];
- value = props[ index ];
- if ( jQuery.isArray( value ) ) {
- easing = value[ 1 ];
- value = props[ index ] = value[ 0 ];
- }
-
- if ( index !== name ) {
- props[ name ] = value;
- delete props[ index ];
- }
-
- hooks = jQuery.cssHooks[ name ];
- if ( hooks && "expand" in hooks ) {
- value = hooks.expand( value );
- delete props[ name ];
-
- // not quite $.extend, this wont overwrite keys already present.
- // also - reusing 'index' from above because we have the correct "name"
- for ( index in value ) {
- if ( !( index in props ) ) {
- props[ index ] = value[ index ];
- specialEasing[ index ] = easing;
- }
- }
- } else {
- specialEasing[ name ] = easing;
- }
- }
-}
-
-function Animation( elem, properties, options ) {
- var result,
- stopped,
- index = 0,
- length = animationPrefilters.length,
- deferred = jQuery.Deferred().always( function() {
- // don't match elem in the :animated selector
- delete tick.elem;
- }),
- tick = function() {
- if ( stopped ) {
- return false;
- }
- var currentTime = fxNow || createFxNow(),
- remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
- // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
- temp = remaining / animation.duration || 0,
- percent = 1 - temp,
- index = 0,
- length = animation.tweens.length;
-
- for ( ; index < length ; index++ ) {
- animation.tweens[ index ].run( percent );
- }
-
- deferred.notifyWith( elem, [ animation, percent, remaining ]);
-
- if ( percent < 1 && length ) {
- return remaining;
- } else {
- deferred.resolveWith( elem, [ animation ] );
- return false;
- }
- },
- animation = deferred.promise({
- elem: elem,
- props: jQuery.extend( {}, properties ),
- opts: jQuery.extend( true, { specialEasing: {} }, options ),
- originalProperties: properties,
- originalOptions: options,
- startTime: fxNow || createFxNow(),
- duration: options.duration,
- tweens: [],
- createTween: function( prop, end ) {
- var tween = jQuery.Tween( elem, animation.opts, prop, end,
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
- animation.tweens.push( tween );
- return tween;
- },
- stop: function( gotoEnd ) {
- var index = 0,
- // if we are going to the end, we want to run all the tweens
- // otherwise we skip this part
- length = gotoEnd ? animation.tweens.length : 0;
- if ( stopped ) {
- return this;
- }
- stopped = true;
- for ( ; index < length ; index++ ) {
- animation.tweens[ index ].run( 1 );
- }
-
- // resolve when we played the last frame
- // otherwise, reject
- if ( gotoEnd ) {
- deferred.resolveWith( elem, [ animation, gotoEnd ] );
- } else {
- deferred.rejectWith( elem, [ animation, gotoEnd ] );
- }
- return this;
- }
- }),
- props = animation.props;
-
- propFilter( props, animation.opts.specialEasing );
-
- for ( ; index < length ; index++ ) {
- result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
- if ( result ) {
- return result;
- }
- }
-
- jQuery.map( props, createTween, animation );
-
- if ( jQuery.isFunction( animation.opts.start ) ) {
- animation.opts.start.call( elem, animation );
- }
-
- jQuery.fx.timer(
- jQuery.extend( tick, {
- elem: elem,
- anim: animation,
- queue: animation.opts.queue
- })
- );
-
- // attach callbacks from options
- return animation.progress( animation.opts.progress )
- .done( animation.opts.done, animation.opts.complete )
- .fail( animation.opts.fail )
- .always( animation.opts.always );
-}
-
-jQuery.Animation = jQuery.extend( Animation, {
- tweener: function( props, callback ) {
- if ( jQuery.isFunction( props ) ) {
- callback = props;
- props = [ "*" ];
- } else {
- props = props.split(" ");
- }
-
- var prop,
- index = 0,
- length = props.length;
-
- for ( ; index < length ; index++ ) {
- prop = props[ index ];
- tweeners[ prop ] = tweeners[ prop ] || [];
- tweeners[ prop ].unshift( callback );
- }
- },
-
- prefilter: function( callback, prepend ) {
- if ( prepend ) {
- animationPrefilters.unshift( callback );
- } else {
- animationPrefilters.push( callback );
- }
- }
-});
-
-jQuery.speed = function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
- // normalize opt.queue - true/undefined/null -> "fx"
- if ( opt.queue == null || opt.queue === true ) {
- opt.queue = "fx";
- }
-
- // Queueing
- opt.old = opt.complete;
-
- opt.complete = function() {
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
-
- if ( opt.queue ) {
- jQuery.dequeue( this, opt.queue );
- }
- };
-
- return opt;
-};
-
-jQuery.fn.extend({
- fadeTo: function( speed, to, easing, callback ) {
-
- // show any hidden elements after setting opacity to 0
- return this.filter( isHidden ).css( "opacity", 0 ).show()
-
- // animate to the value specified
- .end().animate({ opacity: to }, speed, easing, callback );
- },
- animate: function( prop, speed, easing, callback ) {
- var empty = jQuery.isEmptyObject( prop ),
- optall = jQuery.speed( speed, easing, callback ),
- doAnimation = function() {
- // Operate on a copy of prop so per-property easing won't be lost
- var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
- // Empty animations, or finishing resolves immediately
- if ( empty || jQuery._data( this, "finish" ) ) {
- anim.stop( true );
- }
- };
- doAnimation.finish = doAnimation;
-
- return empty || optall.queue === false ?
- this.each( doAnimation ) :
- this.queue( optall.queue, doAnimation );
- },
- stop: function( type, clearQueue, gotoEnd ) {
- var stopQueue = function( hooks ) {
- var stop = hooks.stop;
- delete hooks.stop;
- stop( gotoEnd );
- };
-
- if ( typeof type !== "string" ) {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = undefined;
- }
- if ( clearQueue && type !== false ) {
- this.queue( type || "fx", [] );
- }
-
- return this.each(function() {
- var dequeue = true,
- index = type != null && type + "queueHooks",
- timers = jQuery.timers,
- data = jQuery._data( this );
-
- if ( index ) {
- if ( data[ index ] && data[ index ].stop ) {
- stopQueue( data[ index ] );
- }
- } else {
- for ( index in data ) {
- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
- stopQueue( data[ index ] );
- }
- }
- }
-
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
- timers[ index ].anim.stop( gotoEnd );
- dequeue = false;
- timers.splice( index, 1 );
- }
- }
-
- // start the next in the queue if the last step wasn't forced
- // timers currently will call their complete callbacks, which will dequeue
- // but only if they were gotoEnd
- if ( dequeue || !gotoEnd ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- finish: function( type ) {
- if ( type !== false ) {
- type = type || "fx";
- }
- return this.each(function() {
- var index,
- data = jQuery._data( this ),
- queue = data[ type + "queue" ],
- hooks = data[ type + "queueHooks" ],
- timers = jQuery.timers,
- length = queue ? queue.length : 0;
-
- // enable finishing flag on private data
- data.finish = true;
-
- // empty the queue first
- jQuery.queue( this, type, [] );
-
- if ( hooks && hooks.stop ) {
- hooks.stop.call( this, true );
- }
-
- // look for any active animations, and finish them
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
- timers[ index ].anim.stop( true );
- timers.splice( index, 1 );
- }
- }
-
- // look for any animations in the old queue and finish them
- for ( index = 0; index < length; index++ ) {
- if ( queue[ index ] && queue[ index ].finish ) {
- queue[ index ].finish.call( this );
- }
- }
-
- // turn off finishing flag
- delete data.finish;
- });
- }
-});
-
-jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
- var cssFn = jQuery.fn[ name ];
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return speed == null || typeof speed === "boolean" ?
- cssFn.apply( this, arguments ) :
- this.animate( genFx( name, true ), speed, easing, callback );
- };
-});
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx("show"),
- slideUp: genFx("hide"),
- slideToggle: genFx("toggle"),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return this.animate( props, speed, easing, callback );
- };
-});
-
-jQuery.timers = [];
-jQuery.fx.tick = function() {
- var timer,
- timers = jQuery.timers,
- i = 0;
-
- fxNow = jQuery.now();
-
- for ( ; i < timers.length; i++ ) {
- timer = timers[ i ];
- // Checks the timer has not already been removed
- if ( !timer() && timers[ i ] === timer ) {
- timers.splice( i--, 1 );
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- fxNow = undefined;
-};
-
-jQuery.fx.timer = function( timer ) {
- jQuery.timers.push( timer );
- if ( timer() ) {
- jQuery.fx.start();
- } else {
- jQuery.timers.pop();
- }
-};
-
-jQuery.fx.interval = 13;
-
-jQuery.fx.start = function() {
- if ( !timerId ) {
- timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
- }
-};
-
-jQuery.fx.stop = function() {
- clearInterval( timerId );
- timerId = null;
-};
-
-jQuery.fx.speeds = {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
-};
-
-
-// Based off of the plugin by Clint Helfers, with permission.
-// http://blindsignals.com/index.php/2009/07/jquery-delay/
-jQuery.fn.delay = function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue( type, function( next, hooks ) {
- var timeout = setTimeout( next, time );
- hooks.stop = function() {
- clearTimeout( timeout );
- };
- });
-};
-
-
-(function() {
- // Minified: var a,b,c,d,e
- var input, div, select, a, opt;
-
- // Setup
- div = document.createElement( "div" );
- div.setAttribute( "className", "t" );
- div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
- a = div.getElementsByTagName("a")[ 0 ];
-
- // First batch of tests.
- select = document.createElement("select");
- opt = select.appendChild( document.createElement("option") );
- input = div.getElementsByTagName("input")[ 0 ];
-
- a.style.cssText = "top:1px";
-
- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
- support.getSetAttribute = div.className !== "t";
-
- // Get the style information from getAttribute
- // (IE uses .cssText instead)
- support.style = /top/.test( a.getAttribute("style") );
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- support.hrefNormalized = a.getAttribute("href") === "/a";
-
- // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
- support.checkOn = !!input.value;
-
- // Make sure that a selected-by-default option has a working selected property.
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
- support.optSelected = opt.selected;
-
- // Tests for enctype support on a form (#6743)
- support.enctype = !!document.createElement("form").enctype;
-
- // Make sure that the options inside disabled selects aren't marked as disabled
- // (WebKit marks them as disabled)
- select.disabled = true;
- support.optDisabled = !opt.disabled;
-
- // Support: IE8 only
- // Check if we can trust getAttribute("value")
- input = document.createElement( "input" );
- input.setAttribute( "value", "" );
- support.input = input.getAttribute( "value" ) === "";
-
- // Check if an input maintains its value after becoming a radio
- input.value = "t";
- input.setAttribute( "type", "radio" );
- support.radioValue = input.value === "t";
-})();
-
-
-var rreturn = /\r/g;
-
-jQuery.fn.extend({
- val: function( value ) {
- var hooks, ret, isFunction,
- elem = this[0];
-
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
- return ret;
- }
-
- ret = elem.value;
-
- return typeof ret === "string" ?
- // handle most common string cases
- ret.replace(rreturn, "") :
- // handle cases where value is null/undef or number
- ret == null ? "" : ret;
- }
-
- return;
- }
-
- isFunction = jQuery.isFunction( value );
-
- return this.each(function( i ) {
- var val;
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( isFunction ) {
- val = value.call( this, i, jQuery( this ).val() );
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
- } else if ( typeof val === "number" ) {
- val += "";
- } else if ( jQuery.isArray( val ) ) {
- val = jQuery.map( val, function( value ) {
- return value == null ? "" : value + "";
- });
- }
-
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- });
- }
-});
-
-jQuery.extend({
- valHooks: {
- option: {
- get: function( elem ) {
- var val = jQuery.find.attr( elem, "value" );
- return val != null ?
- val :
- // Support: IE10-11+
- // option.text throws exceptions (#14686, #14858)
- jQuery.trim( jQuery.text( elem ) );
- }
- },
- select: {
- get: function( elem ) {
- var value, option,
- options = elem.options,
- index = elem.selectedIndex,
- one = elem.type === "select-one" || index < 0,
- values = one ? null : [],
- max = one ? index + 1 : options.length,
- i = index < 0 ?
- max :
- one ? index : 0;
-
- // Loop through all the selected options
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // oldIE doesn't update selected after form reset (#2551)
- if ( ( option.selected || i === index ) &&
- // Don't return options that are disabled or in a disabled optgroup
- ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
- ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var optionSet, option,
- options = elem.options,
- values = jQuery.makeArray( value ),
- i = options.length;
-
- while ( i-- ) {
- option = options[ i ];
-
- if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
-
- // Support: IE6
- // When new option element is added to select box we need to
- // force reflow of newly added node in order to workaround delay
- // of initialization properties
- try {
- option.selected = optionSet = true;
-
- } catch ( _ ) {
-
- // Will be executed only in IE6
- option.scrollHeight;
- }
-
- } else {
- option.selected = false;
- }
- }
-
- // Force browsers to behave consistently when non-matching value is set
- if ( !optionSet ) {
- elem.selectedIndex = -1;
- }
-
- return options;
- }
- }
- }
-});
-
-// Radios and checkboxes getter/setter
-jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- set: function( elem, value ) {
- if ( jQuery.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
- }
- }
- };
- if ( !support.checkOn ) {
- jQuery.valHooks[ this ].get = function( elem ) {
- // Support: Webkit
- // "" is returned instead of "on" if a value isn't specified
- return elem.getAttribute("value") === null ? "on" : elem.value;
- };
- }
-});
-
-
-
-
-var nodeHook, boolHook,
- attrHandle = jQuery.expr.attrHandle,
- ruseDefault = /^(?:checked|selected)$/i,
- getSetAttribute = support.getSetAttribute,
- getSetInput = support.input;
-
-jQuery.fn.extend({
- attr: function( name, value ) {
- return access( this, jQuery.attr, name, value, arguments.length > 1 );
- },
-
- removeAttr: function( name ) {
- return this.each(function() {
- jQuery.removeAttr( this, name );
- });
- }
-});
-
-jQuery.extend({
- attr: function( elem, name, value ) {
- var hooks, ret,
- nType = elem.nodeType;
-
- // don't get/set attributes on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- // Fallback to prop when attributes are not supported
- if ( typeof elem.getAttribute === strundefined ) {
- return jQuery.prop( elem, name, value );
- }
-
- // All attributes are lowercase
- // Grab necessary hook if one is defined
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
- name = name.toLowerCase();
- hooks = jQuery.attrHooks[ name ] ||
- ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
- }
-
- if ( value !== undefined ) {
-
- if ( value === null ) {
- jQuery.removeAttr( elem, name );
-
- } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- elem.setAttribute( name, value + "" );
- return value;
- }
-
- } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
- ret = jQuery.find.attr( elem, name );
-
- // Non-existent attributes return null, we normalize to undefined
- return ret == null ?
- undefined :
- ret;
- }
- },
-
- removeAttr: function( elem, value ) {
- var name, propName,
- i = 0,
- attrNames = value && value.match( rnotwhite );
-
- if ( attrNames && elem.nodeType === 1 ) {
- while ( (name = attrNames[i++]) ) {
- propName = jQuery.propFix[ name ] || name;
-
- // Boolean attributes get special treatment (#10870)
- if ( jQuery.expr.match.bool.test( name ) ) {
- // Set corresponding property to false
- if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
- elem[ propName ] = false;
- // Support: IE<9
- // Also clear defaultChecked/defaultSelected (if appropriate)
- } else {
- elem[ jQuery.camelCase( "default-" + name ) ] =
- elem[ propName ] = false;
- }
-
- // See #9699 for explanation of this approach (setting first, then removal)
- } else {
- jQuery.attr( elem, name, "" );
- }
-
- elem.removeAttribute( getSetAttribute ? name : propName );
- }
- }
- },
-
- attrHooks: {
- type: {
- set: function( elem, value ) {
- if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
- // Setting the type on a radio button after the value resets the value in IE6-9
- // Reset value to default in case type is set after value during creation
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- }
- }
-});
-
-// Hook for boolean attributes
-boolHook = {
- set: function( elem, value, name ) {
- if ( value === false ) {
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
- // IE<8 needs the *property* name
- elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
-
- // Use defaultChecked and defaultSelected for oldIE
- } else {
- elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
- }
-
- return name;
- }
-};
-
-// Retrieve booleans specially
-jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
-
- var getter = attrHandle[ name ] || jQuery.find.attr;
-
- attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
- function( elem, name, isXML ) {
- var ret, handle;
- if ( !isXML ) {
- // Avoid an infinite loop by temporarily removing this function from the getter
- handle = attrHandle[ name ];
- attrHandle[ name ] = ret;
- ret = getter( elem, name, isXML ) != null ?
- name.toLowerCase() :
- null;
- attrHandle[ name ] = handle;
- }
- return ret;
- } :
- function( elem, name, isXML ) {
- if ( !isXML ) {
- return elem[ jQuery.camelCase( "default-" + name ) ] ?
- name.toLowerCase() :
- null;
- }
- };
-});
-
-// fix oldIE attroperties
-if ( !getSetInput || !getSetAttribute ) {
- jQuery.attrHooks.value = {
- set: function( elem, value, name ) {
- if ( jQuery.nodeName( elem, "input" ) ) {
- // Does not return so that setAttribute is also used
- elem.defaultValue = value;
- } else {
- // Use nodeHook if defined (#1954); otherwise setAttribute is fine
- return nodeHook && nodeHook.set( elem, value, name );
- }
- }
- };
-}
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
- // Use this for any attribute in IE6/7
- // This fixes almost every IE6/7 issue
- nodeHook = {
- set: function( elem, value, name ) {
- // Set the existing or create a new attribute node
- var ret = elem.getAttributeNode( name );
- if ( !ret ) {
- elem.setAttributeNode(
- (ret = elem.ownerDocument.createAttribute( name ))
- );
- }
-
- ret.value = value += "";
-
- // Break association with cloned elements by also using setAttribute (#9646)
- if ( name === "value" || value === elem.getAttribute( name ) ) {
- return value;
- }
- }
- };
-
- // Some attributes are constructed with empty-string values when not defined
- attrHandle.id = attrHandle.name = attrHandle.coords =
- function( elem, name, isXML ) {
- var ret;
- if ( !isXML ) {
- return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
- ret.value :
- null;
- }
- };
-
- // Fixing value retrieval on a button requires this module
- jQuery.valHooks.button = {
- get: function( elem, name ) {
- var ret = elem.getAttributeNode( name );
- if ( ret && ret.specified ) {
- return ret.value;
- }
- },
- set: nodeHook.set
- };
-
- // Set contenteditable to false on removals(#10429)
- // Setting to empty string throws an error as an invalid value
- jQuery.attrHooks.contenteditable = {
- set: function( elem, value, name ) {
- nodeHook.set( elem, value === "" ? false : value, name );
- }
- };
-
- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
- // This is for removals
- jQuery.each([ "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = {
- set: function( elem, value ) {
- if ( value === "" ) {
- elem.setAttribute( name, "auto" );
- return value;
- }
- }
- };
- });
-}
-
-if ( !support.style ) {
- jQuery.attrHooks.style = {
- get: function( elem ) {
- // Return undefined in the case of empty string
- // Note: IE uppercases css property names, but if we were to .toLowerCase()
- // .cssText, that would destroy case senstitivity in URL's, like in "background"
- return elem.style.cssText || undefined;
- },
- set: function( elem, value ) {
- return ( elem.style.cssText = value + "" );
- }
- };
-}
-
-
-
-
-var rfocusable = /^(?:input|select|textarea|button|object)$/i,
- rclickable = /^(?:a|area)$/i;
-
-jQuery.fn.extend({
- prop: function( name, value ) {
- return access( this, jQuery.prop, name, value, arguments.length > 1 );
- },
-
- removeProp: function( name ) {
- name = jQuery.propFix[ name ] || name;
- return this.each(function() {
- // try/catch handles cases where IE balks (such as removing a property on window)
- try {
- this[ name ] = undefined;
- delete this[ name ];
- } catch( e ) {}
- });
- }
-});
-
-jQuery.extend({
- propFix: {
- "for": "htmlFor",
- "class": "className"
- },
-
- prop: function( elem, name, value ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set properties on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- if ( notxml ) {
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if ( value !== undefined ) {
- return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
- ret :
- ( elem[ name ] = value );
-
- } else {
- return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
- ret :
- elem[ name ];
- }
- },
-
- propHooks: {
- tabIndex: {
- get: function( elem ) {
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- // Use proper attribute retrieval(#12072)
- var tabindex = jQuery.find.attr( elem, "tabindex" );
-
- return tabindex ?
- parseInt( tabindex, 10 ) :
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
- 0 :
- -1;
- }
- }
- }
-});
-
-// Some attributes require a special call on IE
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !support.hrefNormalized ) {
- // href/src property should get the full normalized URL (#10299/#12915)
- jQuery.each([ "href", "src" ], function( i, name ) {
- jQuery.propHooks[ name ] = {
- get: function( elem ) {
- return elem.getAttribute( name, 4 );
- }
- };
- });
-}
-
-// Support: Safari, IE9+
-// mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !support.optSelected ) {
- jQuery.propHooks.selected = {
- get: function( elem ) {
- var parent = elem.parentNode;
-
- if ( parent ) {
- parent.selectedIndex;
-
- // Make sure that it also works with optgroups, see #5701
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- return null;
- }
- };
-}
-
-jQuery.each([
- "tabIndex",
- "readOnly",
- "maxLength",
- "cellSpacing",
- "cellPadding",
- "rowSpan",
- "colSpan",
- "useMap",
- "frameBorder",
- "contentEditable"
-], function() {
- jQuery.propFix[ this.toLowerCase() ] = this;
-});
-
-// IE6/7 call enctype encoding
-if ( !support.enctype ) {
- jQuery.propFix.enctype = "encoding";
-}
-
-
-
-
-var rclass = /[\t\r\n\f]/g;
-
-jQuery.fn.extend({
- addClass: function( value ) {
- var classes, elem, cur, clazz, j, finalValue,
- i = 0,
- len = this.length,
- proceed = typeof value === "string" && value;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).addClass( value.call( this, j, this.className ) );
- });
- }
-
- if ( proceed ) {
- // The disjunction here is for better compressibility (see removeClass)
- classes = ( value || "" ).match( rnotwhite ) || [];
-
- for ( ; i < len; i++ ) {
- elem = this[ i ];
- cur = elem.nodeType === 1 && ( elem.className ?
- ( " " + elem.className + " " ).replace( rclass, " " ) :
- " "
- );
-
- if ( cur ) {
- j = 0;
- while ( (clazz = classes[j++]) ) {
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
- cur += clazz + " ";
- }
- }
-
- // only assign if different to avoid unneeded rendering.
- finalValue = jQuery.trim( cur );
- if ( elem.className !== finalValue ) {
- elem.className = finalValue;
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- var classes, elem, cur, clazz, j, finalValue,
- i = 0,
- len = this.length,
- proceed = arguments.length === 0 || typeof value === "string" && value;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).removeClass( value.call( this, j, this.className ) );
- });
- }
- if ( proceed ) {
- classes = ( value || "" ).match( rnotwhite ) || [];
-
- for ( ; i < len; i++ ) {
- elem = this[ i ];
- // This expression is here for better compressibility (see addClass)
- cur = elem.nodeType === 1 && ( elem.className ?
- ( " " + elem.className + " " ).replace( rclass, " " ) :
- ""
- );
-
- if ( cur ) {
- j = 0;
- while ( (clazz = classes[j++]) ) {
- // Remove *all* instances
- while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
- cur = cur.replace( " " + clazz + " ", " " );
- }
- }
-
- // only assign if different to avoid unneeded rendering.
- finalValue = value ? jQuery.trim( cur ) : "";
- if ( elem.className !== finalValue ) {
- elem.className = finalValue;
- }
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value;
-
- if ( typeof stateVal === "boolean" && type === "string" ) {
- return stateVal ? this.addClass( value ) : this.removeClass( value );
- }
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( i ) {
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
- });
- }
-
- return this.each(function() {
- if ( type === "string" ) {
- // toggle individual class names
- var className,
- i = 0,
- self = jQuery( this ),
- classNames = value.match( rnotwhite ) || [];
-
- while ( (className = classNames[ i++ ]) ) {
- // check each className given, space separated list
- if ( self.hasClass( className ) ) {
- self.removeClass( className );
- } else {
- self.addClass( className );
- }
- }
-
- // Toggle whole class name
- } else if ( type === strundefined || type === "boolean" ) {
- if ( this.className ) {
- // store className if set
- jQuery._data( this, "__className__", this.className );
- }
-
- // If the element has a class name or if we're passed "false",
- // then remove the whole classname (if there was one, the above saved it).
- // Otherwise bring back whatever was previously saved (if anything),
- // falling back to the empty string if nothing was stored.
- this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
- }
- });
- },
-
- hasClass: function( selector ) {
- var className = " " + selector + " ",
- i = 0,
- l = this.length;
- for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
- return true;
- }
- }
-
- return false;
- }
-});
-
-
-
-
-// Return jQuery for attributes-only inclusion
-
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( data, fn ) {
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- };
-});
-
-jQuery.fn.extend({
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- },
-
- bind: function( types, data, fn ) {
- return this.on( types, null, data, fn );
- },
- unbind: function( types, fn ) {
- return this.off( types, null, fn );
- },
-
- delegate: function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
- },
- undelegate: function( selector, types, fn ) {
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
- }
-});
-
-
-var nonce = jQuery.now();
-
-var rquery = (/\?/);
-
-
-
-var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
-
-jQuery.parseJSON = function( data ) {
- // Attempt to parse using the native JSON parser first
- if ( window.JSON && window.JSON.parse ) {
- // Support: Android 2.3
- // Workaround failure to string-cast null input
- return window.JSON.parse( data + "" );
- }
-
- var requireNonComma,
- depth = null,
- str = jQuery.trim( data + "" );
-
- // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
- // after removing valid tokens
- return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
-
- // Force termination if we see a misplaced comma
- if ( requireNonComma && comma ) {
- depth = 0;
- }
-
- // Perform no more replacements after returning to outermost depth
- if ( depth === 0 ) {
- return token;
- }
-
- // Commas must not follow "[", "{", or ","
- requireNonComma = open || comma;
-
- // Determine new depth
- // array/object open ("[" or "{"): depth += true - false (increment)
- // array/object close ("]" or "}"): depth += false - true (decrement)
- // other cases ("," or primitive): depth += true - true (numeric cast)
- depth += !close - !open;
-
- // Remove this token
- return "";
- }) ) ?
- ( Function( "return " + str ) )() :
- jQuery.error( "Invalid JSON: " + data );
-};
-
-
-// Cross-browser xml parsing
-jQuery.parseXML = function( data ) {
- var xml, tmp;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
- try {
- if ( window.DOMParser ) { // Standard
- tmp = new DOMParser();
- xml = tmp.parseFromString( data, "text/xml" );
- } else { // IE
- xml = new ActiveXObject( "Microsoft.XMLDOM" );
- xml.async = "false";
- xml.loadXML( data );
- }
- } catch( e ) {
- xml = undefined;
- }
- if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
-};
-
-
-var
- // Document location
- ajaxLocParts,
- ajaxLocation,
-
- rhash = /#.*$/,
- rts = /([?&])_=[^&]*/,
- rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
- // #7653, #8125, #8152: local protocol detection
- rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
- rnoContent = /^(?:GET|HEAD)$/,
- rprotocol = /^\/\//,
- rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
-
- /* Prefilters
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
- * 2) These are called:
- * - BEFORE asking for a transport
- * - AFTER param serialization (s.data is a string if s.processData is true)
- * 3) key is the dataType
- * 4) the catchall symbol "*" can be used
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
- */
- prefilters = {},
-
- /* Transports bindings
- * 1) key is the dataType
- * 2) the catchall symbol "*" can be used
- * 3) selection will start with transport dataType and THEN go to "*" if needed
- */
- transports = {},
-
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
- allTypes = "*/".concat("*");
-
-// #8138, IE may throw an exception when accessing
-// a field from window.location if document.domain has been set
-try {
- ajaxLocation = location.href;
-} catch( e ) {
- // Use the href attribute of an A element
- // since IE will modify it given document.location
- ajaxLocation = document.createElement( "a" );
- ajaxLocation.href = "";
- ajaxLocation = ajaxLocation.href;
-}
-
-// Segment location into parts
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
- // dataTypeExpression is optional and defaults to "*"
- return function( dataTypeExpression, func ) {
-
- if ( typeof dataTypeExpression !== "string" ) {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
-
- var dataType,
- i = 0,
- dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
-
- if ( jQuery.isFunction( func ) ) {
- // For each dataType in the dataTypeExpression
- while ( (dataType = dataTypes[i++]) ) {
- // Prepend if requested
- if ( dataType.charAt( 0 ) === "+" ) {
- dataType = dataType.slice( 1 ) || "*";
- (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
-
- // Otherwise append
- } else {
- (structure[ dataType ] = structure[ dataType ] || []).push( func );
- }
- }
- }
- };
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
-
- var inspected = {},
- seekingTransport = ( structure === transports );
-
- function inspect( dataType ) {
- var selected;
- inspected[ dataType ] = true;
- jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
- var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
- if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
- options.dataTypes.unshift( dataTypeOrTransport );
- inspect( dataTypeOrTransport );
- return false;
- } else if ( seekingTransport ) {
- return !( selected = dataTypeOrTransport );
- }
- });
- return selected;
- }
-
- return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
- var deep, key,
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
-
- for ( key in src ) {
- if ( src[ key ] !== undefined ) {
- ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
- }
- }
- if ( deep ) {
- jQuery.extend( true, target, deep );
- }
-
- return target;
-}
-
-/* Handles responses to an ajax request:
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
- var firstDataType, ct, finalDataType, type,
- contents = s.contents,
- dataTypes = s.dataTypes;
-
- // Remove auto dataType and get content-type in the process
- while ( dataTypes[ 0 ] === "*" ) {
- dataTypes.shift();
- if ( ct === undefined ) {
- ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
- }
- }
-
- // Check if we're dealing with a known content-type
- if ( ct ) {
- for ( type in contents ) {
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
- dataTypes.unshift( type );
- break;
- }
- }
- }
-
- // Check to see if we have a response for the expected dataType
- if ( dataTypes[ 0 ] in responses ) {
- finalDataType = dataTypes[ 0 ];
- } else {
- // Try convertible dataTypes
- for ( type in responses ) {
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
- finalDataType = type;
- break;
- }
- if ( !firstDataType ) {
- firstDataType = type;
- }
- }
- // Or just use first one
- finalDataType = finalDataType || firstDataType;
- }
-
- // If we found a dataType
- // We add the dataType to the list if needed
- // and return the corresponding response
- if ( finalDataType ) {
- if ( finalDataType !== dataTypes[ 0 ] ) {
- dataTypes.unshift( finalDataType );
- }
- return responses[ finalDataType ];
- }
-}
-
-/* Chain conversions given the request and the original response
- * Also sets the responseXXX fields on the jqXHR instance
- */
-function ajaxConvert( s, response, jqXHR, isSuccess ) {
- var conv2, current, conv, tmp, prev,
- converters = {},
- // Work with a copy of dataTypes in case we need to modify it for conversion
- dataTypes = s.dataTypes.slice();
-
- // Create converters map with lowercased keys
- if ( dataTypes[ 1 ] ) {
- for ( conv in s.converters ) {
- converters[ conv.toLowerCase() ] = s.converters[ conv ];
- }
- }
-
- current = dataTypes.shift();
-
- // Convert to each sequential dataType
- while ( current ) {
-
- if ( s.responseFields[ current ] ) {
- jqXHR[ s.responseFields[ current ] ] = response;
- }
-
- // Apply the dataFilter if provided
- if ( !prev && isSuccess && s.dataFilter ) {
- response = s.dataFilter( response, s.dataType );
- }
-
- prev = current;
- current = dataTypes.shift();
-
- if ( current ) {
-
- // There's only work to do if current dataType is non-auto
- if ( current === "*" ) {
-
- current = prev;
-
- // Convert response if prev dataType is non-auto and differs from current
- } else if ( prev !== "*" && prev !== current ) {
-
- // Seek a direct converter
- conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
- // If none found, seek a pair
- if ( !conv ) {
- for ( conv2 in converters ) {
-
- // If conv2 outputs current
- tmp = conv2.split( " " );
- if ( tmp[ 1 ] === current ) {
-
- // If prev can be converted to accepted input
- conv = converters[ prev + " " + tmp[ 0 ] ] ||
- converters[ "* " + tmp[ 0 ] ];
- if ( conv ) {
- // Condense equivalence converters
- if ( conv === true ) {
- conv = converters[ conv2 ];
-
- // Otherwise, insert the intermediate dataType
- } else if ( converters[ conv2 ] !== true ) {
- current = tmp[ 0 ];
- dataTypes.unshift( tmp[ 1 ] );
- }
- break;
- }
- }
- }
- }
-
- // Apply converter (if not an equivalence)
- if ( conv !== true ) {
-
- // Unless errors are allowed to bubble, catch and return them
- if ( conv && s[ "throws" ] ) {
- response = conv( response );
- } else {
- try {
- response = conv( response );
- } catch ( e ) {
- return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
- }
- }
- }
- }
- }
- }
-
- return { state: "success", data: response };
-}
-
-jQuery.extend({
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
-
- ajaxSettings: {
- url: ajaxLocation,
- type: "GET",
- isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
- global: true,
- processData: true,
- async: true,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- throws: false,
- traditional: false,
- headers: {},
- */
-
- accepts: {
- "*": allTypes,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
-
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
-
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
-
- // Data converters
- // Keys separate source (or catchall "*") and destination types with a single space
- converters: {
-
- // Convert anything to text
- "* text": String,
-
- // Text to html (true = no transformation)
- "text html": true,
-
- // Evaluate text as a json expression
- "text json": jQuery.parseJSON,
-
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
-
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- url: true,
- context: true
- }
- },
-
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function( target, settings ) {
- return settings ?
-
- // Building a settings object
- ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
-
- // Extending ajaxSettings
- ajaxExtend( jQuery.ajaxSettings, target );
- },
-
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
- ajaxTransport: addToPrefiltersOrTransports( transports ),
-
- // Main method
- ajax: function( url, options ) {
-
- // If url is an object, simulate pre-1.5 signature
- if ( typeof url === "object" ) {
- options = url;
- url = undefined;
- }
-
- // Force options to be an object
- options = options || {};
-
- var // Cross-domain detection vars
- parts,
- // Loop variable
- i,
- // URL without anti-cache param
- cacheURL,
- // Response headers as string
- responseHeadersString,
- // timeout handle
- timeoutTimer,
-
- // To know if global events are to be dispatched
- fireGlobals,
-
- transport,
- // Response headers
- responseHeaders,
- // Create the final options object
- s = jQuery.ajaxSetup( {}, options ),
- // Callbacks context
- callbackContext = s.context || s,
- // Context for global events is callbackContext if it is a DOM node or jQuery collection
- globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
- jQuery( callbackContext ) :
- jQuery.event,
- // Deferreds
- deferred = jQuery.Deferred(),
- completeDeferred = jQuery.Callbacks("once memory"),
- // Status-dependent callbacks
- statusCode = s.statusCode || {},
- // Headers (they are sent all at once)
- requestHeaders = {},
- requestHeadersNames = {},
- // The jqXHR state
- state = 0,
- // Default abort message
- strAbort = "canceled",
- // Fake xhr
- jqXHR = {
- readyState: 0,
-
- // Builds headers hashtable if needed
- getResponseHeader: function( key ) {
- var match;
- if ( state === 2 ) {
- if ( !responseHeaders ) {
- responseHeaders = {};
- while ( (match = rheaders.exec( responseHeadersString )) ) {
- responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
- }
- }
- match = responseHeaders[ key.toLowerCase() ];
- }
- return match == null ? null : match;
- },
-
- // Raw string
- getAllResponseHeaders: function() {
- return state === 2 ? responseHeadersString : null;
- },
-
- // Caches the header
- setRequestHeader: function( name, value ) {
- var lname = name.toLowerCase();
- if ( !state ) {
- name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
- requestHeaders[ name ] = value;
- }
- return this;
- },
-
- // Overrides response content-type header
- overrideMimeType: function( type ) {
- if ( !state ) {
- s.mimeType = type;
- }
- return this;
- },
-
- // Status-dependent callbacks
- statusCode: function( map ) {
- var code;
- if ( map ) {
- if ( state < 2 ) {
- for ( code in map ) {
- // Lazy-add the new callback in a way that preserves old ones
- statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
- }
- } else {
- // Execute the appropriate callbacks
- jqXHR.always( map[ jqXHR.status ] );
- }
- }
- return this;
- },
-
- // Cancel the request
- abort: function( statusText ) {
- var finalText = statusText || strAbort;
- if ( transport ) {
- transport.abort( finalText );
- }
- done( 0, finalText );
- return this;
- }
- };
-
- // Attach deferreds
- deferred.promise( jqXHR ).complete = completeDeferred.add;
- jqXHR.success = jqXHR.done;
- jqXHR.error = jqXHR.fail;
-
- // Remove hash character (#7531: and string promotion)
- // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
- // Handle falsy url in the settings object (#10093: consistency with old signature)
- // We also use the url parameter if available
- s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
- // Alias method option to type as per ticket #12004
- s.type = options.method || options.type || s.method || s.type;
-
- // Extract dataTypes list
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
-
- // A cross-domain request is in order when we have a protocol:host:port mismatch
- if ( s.crossDomain == null ) {
- parts = rurl.exec( s.url.toLowerCase() );
- s.crossDomain = !!( parts &&
- ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
- );
- }
-
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Apply prefilters
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
- // If request was aborted inside a prefilter, stop there
- if ( state === 2 ) {
- return jqXHR;
- }
-
- // We can fire global events as of now if asked to
- // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
- fireGlobals = jQuery.event && s.global;
-
- // Watch for a new set of requests
- if ( fireGlobals && jQuery.active++ === 0 ) {
- jQuery.event.trigger("ajaxStart");
- }
-
- // Uppercase the type
- s.type = s.type.toUpperCase();
-
- // Determine if request has content
- s.hasContent = !rnoContent.test( s.type );
-
- // Save the URL in case we're toying with the If-Modified-Since
- // and/or If-None-Match header later on
- cacheURL = s.url;
-
- // More options handling for requests with no content
- if ( !s.hasContent ) {
-
- // If data is available, append data to url
- if ( s.data ) {
- cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
- // #9682: remove data so that it's not used in an eventual retry
- delete s.data;
- }
-
- // Add anti-cache in url if needed
- if ( s.cache === false ) {
- s.url = rts.test( cacheURL ) ?
-
- // If there is already a '_' parameter, set its value
- cacheURL.replace( rts, "$1_=" + nonce++ ) :
-
- // Otherwise add one to the end
- cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
- }
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- if ( jQuery.lastModified[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
- }
- if ( jQuery.etag[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
- }
- }
-
- // Set the correct header, if data is being sent
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
- }
-
- // Set the Accepts header for the server, depending on the dataType
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
- s.accepts[ "*" ]
- );
-
- // Check for headers option
- for ( i in s.headers ) {
- jqXHR.setRequestHeader( i, s.headers[ i ] );
- }
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
- // Abort if not done already and return
- return jqXHR.abort();
- }
-
- // aborting is no longer a cancellation
- strAbort = "abort";
-
- // Install callbacks on deferreds
- for ( i in { success: 1, error: 1, complete: 1 } ) {
- jqXHR[ i ]( s[ i ] );
- }
-
- // Get transport
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
- // If no transport, we auto-abort
- if ( !transport ) {
- done( -1, "No Transport" );
- } else {
- jqXHR.readyState = 1;
-
- // Send global event
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
- }
- // Timeout
- if ( s.async && s.timeout > 0 ) {
- timeoutTimer = setTimeout(function() {
- jqXHR.abort("timeout");
- }, s.timeout );
- }
-
- try {
- state = 1;
- transport.send( requestHeaders, done );
- } catch ( e ) {
- // Propagate exception as error if not done
- if ( state < 2 ) {
- done( -1, e );
- // Simply rethrow otherwise
- } else {
- throw e;
- }
- }
- }
-
- // Callback for when everything is done
- function done( status, nativeStatusText, responses, headers ) {
- var isSuccess, success, error, response, modified,
- statusText = nativeStatusText;
-
- // Called once
- if ( state === 2 ) {
- return;
- }
-
- // State is "done" now
- state = 2;
-
- // Clear timeout if it exists
- if ( timeoutTimer ) {
- clearTimeout( timeoutTimer );
- }
-
- // Dereference transport for early garbage collection
- // (no matter how long the jqXHR object will be used)
- transport = undefined;
-
- // Cache response headers
- responseHeadersString = headers || "";
-
- // Set readyState
- jqXHR.readyState = status > 0 ? 4 : 0;
-
- // Determine if successful
- isSuccess = status >= 200 && status < 300 || status === 304;
-
- // Get response data
- if ( responses ) {
- response = ajaxHandleResponses( s, jqXHR, responses );
- }
-
- // Convert no matter what (that way responseXXX fields are always set)
- response = ajaxConvert( s, response, jqXHR, isSuccess );
-
- // If successful, handle type chaining
- if ( isSuccess ) {
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- modified = jqXHR.getResponseHeader("Last-Modified");
- if ( modified ) {
- jQuery.lastModified[ cacheURL ] = modified;
- }
- modified = jqXHR.getResponseHeader("etag");
- if ( modified ) {
- jQuery.etag[ cacheURL ] = modified;
- }
- }
-
- // if no content
- if ( status === 204 || s.type === "HEAD" ) {
- statusText = "nocontent";
-
- // if not modified
- } else if ( status === 304 ) {
- statusText = "notmodified";
-
- // If we have data, let's convert it
- } else {
- statusText = response.state;
- success = response.data;
- error = response.error;
- isSuccess = !error;
- }
- } else {
- // We extract error from statusText
- // then normalize statusText and status for non-aborts
- error = statusText;
- if ( status || !statusText ) {
- statusText = "error";
- if ( status < 0 ) {
- status = 0;
- }
- }
- }
-
- // Set data for the fake xhr object
- jqXHR.status = status;
- jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
- // Success/Error
- if ( isSuccess ) {
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
- } else {
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
- }
-
- // Status-dependent callbacks
- jqXHR.statusCode( statusCode );
- statusCode = undefined;
-
- if ( fireGlobals ) {
- globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
- [ jqXHR, s, isSuccess ? success : error ] );
- }
-
- // Complete
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
- // Handle the global AJAX counter
- if ( !( --jQuery.active ) ) {
- jQuery.event.trigger("ajaxStop");
- }
- }
- }
-
- return jqXHR;
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get( url, data, callback, "json" );
- },
-
- getScript: function( url, callback ) {
- return jQuery.get( url, undefined, callback, "script" );
- }
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
- jQuery[ method ] = function( url, data, callback, type ) {
- // shift arguments if data argument was omitted
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
-
- return jQuery.ajax({
- url: url,
- type: method,
- dataType: type,
- data: data,
- success: callback
- });
- };
-});
-
-
-jQuery._evalUrl = function( url ) {
- return jQuery.ajax({
- url: url,
- type: "GET",
- dataType: "script",
- async: false,
- global: false,
- "throws": true
- });
-};
-
-
-jQuery.fn.extend({
- wrapAll: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapAll( html.call(this, i) );
- });
- }
-
- if ( this[0] ) {
- // The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
- if ( this[0].parentNode ) {
- wrap.insertBefore( this[0] );
- }
-
- wrap.map(function() {
- var elem = this;
-
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
- elem = elem.firstChild;
- }
-
- return elem;
- }).append( this );
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapInner( html.call(this, i) );
- });
- }
-
- return this.each(function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- });
- },
-
- wrap: function( html ) {
- var isFunction = jQuery.isFunction( html );
-
- return this.each(function(i) {
- jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
- });
- },
-
- unwrap: function() {
- return this.parent().each(function() {
- if ( !jQuery.nodeName( this, "body" ) ) {
- jQuery( this ).replaceWith( this.childNodes );
- }
- }).end();
- }
-});
-
-
-jQuery.expr.filters.hidden = function( elem ) {
- // Support: Opera <= 12.12
- // Opera reports offsetWidths and offsetHeights less than zero on some elements
- return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
- (!support.reliableHiddenOffsets() &&
- ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
-};
-
-jQuery.expr.filters.visible = function( elem ) {
- return !jQuery.expr.filters.hidden( elem );
-};
-
-
-
-
-var r20 = /%20/g,
- rbracket = /\[\]$/,
- rCRLF = /\r?\n/g,
- rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
- rsubmittable = /^(?:input|select|textarea|keygen)/i;
-
-function buildParams( prefix, obj, traditional, add ) {
- var name;
-
- if ( jQuery.isArray( obj ) ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
- // Treat each array item as a scalar.
- add( prefix, v );
-
- } else {
- // Item is non-scalar (array or object), encode its numeric index.
- buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
- }
- });
-
- } else if ( !traditional && jQuery.type( obj ) === "object" ) {
- // Serialize object item.
- for ( name in obj ) {
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
- }
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
- }
-}
-
-// Serialize an array of form elements or a set of
-// key/values into a query string
-jQuery.param = function( a, traditional ) {
- var prefix,
- s = [],
- add = function( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
- s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
- };
-
- // Set traditional to true for jQuery <= 1.3.2 behavior.
- if ( traditional === undefined ) {
- traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- });
-
- } else {
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( prefix in a ) {
- buildParams( prefix, a[ prefix ], traditional, add );
- }
- }
-
- // Return the resulting serialization
- return s.join( "&" ).replace( r20, "+" );
-};
-
-jQuery.fn.extend({
- serialize: function() {
- return jQuery.param( this.serializeArray() );
- },
- serializeArray: function() {
- return this.map(function() {
- // Can add propHook for "elements" to filter or add form elements
- var elements = jQuery.prop( this, "elements" );
- return elements ? jQuery.makeArray( elements ) : this;
- })
- .filter(function() {
- var type = this.type;
- // Use .is(":disabled") so that fieldset[disabled] works
- return this.name && !jQuery( this ).is( ":disabled" ) &&
- rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
- ( this.checked || !rcheckableType.test( type ) );
- })
- .map(function( i, elem ) {
- var val = jQuery( this ).val();
-
- return val == null ?
- null :
- jQuery.isArray( val ) ?
- jQuery.map( val, function( val ) {
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }) :
- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }).get();
- }
-});
-
-
-// Create the request object
-// (This is still attached to ajaxSettings for backward compatibility)
-jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
- // Support: IE6+
- function() {
-
- // XHR cannot access local files, always use ActiveX for that case
- return !this.isLocal &&
-
- // Support: IE7-8
- // oldIE XHR does not support non-RFC2616 methods (#13240)
- // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
- // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
- // Although this check for six methods instead of eight
- // since IE also does not support "trace" and "connect"
- /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
-
- createStandardXHR() || createActiveXHR();
- } :
- // For all other browsers, use the standard XMLHttpRequest object
- createStandardXHR;
-
-var xhrId = 0,
- xhrCallbacks = {},
- xhrSupported = jQuery.ajaxSettings.xhr();
-
-// Support: IE<10
-// Open requests must be manually aborted on unload (#5280)
-// See https://support.microsoft.com/kb/2856746 for more info
-if ( window.attachEvent ) {
- window.attachEvent( "onunload", function() {
- for ( var key in xhrCallbacks ) {
- xhrCallbacks[ key ]( undefined, true );
- }
- });
-}
-
-// Determine support properties
-support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-xhrSupported = support.ajax = !!xhrSupported;
-
-// Create transport if the browser can provide an xhr
-if ( xhrSupported ) {
-
- jQuery.ajaxTransport(function( options ) {
- // Cross domain only allowed if supported through XMLHttpRequest
- if ( !options.crossDomain || support.cors ) {
-
- var callback;
-
- return {
- send: function( headers, complete ) {
- var i,
- xhr = options.xhr(),
- id = ++xhrId;
-
- // Open the socket
- xhr.open( options.type, options.url, options.async, options.username, options.password );
-
- // Apply custom fields if provided
- if ( options.xhrFields ) {
- for ( i in options.xhrFields ) {
- xhr[ i ] = options.xhrFields[ i ];
- }
- }
-
- // Override mime type if needed
- if ( options.mimeType && xhr.overrideMimeType ) {
- xhr.overrideMimeType( options.mimeType );
- }
-
- // X-Requested-With header
- // For cross-domain requests, seeing as conditions for a preflight are
- // akin to a jigsaw puzzle, we simply never set it to be sure.
- // (it can always be set on a per-request basis or even using ajaxSetup)
- // For same-domain requests, won't change header if already provided.
- if ( !options.crossDomain && !headers["X-Requested-With"] ) {
- headers["X-Requested-With"] = "XMLHttpRequest";
- }
-
- // Set headers
- for ( i in headers ) {
- // Support: IE<9
- // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
- // request header to a null-value.
- //
- // To keep consistent with other XHR implementations, cast the value
- // to string and ignore `undefined`.
- if ( headers[ i ] !== undefined ) {
- xhr.setRequestHeader( i, headers[ i ] + "" );
- }
- }
-
- // Do send the request
- // This may raise an exception which is actually
- // handled in jQuery.ajax (so no try/catch here)
- xhr.send( ( options.hasContent && options.data ) || null );
-
- // Listener
- callback = function( _, isAbort ) {
- var status, statusText, responses;
-
- // Was never called and is aborted or complete
- if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
- // Clean up
- delete xhrCallbacks[ id ];
- callback = undefined;
- xhr.onreadystatechange = jQuery.noop;
-
- // Abort manually if needed
- if ( isAbort ) {
- if ( xhr.readyState !== 4 ) {
- xhr.abort();
- }
- } else {
- responses = {};
- status = xhr.status;
-
- // Support: IE<10
- // Accessing binary-data responseText throws an exception
- // (#11426)
- if ( typeof xhr.responseText === "string" ) {
- responses.text = xhr.responseText;
- }
-
- // Firefox throws an exception when accessing
- // statusText for faulty cross-domain requests
- try {
- statusText = xhr.statusText;
- } catch( e ) {
- // We normalize with Webkit giving an empty statusText
- statusText = "";
- }
-
- // Filter status for non standard behaviors
-
- // If the request is local and we have data: assume a success
- // (success with no data won't get notified, that's the best we
- // can do given current implementations)
- if ( !status && options.isLocal && !options.crossDomain ) {
- status = responses.text ? 200 : 404;
- // IE - #1450: sometimes returns 1223 when it should be 204
- } else if ( status === 1223 ) {
- status = 204;
- }
- }
- }
-
- // Call complete if needed
- if ( responses ) {
- complete( status, statusText, responses, xhr.getAllResponseHeaders() );
- }
- };
-
- if ( !options.async ) {
- // if we're in sync mode we fire the callback
- callback();
- } else if ( xhr.readyState === 4 ) {
- // (IE6 & IE7) if it's in cache and has been
- // retrieved directly we need to fire the callback
- setTimeout( callback );
- } else {
- // Add to the list of active xhr callbacks
- xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
- }
- },
-
- abort: function() {
- if ( callback ) {
- callback( undefined, true );
- }
- }
- };
- }
- });
-}
-
-// Functions to create xhrs
-function createStandardXHR() {
- try {
- return new window.XMLHttpRequest();
- } catch( e ) {}
-}
-
-function createActiveXHR() {
- try {
- return new window.ActiveXObject( "Microsoft.XMLHTTP" );
- } catch( e ) {}
-}
-
-
-
-
-// Install script dataType
-jQuery.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /(?:java|ecma)script/
- },
- converters: {
- "text script": function( text ) {
- jQuery.globalEval( text );
- return text;
- }
- }
-});
-
-// Handle cache's special case and global
-jQuery.ajaxPrefilter( "script", function( s ) {
- if ( s.cache === undefined ) {
- s.cache = false;
- }
- if ( s.crossDomain ) {
- s.type = "GET";
- s.global = false;
- }
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function(s) {
-
- // This transport only deals with cross domain requests
- if ( s.crossDomain ) {
-
- var script,
- head = document.head || jQuery("head")[0] || document.documentElement;
-
- return {
-
- send: function( _, callback ) {
-
- script = document.createElement("script");
-
- script.async = true;
-
- if ( s.scriptCharset ) {
- script.charset = s.scriptCharset;
- }
-
- script.src = s.url;
-
- // Attach handlers for all browsers
- script.onload = script.onreadystatechange = function( _, isAbort ) {
-
- if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
-
- // Handle memory leak in IE
- script.onload = script.onreadystatechange = null;
-
- // Remove the script
- if ( script.parentNode ) {
- script.parentNode.removeChild( script );
- }
-
- // Dereference the script
- script = null;
-
- // Callback if not abort
- if ( !isAbort ) {
- callback( 200, "success" );
- }
- }
- };
-
- // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
- // Use native DOM manipulation to avoid our domManip AJAX trickery
- head.insertBefore( script, head.firstChild );
- },
-
- abort: function() {
- if ( script ) {
- script.onload( undefined, true );
- }
- }
- };
- }
-});
-
-
-
-
-var oldCallbacks = [],
- rjsonp = /(=)\?(?=&|$)|\?\?/;
-
-// Default jsonp settings
-jQuery.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
- this[ callback ] = true;
- return callback;
- }
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
- var callbackName, overwritten, responseContainer,
- jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
- "url" :
- typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
- );
-
- // Handle iff the expected data type is "jsonp" or we have a parameter to set
- if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
-
- // Get callback name, remembering preexisting value associated with it
- callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
- s.jsonpCallback() :
- s.jsonpCallback;
-
- // Insert callback into url or form data
- if ( jsonProp ) {
- s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
- } else if ( s.jsonp !== false ) {
- s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
- }
-
- // Use data converter to retrieve json after script execution
- s.converters["script json"] = function() {
- if ( !responseContainer ) {
- jQuery.error( callbackName + " was not called" );
- }
- return responseContainer[ 0 ];
- };
-
- // force json dataType
- s.dataTypes[ 0 ] = "json";
-
- // Install callback
- overwritten = window[ callbackName ];
- window[ callbackName ] = function() {
- responseContainer = arguments;
- };
-
- // Clean-up function (fires after converters)
- jqXHR.always(function() {
- // Restore preexisting value
- window[ callbackName ] = overwritten;
-
- // Save back as free
- if ( s[ callbackName ] ) {
- // make sure that re-using the options doesn't screw things around
- s.jsonpCallback = originalSettings.jsonpCallback;
-
- // save the callback name for future use
- oldCallbacks.push( callbackName );
- }
-
- // Call if it was a function and we have a response
- if ( responseContainer && jQuery.isFunction( overwritten ) ) {
- overwritten( responseContainer[ 0 ] );
- }
-
- responseContainer = overwritten = undefined;
- });
-
- // Delegate to script
- return "script";
- }
-});
-
-
-
-
-// data: string of html
-// context (optional): If specified, the fragment will be created in this context, defaults to document
-// keepScripts (optional): If true, will include scripts passed in the html string
-jQuery.parseHTML = function( data, context, keepScripts ) {
- if ( !data || typeof data !== "string" ) {
- return null;
- }
- if ( typeof context === "boolean" ) {
- keepScripts = context;
- context = false;
- }
- context = context || document;
-
- var parsed = rsingleTag.exec( data ),
- scripts = !keepScripts && [];
-
- // Single tag
- if ( parsed ) {
- return [ context.createElement( parsed[1] ) ];
- }
-
- parsed = jQuery.buildFragment( [ data ], context, scripts );
-
- if ( scripts && scripts.length ) {
- jQuery( scripts ).remove();
- }
-
- return jQuery.merge( [], parsed.childNodes );
-};
-
-
-// Keep a copy of the old load method
-var _load = jQuery.fn.load;
-
-/**
- * Load a url into a page
- */
-jQuery.fn.load = function( url, params, callback ) {
- if ( typeof url !== "string" && _load ) {
- return _load.apply( this, arguments );
- }
-
- var selector, response, type,
- self = this,
- off = url.indexOf(" ");
-
- if ( off >= 0 ) {
- selector = jQuery.trim( url.slice( off, url.length ) );
- url = url.slice( 0, off );
- }
-
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
-
- // We assume that it's the callback
- callback = params;
- params = undefined;
-
- // Otherwise, build a param string
- } else if ( params && typeof params === "object" ) {
- type = "POST";
- }
-
- // If we have elements to modify, make the request
- if ( self.length > 0 ) {
- jQuery.ajax({
- url: url,
-
- // if "type" variable is undefined, then "GET" method will be used
- type: type,
- dataType: "html",
- data: params
- }).done(function( responseText ) {
-
- // Save response for use in complete callback
- response = arguments;
-
- self.html( selector ?
-
- // If a selector was specified, locate the right elements in a dummy div
- // Exclude scripts to avoid IE 'Permission Denied' errors
- jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
-
- // Otherwise use the full result
- responseText );
-
- }).complete( callback && function( jqXHR, status ) {
- self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
- });
- }
-
- return this;
-};
-
-
-
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
- jQuery.fn[ type ] = function( fn ) {
- return this.on( type, fn );
- };
-});
-
-
-
-
-jQuery.expr.filters.animated = function( elem ) {
- return jQuery.grep(jQuery.timers, function( fn ) {
- return elem === fn.elem;
- }).length;
-};
-
-
-
-
-
-var docElem = window.document.documentElement;
-
-/**
- * Gets a window from an element
- */
-function getWindow( elem ) {
- return jQuery.isWindow( elem ) ?
- elem :
- elem.nodeType === 9 ?
- elem.defaultView || elem.parentWindow :
- false;
-}
-
-jQuery.offset = {
- setOffset: function( elem, options, i ) {
- var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
- position = jQuery.css( elem, "position" ),
- curElem = jQuery( elem ),
- props = {};
-
- // set position first, in-case top/left are set even on static elem
- if ( position === "static" ) {
- elem.style.position = "relative";
- }
-
- curOffset = curElem.offset();
- curCSSTop = jQuery.css( elem, "top" );
- curCSSLeft = jQuery.css( elem, "left" );
- calculatePosition = ( position === "absolute" || position === "fixed" ) &&
- jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
-
- // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
- if ( calculatePosition ) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
- } else {
- curTop = parseFloat( curCSSTop ) || 0;
- curLeft = parseFloat( curCSSLeft ) || 0;
- }
-
- if ( jQuery.isFunction( options ) ) {
- options = options.call( elem, i, curOffset );
- }
-
- if ( options.top != null ) {
- props.top = ( options.top - curOffset.top ) + curTop;
- }
- if ( options.left != null ) {
- props.left = ( options.left - curOffset.left ) + curLeft;
- }
-
- if ( "using" in options ) {
- options.using.call( elem, props );
- } else {
- curElem.css( props );
- }
- }
-};
-
-jQuery.fn.extend({
- offset: function( options ) {
- if ( arguments.length ) {
- return options === undefined ?
- this :
- this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- var docElem, win,
- box = { top: 0, left: 0 },
- elem = this[ 0 ],
- doc = elem && elem.ownerDocument;
-
- if ( !doc ) {
- return;
- }
-
- docElem = doc.documentElement;
-
- // Make sure it's not a disconnected DOM node
- if ( !jQuery.contains( docElem, elem ) ) {
- return box;
- }
-
- // If we don't have gBCR, just use 0,0 rather than error
- // BlackBerry 5, iOS 3 (original iPhone)
- if ( typeof elem.getBoundingClientRect !== strundefined ) {
- box = elem.getBoundingClientRect();
- }
- win = getWindow( doc );
- return {
- top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
- left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
- };
- },
-
- position: function() {
- if ( !this[ 0 ] ) {
- return;
- }
-
- var offsetParent, offset,
- parentOffset = { top: 0, left: 0 },
- elem = this[ 0 ];
-
- // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
- if ( jQuery.css( elem, "position" ) === "fixed" ) {
- // we assume that getBoundingClientRect is available when computed position is fixed
- offset = elem.getBoundingClientRect();
- } else {
- // Get *real* offsetParent
- offsetParent = this.offsetParent();
-
- // Get correct offsets
- offset = this.offset();
- if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
- parentOffset = offsetParent.offset();
- }
-
- // Add offsetParent borders
- parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
- parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
- }
-
- // Subtract parent offsets and element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- return {
- top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
- left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
- };
- },
-
- offsetParent: function() {
- return this.map(function() {
- var offsetParent = this.offsetParent || docElem;
-
- while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent || docElem;
- });
- }
-});
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
- var top = /Y/.test( prop );
-
- jQuery.fn[ method ] = function( val ) {
- return access( this, function( elem, method, val ) {
- var win = getWindow( elem );
-
- if ( val === undefined ) {
- return win ? (prop in win) ? win[ prop ] :
- win.document.documentElement[ method ] :
- elem[ method ];
- }
-
- if ( win ) {
- win.scrollTo(
- !top ? val : jQuery( win ).scrollLeft(),
- top ? val : jQuery( win ).scrollTop()
- );
-
- } else {
- elem[ method ] = val;
- }
- }, method, val, arguments.length, null );
- };
-});
-
-// Add the top/left cssHooks using jQuery.fn.position
-// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
-// getComputedStyle returns percent when specified for top/left/bottom/right
-// rather than make the css module depend on the offset module, we just check for it here
-jQuery.each( [ "top", "left" ], function( i, prop ) {
- jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
- function( elem, computed ) {
- if ( computed ) {
- computed = curCSS( elem, prop );
- // if curCSS returns percentage, fallback to offset
- return rnumnonpx.test( computed ) ?
- jQuery( elem ).position()[ prop ] + "px" :
- computed;
- }
- }
- );
-});
-
-
-// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
- // margin is only for outerHeight, outerWidth
- jQuery.fn[ funcName ] = function( margin, value ) {
- var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
- extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
-
- return access( this, function( elem, type, value ) {
- var doc;
-
- if ( jQuery.isWindow( elem ) ) {
- // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
- // isn't a whole lot we can do. See pull request at this URL for discussion:
- // https://github.com/jquery/jquery/pull/764
- return elem.document.documentElement[ "client" + name ];
- }
-
- // Get document width or height
- if ( elem.nodeType === 9 ) {
- doc = elem.documentElement;
-
- // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
- // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
- return Math.max(
- elem.body[ "scroll" + name ], doc[ "scroll" + name ],
- elem.body[ "offset" + name ], doc[ "offset" + name ],
- doc[ "client" + name ]
- );
- }
-
- return value === undefined ?
- // Get width or height on the element, requesting but not forcing parseFloat
- jQuery.css( elem, type, extra ) :
-
- // Set width or height on the element
- jQuery.style( elem, type, value, extra );
- }, type, chainable ? margin : undefined, chainable, null );
- };
- });
-});
-
-
-// The number of elements contained in the matched element set
-jQuery.fn.size = function() {
- return this.length;
-};
-
-jQuery.fn.andSelf = jQuery.fn.addBack;
-
-
-
-
-// Register as a named AMD module, since jQuery can be concatenated with other
-// files that may use define, but not via a proper concatenation script that
-// understands anonymous AMD modules. A named AMD is safest and most robust
-// way to register. Lowercase jquery is used because AMD module names are
-// derived from file names, and jQuery is normally delivered in a lowercase
-// file name. Do this after creating the global so that if an AMD module wants
-// to call noConflict to hide this version of jQuery, it will work.
-
-// Note that for maximum portability, libraries that are not jQuery should
-// declare themselves as anonymous modules, and avoid setting a global if an
-// AMD loader is present. jQuery is a special case. For more information, see
-// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
-
-if ( typeof define === "function" && define.amd ) {
- define( "jquery", [], function() {
- return jQuery;
- });
-}
-
-
-
-
-var
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$;
-
-jQuery.noConflict = function( deep ) {
- if ( window.$ === jQuery ) {
- window.$ = _$;
- }
-
- if ( deep && window.jQuery === jQuery ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
-};
-
-// Expose jQuery and $ identifiers, even in
-// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
-// and CommonJS for browser emulators (#13566)
-if ( typeof noGlobal === strundefined ) {
- window.jQuery = window.$ = jQuery;
-}
-
-
-
-
-return jQuery;
-
-
-}));
diff --git a/docs/_build/html/_static/minus.png b/docs/_build/html/_static/minus.png
deleted file mode 100644
index 0f22b16..0000000
Binary files a/docs/_build/html/_static/minus.png and /dev/null differ
diff --git a/docs/_build/html/_static/plus.png b/docs/_build/html/_static/plus.png
deleted file mode 100644
index 0cfe084..0000000
Binary files a/docs/_build/html/_static/plus.png and /dev/null differ
diff --git a/docs/_build/html/_static/pygments.css b/docs/_build/html/_static/pygments.css
deleted file mode 100644
index 8213e90..0000000
--- a/docs/_build/html/_static/pygments.css
+++ /dev/null
@@ -1,65 +0,0 @@
-.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 .ch { color: #408090; font-style: italic } /* Comment.Hashbang */
-.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
-.highlight .cp { color: #007020 } /* Comment.Preproc */
-.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */
-.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: #333333 } /* 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: #0044DD } /* 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 .mb { color: #208050 } /* Literal.Number.Bin */
-.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/docs/_build/html/_static/pywps.png b/docs/_build/html/_static/pywps.png
deleted file mode 100644
index 505e2fe..0000000
Binary files a/docs/_build/html/_static/pywps.png and /dev/null differ
diff --git a/docs/_build/html/_static/searchtools.js b/docs/_build/html/_static/searchtools.js
deleted file mode 100644
index cb74467..0000000
--- a/docs/_build/html/_static/searchtools.js
+++ /dev/null
@@ -1,651 +0,0 @@
-/*
- * searchtools.js_t
- * ~~~~~~~~~~~~~~~~
- *
- * Sphinx JavaScript utilties for the full-text search.
- *
- * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
- */
-
-
-/* Non-minified version JS is _stemmer.js if file is provided */
-/**
- * Porter Stemmer
- */
-var Stemmer = 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;
- }
-}
-
-
-
-/**
- * Simple result scoring code.
- */
-var Scorer = {
- // Implement the following function to further tweak the score for each result
- // The function takes a result array [filename, title, anchor, descr, score]
- // and returns the new score.
- /*
- score: function(result) {
- return result[4];
- },
- */
-
- // query matches the full name of an object
- objNameMatch: 11,
- // or matches in the last dotted part of the object name
- objPartialMatch: 6,
- // Additive scores depending on the priority of the object
- objPrio: {0: 15, // used to be importantResults
- 1: 5, // used to be objectResults
- 2: -5}, // used to be unimportantResults
- // Used when the priority is not in the mapping.
- objPrioDefault: 0,
-
- // query found in title
- title: 15,
- // query found in terms
- term: 5
-};
-
-
-/**
- * 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,
- dataType: "script", cache: true,
- complete: function(jqxhr, textstatus) {
- if (textstatus != "success") {
- document.getElementById("searchindexloader").src = url;
- }
- }});
- },
-
- 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() {
- var i;
- Search._pulse_status = (Search._pulse_status + 1) % 4;
- var dotString = '';
- for (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 (or wait until index is loaded)
- */
- performSearch : function(query) {
- // create the required interface elements
- this.out = $('#search-results');
- this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
- this.dots = $('<span></span>').appendTo(this.title);
- this.status = $('<p style="display: none"></p>').appendTo(this.out);
- this.output = $('<ul class="search"/>').appendTo(this.out);
-
- $('#search-progress').text(_('Preparing search...'));
- this.startPulse();
-
- // index already loaded, the browser was quick!
- if (this.hasIndex())
- this.query(query);
- else
- this.deferQuery(query);
- },
-
- /**
- * execute search (requires search index to be loaded)
- */
- query : function(query) {
- var i;
- var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
-
- // stem the searchterms and add them to the correct list
- var stemmer = new Stemmer();
- var searchterms = [];
- var excluded = [];
- var hlterms = [];
- var tmp = query.split(/\s+/);
- var objectterms = [];
- for (i = 0; i < tmp.length; i++) {
- if (tmp[i] !== "") {
- objectterms.push(tmp[i].toLowerCase());
- }
-
- if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
- tmp[i] === "") {
- // skip this "word"
- continue;
- }
- // stem the word
- var word = stemmer.stemWord(tmp[i].toLowerCase());
- var toAppend;
- // select the correct list
- if (word[0] == '-') {
- toAppend = excluded;
- word = word.substr(1);
- }
- else {
- toAppend = searchterms;
- hlterms.push(tmp[i].toLowerCase());
- }
- // only add if not already in the list
- if (!$u.contains(toAppend, word))
- toAppend.push(word);
- }
- var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
-
- // console.debug('SEARCH: searching for:');
- // console.info('required: ', searchterms);
- // console.info('excluded: ', excluded);
-
- // prepare search
- var terms = this._index.terms;
- var titleterms = this._index.titleterms;
-
- // array of [filename, title, anchor, descr, score]
- var results = [];
- $('#search-progress').empty();
-
- // lookup as object
- for (i = 0; i < objectterms.length; i++) {
- var others = [].concat(objectterms.slice(0, i),
- objectterms.slice(i+1, objectterms.length));
- results = results.concat(this.performObjectSearch(objectterms[i], others));
- }
-
- // lookup as search terms in fulltext
- results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
-
- // let the scorer override scores with a custom scoring function
- if (Scorer.score) {
- for (i = 0; i < results.length; i++)
- results[i][4] = Scorer.score(results[i]);
- }
-
- // now sort the results by score (in opposite order of appearance, since the
- // display function below uses pop() to retrieve items) and then
- // alphabetically
- results.sort(function(a, b) {
- var left = a[4];
- var right = b[4];
- if (left > right) {
- return 1;
- } else if (left < right) {
- return -1;
- } else {
- // same score: sort alphabetically
- left = a[1].toLowerCase();
- right = b[1].toLowerCase();
- return (left > right) ? -1 : ((left < right) ? 1 : 0);
- }
- });
-
- // for debugging
- //Search.lastresults = results.slice(); // a copy
- //console.info('search results:', Search.lastresults);
-
- // print the results
- var resultCount = results.length;
- function displayNextItem() {
- // results left, load the summary and display it
- if (results.length) {
- var item = results.pop();
- var listItem = $('<li style="display:none"></li>');
- if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
- // dirhtml builder
- var dirname = item[0] + '/';
- if (dirname.match(/\/index\/$/)) {
- dirname = dirname.substring(0, dirname.length-6);
- } else if (dirname == 'index/') {
- dirname = '';
- }
- listItem.append($('<a/>').attr('href',
- DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
- highlightstring + item[2]).html(item[1]));
- } else {
- // normal html builders
- listItem.append($('<a/>').attr('href',
- item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
- highlightstring + item[2]).html(item[1]));
- }
- if (item[3]) {
- listItem.append($('<span> (' + item[3] + ')</span>'));
- Search.output.append(listItem);
- listItem.slideDown(5, function() {
- displayNextItem();
- });
- } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
- $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[0] + '.txt',
- dataType: "text",
- complete: function(jqxhr, textstatus) {
- var data = jqxhr.responseText;
- if (data !== '' && data !== undefined) {
- listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
- }
- Search.output.append(listItem);
- listItem.slideDown(5, function() {
- displayNextItem();
- });
- }});
- } else {
- // no source available, just display title
- Search.output.append(listItem);
- listItem.slideDown(5, function() {
- displayNextItem();
- });
- }
- }
- // search finished, update title and status message
- else {
- Search.stopPulse();
- Search.title.text(_('Search Results'));
- if (!resultCount)
- Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
- else
- Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
- Search.status.fadeIn(500);
- }
- }
- displayNextItem();
- },
-
- /**
- * search for object names
- */
- performObjectSearch : function(object, otherterms) {
- var filenames = this._index.filenames;
- var objects = this._index.objects;
- var objnames = this._index.objnames;
- var titles = this._index.titles;
-
- var i;
- var results = [];
-
- for (var prefix in objects) {
- for (var name in objects[prefix]) {
- var fullname = (prefix ? prefix + '.' : '') + name;
- if (fullname.toLowerCase().indexOf(object) > -1) {
- var score = 0;
- var parts = fullname.split('.');
- // check for different match types: exact matches of full name or
- // "last name" (i.e. last dotted part)
- if (fullname == object || parts[parts.length - 1] == object) {
- score += Scorer.objNameMatch;
- // matches in last name
- } else if (parts[parts.length - 1].indexOf(object) > -1) {
- score += Scorer.objPartialMatch;
- }
- var match = objects[prefix][name];
- var objname = objnames[match[1]][2];
- var title = titles[match[0]];
- // If more than one term searched for, we require other words to be
- // found in the name/title/description
- if (otherterms.length > 0) {
- var haystack = (prefix + ' ' + name + ' ' +
- objname + ' ' + title).toLowerCase();
- var allfound = true;
- for (i = 0; i < otherterms.length; i++) {
- if (haystack.indexOf(otherterms[i]) == -1) {
- allfound = false;
- break;
- }
- }
- if (!allfound) {
- continue;
- }
- }
- var descr = objname + _(', in ') + title;
-
- var anchor = match[3];
- if (anchor === '')
- anchor = fullname;
- else if (anchor == '-')
- anchor = objnames[match[1]][1] + '-' + fullname;
- // add custom score for some objects according to scorer
- if (Scorer.objPrio.hasOwnProperty(match[2])) {
- score += Scorer.objPrio[match[2]];
- } else {
- score += Scorer.objPrioDefault;
- }
- results.push([filenames[match[0]], fullname, '#'+anchor, descr, score]);
- }
- }
- }
-
- return results;
- },
-
- /**
- * search for full-text terms in the index
- */
- performTermsSearch : function(searchterms, excluded, terms, titleterms) {
- var filenames = this._index.filenames;
- var titles = this._index.titles;
-
- var i, j, file;
- var fileMap = {};
- var scoreMap = {};
- var results = [];
-
- // perform the search on the required terms
- for (i = 0; i < searchterms.length; i++) {
- var word = searchterms[i];
- var files = [];
- var _o = [
- {files: terms[word], score: Scorer.term},
- {files: titleterms[word], score: Scorer.title}
- ];
-
- // no match but word was a required one
- if ($u.every(_o, function(o){return o.files === undefined;})) {
- break;
- }
- // found search word in contents
- $u.each(_o, function(o) {
- var _files = o.files;
- if (_files === undefined)
- return
-
- if (_files.length === undefined)
- _files = [_files];
- files = files.concat(_files);
-
- // set score for the word in each file to Scorer.term
- for (j = 0; j < _files.length; j++) {
- file = _files[j];
- if (!(file in scoreMap))
- scoreMap[file] = {}
- scoreMap[file][word] = o.score;
- }
- });
-
- // create the mapping
- for (j = 0; j < files.length; j++) {
- file = files[j];
- if (file in fileMap)
- fileMap[file].push(word);
- else
- fileMap[file] = [word];
- }
- }
-
- // now check if the files don't contain excluded terms
- for (file in fileMap) {
- var valid = true;
-
- // check if all requirements are matched
- if (fileMap[file].length != searchterms.length)
- continue;
-
- // ensure that none of the excluded terms is in the search result
- for (i = 0; i < excluded.length; i++) {
- if (terms[excluded[i]] == file ||
- titleterms[excluded[i]] == file ||
- $u.contains(terms[excluded[i]] || [], file) ||
- $u.contains(titleterms[excluded[i]] || [], file)) {
- valid = false;
- break;
- }
- }
-
- // if we have still a valid result we can add it to the result list
- if (valid) {
- // select one (max) score for the file.
- // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
- var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
- results.push([filenames[file], titles[file], '', null, score]);
- }
- }
- return results;
- },
-
- /**
- * 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.
- */
- 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 = $('<div class="context"></div>').text(excerpt);
- $.each(hlwords, function() {
- rv = rv.highlightText(this, 'highlighted');
- });
- return rv;
- }
-};
-
-$(document).ready(function() {
- Search.init();
-});
\ No newline at end of file
diff --git a/docs/_build/html/_static/sidebar.js b/docs/_build/html/_static/sidebar.js
deleted file mode 100644
index 4282fe9..0000000
--- a/docs/_build/html/_static/sidebar.js
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * sidebar.js
- * ~~~~~~~~~~
- *
- * This script makes the Sphinx sidebar collapsible.
- *
- * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds
- * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton
- * used to collapse and expand the sidebar.
- *
- * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden
- * and the width of the sidebar and the margin-left of the document
- * are decreased. When the sidebar is expanded the opposite happens.
- * This script saves a per-browser/per-session cookie used to
- * remember the position of the sidebar among the pages.
- * Once the browser is closed the cookie is deleted and the position
- * reset to the default (expanded).
- *
- * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
- */
-
-$(function() {
-
-
-
-
-
-
-
-
- // global elements used by the functions.
- // the 'sidebarbutton' element is defined as global after its
- // creation, in the add_sidebar_button function
- var bodywrapper = $('.bodywrapper');
- var sidebar = $('.sphinxsidebar');
- var sidebarwrapper = $('.sphinxsidebarwrapper');
-
- // for some reason, the document has no sidebar; do not run into errors
- if (!sidebar.length) return;
-
- // original margin-left of the bodywrapper and width of the sidebar
- // with the sidebar expanded
- var bw_margin_expanded = bodywrapper.css('margin-left');
- var ssb_width_expanded = sidebar.width();
-
- // margin-left of the bodywrapper and width of the sidebar
- // with the sidebar collapsed
- var bw_margin_collapsed = '.8em';
- var ssb_width_collapsed = '.8em';
-
- // colors used by the current theme
- var dark_color = $('.related').css('background-color');
- var light_color = $('.document').css('background-color');
-
- function sidebar_is_collapsed() {
- return sidebarwrapper.is(':not(:visible)');
- }
-
- function toggle_sidebar() {
- if (sidebar_is_collapsed())
- expand_sidebar();
- else
- collapse_sidebar();
- }
-
- function collapse_sidebar() {
- sidebarwrapper.hide();
- sidebar.css('width', ssb_width_collapsed);
- bodywrapper.css('margin-left', bw_margin_collapsed);
- sidebarbutton.css({
- 'margin-left': '0',
- 'height': bodywrapper.height()
- });
- sidebarbutton.find('span').text('»');
- sidebarbutton.attr('title', _('Expand sidebar'));
- document.cookie = 'sidebar=collapsed';
- }
-
- function expand_sidebar() {
- bodywrapper.css('margin-left', bw_margin_expanded);
- sidebar.css('width', ssb_width_expanded);
- sidebarwrapper.show();
- sidebarbutton.css({
- 'margin-left': ssb_width_expanded-12,
- 'height': bodywrapper.height()
- });
- sidebarbutton.find('span').text('«');
- sidebarbutton.attr('title', _('Collapse sidebar'));
- document.cookie = 'sidebar=expanded';
- }
-
- function add_sidebar_button() {
- sidebarwrapper.css({
- 'float': 'left',
- 'margin-right': '0',
- 'width': ssb_width_expanded - 28
- });
- // create the button
- sidebar.append(
- '<div id="sidebarbutton"><span>«</span></div>'
- );
- var sidebarbutton = $('#sidebarbutton');
- light_color = sidebarbutton.css('background-color');
- // find the height of the viewport to center the '<<' in the page
- var viewport_height;
- if (window.innerHeight)
- viewport_height = window.innerHeight;
- else
- viewport_height = $(window).height();
- sidebarbutton.find('span').css({
- 'display': 'block',
- 'margin-top': (viewport_height - sidebar.position().top - 20) / 2
- });
-
- sidebarbutton.click(toggle_sidebar);
- sidebarbutton.attr('title', _('Collapse sidebar'));
- sidebarbutton.css({
- 'color': '#FFFFFF',
- 'border-left': '1px solid ' + dark_color,
- 'font-size': '1.2em',
- 'cursor': 'pointer',
- 'height': bodywrapper.height(),
- 'padding-top': '1px',
- 'margin-left': ssb_width_expanded - 12
- });
-
- sidebarbutton.hover(
- function () {
- $(this).css('background-color', dark_color);
- },
- function () {
- $(this).css('background-color', light_color);
- }
- );
- }
-
- function set_position_from_cookie() {
- if (!document.cookie)
- return;
- var items = document.cookie.split(';');
- for(var k=0; k<items.length; k++) {
- var key_val = items[k].split('=');
- var key = key_val[0].replace(/ /, ""); // strip leading spaces
- if (key == 'sidebar') {
- var value = key_val[1];
- if ((value == 'collapsed') && (!sidebar_is_collapsed()))
- collapse_sidebar();
- else if ((value == 'expanded') && (sidebar_is_collapsed()))
- expand_sidebar();
- }
- }
- }
-
- add_sidebar_button();
- var sidebarbutton = $('#sidebarbutton');
- set_position_from_cookie();
-});
\ No newline at end of file
diff --git a/docs/_build/html/_static/underscore.js b/docs/_build/html/_static/underscore.js
deleted file mode 100644
index b4f49a0..0000000
--- a/docs/_build/html/_static/underscore.js
+++ /dev/null
@@ -1,1415 +0,0 @@
-// Underscore.js 1.7.0
-// http://underscorejs.org
-// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-// Underscore may be freely distributed under the MIT license.
-
-(function() {
-
- // Baseline setup
- // --------------
-
- // Establish the root object, `window` in the browser, or `exports` on the server.
- var root = this;
-
- // Save the previous value of the `_` variable.
- var previousUnderscore = root._;
-
- // Save bytes in the minified (but not gzipped) version:
- var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
-
- // Create quick reference variables for speed access to core prototypes.
- var
- push = ArrayProto.push,
- slice = ArrayProto.slice,
- concat = ArrayProto.concat,
- toString = ObjProto.toString,
- hasOwnProperty = ObjProto.hasOwnProperty;
-
- // All **ECMAScript 5** native function implementations that we hope to use
- // are declared here.
- var
- nativeIsArray = Array.isArray,
- nativeKeys = Object.keys,
- nativeBind = FuncProto.bind;
-
- // Create a safe reference to the Underscore object for use below.
- var _ = function(obj) {
- if (obj instanceof _) return obj;
- if (!(this instanceof _)) return new _(obj);
- this._wrapped = obj;
- };
-
- // Export the Underscore object for **Node.js**, with
- // backwards-compatibility for the old `require()` API. If we're in
- // the browser, add `_` as a global object.
- if (typeof exports !== 'undefined') {
- if (typeof module !== 'undefined' && module.exports) {
- exports = module.exports = _;
- }
- exports._ = _;
- } else {
- root._ = _;
- }
-
- // Current version.
- _.VERSION = '1.7.0';
-
- // Internal function that returns an efficient (for current engines) version
- // of the passed-in callback, to be repeatedly applied in other Underscore
- // functions.
- var createCallback = function(func, context, argCount) {
- if (context === void 0) return func;
- switch (argCount == null ? 3 : argCount) {
- case 1: return function(value) {
- return func.call(context, value);
- };
- case 2: return function(value, other) {
- return func.call(context, value, other);
- };
- case 3: return function(value, index, collection) {
- return func.call(context, value, index, collection);
- };
- case 4: return function(accumulator, value, index, collection) {
- return func.call(context, accumulator, value, index, collection);
- };
- }
- return function() {
- return func.apply(context, arguments);
- };
- };
-
- // A mostly-internal function to generate callbacks that can be applied
- // to each element in a collection, returning the desired result — either
- // identity, an arbitrary callback, a property matcher, or a property accessor.
- _.iteratee = function(value, context, argCount) {
- if (value == null) return _.identity;
- if (_.isFunction(value)) return createCallback(value, context, argCount);
- if (_.isObject(value)) return _.matches(value);
- return _.property(value);
- };
-
- // Collection Functions
- // --------------------
-
- // The cornerstone, an `each` implementation, aka `forEach`.
- // Handles raw objects in addition to array-likes. Treats all
- // sparse array-likes as if they were dense.
- _.each = _.forEach = function(obj, iteratee, context) {
- if (obj == null) return obj;
- iteratee = createCallback(iteratee, context);
- var i, length = obj.length;
- if (length === +length) {
- for (i = 0; i < length; i++) {
- iteratee(obj[i], i, obj);
- }
- } else {
- var keys = _.keys(obj);
- for (i = 0, length = keys.length; i < length; i++) {
- iteratee(obj[keys[i]], keys[i], obj);
- }
- }
- return obj;
- };
-
- // Return the results of applying the iteratee to each element.
- _.map = _.collect = function(obj, iteratee, context) {
- if (obj == null) return [];
- iteratee = _.iteratee(iteratee, context);
- var keys = obj.length !== +obj.length && _.keys(obj),
- length = (keys || obj).length,
- results = Array(length),
- currentKey;
- for (var index = 0; index < length; index++) {
- currentKey = keys ? keys[index] : index;
- results[index] = iteratee(obj[currentKey], currentKey, obj);
- }
- return results;
- };
-
- var reduceError = 'Reduce of empty array with no initial value';
-
- // **Reduce** builds up a single result from a list of values, aka `inject`,
- // or `foldl`.
- _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) {
- if (obj == null) obj = [];
- iteratee = createCallback(iteratee, context, 4);
- var keys = obj.length !== +obj.length && _.keys(obj),
- length = (keys || obj).length,
- index = 0, currentKey;
- if (arguments.length < 3) {
- if (!length) throw new TypeError(reduceError);
- memo = obj[keys ? keys[index++] : index++];
- }
- for (; index < length; index++) {
- currentKey = keys ? keys[index] : index;
- memo = iteratee(memo, obj[currentKey], currentKey, obj);
- }
- return memo;
- };
-
- // The right-associative version of reduce, also known as `foldr`.
- _.reduceRight = _.foldr = function(obj, iteratee, memo, context) {
- if (obj == null) obj = [];
- iteratee = createCallback(iteratee, context, 4);
- var keys = obj.length !== + obj.length && _.keys(obj),
- index = (keys || obj).length,
- currentKey;
- if (arguments.length < 3) {
- if (!index) throw new TypeError(reduceError);
- memo = obj[keys ? keys[--index] : --index];
- }
- while (index--) {
- currentKey = keys ? keys[index] : index;
- memo = iteratee(memo, obj[currentKey], currentKey, obj);
- }
- return memo;
- };
-
- // Return the first value which passes a truth test. Aliased as `detect`.
- _.find = _.detect = function(obj, predicate, context) {
- var result;
- predicate = _.iteratee(predicate, context);
- _.some(obj, function(value, index, list) {
- if (predicate(value, index, list)) {
- result = value;
- return true;
- }
- });
- return result;
- };
-
- // Return all the elements that pass a truth test.
- // Aliased as `select`.
- _.filter = _.select = function(obj, predicate, context) {
- var results = [];
- if (obj == null) return results;
- predicate = _.iteratee(predicate, context);
- _.each(obj, function(value, index, list) {
- if (predicate(value, index, list)) results.push(value);
- });
- return results;
- };
-
- // Return all the elements for which a truth test fails.
- _.reject = function(obj, predicate, context) {
- return _.filter(obj, _.negate(_.iteratee(predicate)), context);
- };
-
- // Determine whether all of the elements match a truth test.
- // Aliased as `all`.
- _.every = _.all = function(obj, predicate, context) {
- if (obj == null) return true;
- predicate = _.iteratee(predicate, context);
- var keys = obj.length !== +obj.length && _.keys(obj),
- length = (keys || obj).length,
- index, currentKey;
- for (index = 0; index < length; index++) {
- currentKey = keys ? keys[index] : index;
- if (!predicate(obj[currentKey], currentKey, obj)) return false;
- }
- return true;
- };
-
- // Determine if at least one element in the object matches a truth test.
- // Aliased as `any`.
- _.some = _.any = function(obj, predicate, context) {
- if (obj == null) return false;
- predicate = _.iteratee(predicate, context);
- var keys = obj.length !== +obj.length && _.keys(obj),
- length = (keys || obj).length,
- index, currentKey;
- for (index = 0; index < length; index++) {
- currentKey = keys ? keys[index] : index;
- if (predicate(obj[currentKey], currentKey, obj)) return true;
- }
- return false;
- };
-
- // Determine if the array or object contains a given value (using `===`).
- // Aliased as `include`.
- _.contains = _.include = function(obj, target) {
- if (obj == null) return false;
- if (obj.length !== +obj.length) obj = _.values(obj);
- return _.indexOf(obj, target) >= 0;
- };
-
- // Invoke a method (with arguments) on every item in a collection.
- _.invoke = function(obj, method) {
- var args = slice.call(arguments, 2);
- var isFunc = _.isFunction(method);
- return _.map(obj, function(value) {
- return (isFunc ? method : value[method]).apply(value, args);
- });
- };
-
- // Convenience version of a common use case of `map`: fetching a property.
- _.pluck = function(obj, key) {
- return _.map(obj, _.property(key));
- };
-
- // Convenience version of a common use case of `filter`: selecting only objects
- // containing specific `key:value` pairs.
- _.where = function(obj, attrs) {
- return _.filter(obj, _.matches(attrs));
- };
-
- // Convenience version of a common use case of `find`: getting the first object
- // containing specific `key:value` pairs.
- _.findWhere = function(obj, attrs) {
- return _.find(obj, _.matches(attrs));
- };
-
- // Return the maximum element (or element-based computation).
- _.max = function(obj, iteratee, context) {
- var result = -Infinity, lastComputed = -Infinity,
- value, computed;
- if (iteratee == null && obj != null) {
- obj = obj.length === +obj.length ? obj : _.values(obj);
- for (var i = 0, length = obj.length; i < length; i++) {
- value = obj[i];
- if (value > result) {
- result = value;
- }
- }
- } else {
- iteratee = _.iteratee(iteratee, context);
- _.each(obj, function(value, index, list) {
- computed = iteratee(value, index, list);
- if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
- result = value;
- lastComputed = computed;
- }
- });
- }
- return result;
- };
-
- // Return the minimum element (or element-based computation).
- _.min = function(obj, iteratee, context) {
- var result = Infinity, lastComputed = Infinity,
- value, computed;
- if (iteratee == null && obj != null) {
- obj = obj.length === +obj.length ? obj : _.values(obj);
- for (var i = 0, length = obj.length; i < length; i++) {
- value = obj[i];
- if (value < result) {
- result = value;
- }
- }
- } else {
- iteratee = _.iteratee(iteratee, context);
- _.each(obj, function(value, index, list) {
- computed = iteratee(value, index, list);
- if (computed < lastComputed || computed === Infinity && result === Infinity) {
- result = value;
- lastComputed = computed;
- }
- });
- }
- return result;
- };
-
- // Shuffle a collection, using the modern version of the
- // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
- _.shuffle = function(obj) {
- var set = obj && obj.length === +obj.length ? obj : _.values(obj);
- var length = set.length;
- var shuffled = Array(length);
- for (var index = 0, rand; index < length; index++) {
- rand = _.random(0, index);
- if (rand !== index) shuffled[index] = shuffled[rand];
- shuffled[rand] = set[index];
- }
- return shuffled;
- };
-
- // Sample **n** random values from a collection.
- // If **n** is not specified, returns a single random element.
- // The internal `guard` argument allows it to work with `map`.
- _.sample = function(obj, n, guard) {
- if (n == null || guard) {
- if (obj.length !== +obj.length) obj = _.values(obj);
- return obj[_.random(obj.length - 1)];
- }
- return _.shuffle(obj).slice(0, Math.max(0, n));
- };
-
- // Sort the object's values by a criterion produced by an iteratee.
- _.sortBy = function(obj, iteratee, context) {
- iteratee = _.iteratee(iteratee, context);
- return _.pluck(_.map(obj, function(value, index, list) {
- return {
- value: value,
- index: index,
- criteria: iteratee(value, index, list)
- };
- }).sort(function(left, right) {
- var a = left.criteria;
- var b = right.criteria;
- if (a !== b) {
- if (a > b || a === void 0) return 1;
- if (a < b || b === void 0) return -1;
- }
- return left.index - right.index;
- }), 'value');
- };
-
- // An internal function used for aggregate "group by" operations.
- var group = function(behavior) {
- return function(obj, iteratee, context) {
- var result = {};
- iteratee = _.iteratee(iteratee, context);
- _.each(obj, function(value, index) {
- var key = iteratee(value, index, obj);
- behavior(result, value, key);
- });
- return result;
- };
- };
-
- // Groups the object's values by a criterion. Pass either a string attribute
- // to group by, or a function that returns the criterion.
- _.groupBy = group(function(result, value, key) {
- if (_.has(result, key)) result[key].push(value); else result[key] = [value];
- });
-
- // Indexes the object's values by a criterion, similar to `groupBy`, but for
- // when you know that your index values will be unique.
- _.indexBy = group(function(result, value, key) {
- result[key] = value;
- });
-
- // Counts instances of an object that group by a certain criterion. Pass
- // either a string attribute to count by, or a function that returns the
- // criterion.
- _.countBy = group(function(result, value, key) {
- if (_.has(result, key)) result[key]++; else result[key] = 1;
- });
-
- // Use a comparator function to figure out the smallest index at which
- // an object should be inserted so as to maintain order. Uses binary search.
- _.sortedIndex = function(array, obj, iteratee, context) {
- iteratee = _.iteratee(iteratee, context, 1);
- var value = iteratee(obj);
- var low = 0, high = array.length;
- while (low < high) {
- var mid = low + high >>> 1;
- if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
- }
- return low;
- };
-
- // Safely create a real, live array from anything iterable.
- _.toArray = function(obj) {
- if (!obj) return [];
- if (_.isArray(obj)) return slice.call(obj);
- if (obj.length === +obj.length) return _.map(obj, _.identity);
- return _.values(obj);
- };
-
- // Return the number of elements in an object.
- _.size = function(obj) {
- if (obj == null) return 0;
- return obj.length === +obj.length ? obj.length : _.keys(obj).length;
- };
-
- // Split a collection into two arrays: one whose elements all satisfy the given
- // predicate, and one whose elements all do not satisfy the predicate.
- _.partition = function(obj, predicate, context) {
- predicate = _.iteratee(predicate, context);
- var pass = [], fail = [];
- _.each(obj, function(value, key, obj) {
- (predicate(value, key, obj) ? pass : fail).push(value);
- });
- return [pass, fail];
- };
-
- // Array Functions
- // ---------------
-
- // Get the first element of an array. Passing **n** will return the first N
- // values in the array. Aliased as `head` and `take`. The **guard** check
- // allows it to work with `_.map`.
- _.first = _.head = _.take = function(array, n, guard) {
- if (array == null) return void 0;
- if (n == null || guard) return array[0];
- if (n < 0) return [];
- return slice.call(array, 0, n);
- };
-
- // Returns everything but the last entry of the array. Especially useful on
- // the arguments object. Passing **n** will return all the values in
- // the array, excluding the last N. The **guard** check allows it to work with
- // `_.map`.
- _.initial = function(array, n, guard) {
- return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
- };
-
- // Get the last element of an array. Passing **n** will return the last N
- // values in the array. The **guard** check allows it to work with `_.map`.
- _.last = function(array, n, guard) {
- if (array == null) return void 0;
- if (n == null || guard) return array[array.length - 1];
- return slice.call(array, Math.max(array.length - n, 0));
- };
-
- // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
- // Especially useful on the arguments object. Passing an **n** will return
- // the rest N values in the array. The **guard**
- // check allows it to work with `_.map`.
- _.rest = _.tail = _.drop = function(array, n, guard) {
- return slice.call(array, n == null || guard ? 1 : n);
- };
-
- // Trim out all falsy values from an array.
- _.compact = function(array) {
- return _.filter(array, _.identity);
- };
-
- // Internal implementation of a recursive `flatten` function.
- var flatten = function(input, shallow, strict, output) {
- if (shallow && _.every(input, _.isArray)) {
- return concat.apply(output, input);
- }
- for (var i = 0, length = input.length; i < length; i++) {
- var value = input[i];
- if (!_.isArray(value) && !_.isArguments(value)) {
- if (!strict) output.push(value);
- } else if (shallow) {
- push.apply(output, value);
- } else {
- flatten(value, shallow, strict, output);
- }
- }
- return output;
- };
-
- // Flatten out an array, either recursively (by default), or just one level.
- _.flatten = function(array, shallow) {
- return flatten(array, shallow, false, []);
- };
-
- // Return a version of the array that does not contain the specified value(s).
- _.without = function(array) {
- return _.difference(array, slice.call(arguments, 1));
- };
-
- // Produce a duplicate-free version of the array. If the array has already
- // been sorted, you have the option of using a faster algorithm.
- // Aliased as `unique`.
- _.uniq = _.unique = function(array, isSorted, iteratee, context) {
- if (array == null) return [];
- if (!_.isBoolean(isSorted)) {
- context = iteratee;
- iteratee = isSorted;
- isSorted = false;
- }
- if (iteratee != null) iteratee = _.iteratee(iteratee, context);
- var result = [];
- var seen = [];
- for (var i = 0, length = array.length; i < length; i++) {
- var value = array[i];
- if (isSorted) {
- if (!i || seen !== value) result.push(value);
- seen = value;
- } else if (iteratee) {
- var computed = iteratee(value, i, array);
- if (_.indexOf(seen, computed) < 0) {
- seen.push(computed);
- result.push(value);
- }
- } else if (_.indexOf(result, value) < 0) {
- result.push(value);
- }
- }
- return result;
- };
-
- // Produce an array that contains the union: each distinct element from all of
- // the passed-in arrays.
- _.union = function() {
- return _.uniq(flatten(arguments, true, true, []));
- };
-
- // Produce an array that contains every item shared between all the
- // passed-in arrays.
- _.intersection = function(array) {
- if (array == null) return [];
- var result = [];
- var argsLength = arguments.length;
- for (var i = 0, length = array.length; i < length; i++) {
- var item = array[i];
- if (_.contains(result, item)) continue;
- for (var j = 1; j < argsLength; j++) {
- if (!_.contains(arguments[j], item)) break;
- }
- if (j === argsLength) result.push(item);
- }
- return result;
- };
-
- // Take the difference between one array and a number of other arrays.
- // Only the elements present in just the first array will remain.
- _.difference = function(array) {
- var rest = flatten(slice.call(arguments, 1), true, true, []);
- return _.filter(array, function(value){
- return !_.contains(rest, value);
- });
- };
-
- // Zip together multiple lists into a single array -- elements that share
- // an index go together.
- _.zip = function(array) {
- if (array == null) return [];
- var length = _.max(arguments, 'length').length;
- var results = Array(length);
- for (var i = 0; i < length; i++) {
- results[i] = _.pluck(arguments, i);
- }
- return results;
- };
-
- // Converts lists into objects. Pass either a single array of `[key, value]`
- // pairs, or two parallel arrays of the same length -- one of keys, and one of
- // the corresponding values.
- _.object = function(list, values) {
- if (list == null) return {};
- var result = {};
- for (var i = 0, length = list.length; i < length; i++) {
- if (values) {
- result[list[i]] = values[i];
- } else {
- result[list[i][0]] = list[i][1];
- }
- }
- return result;
- };
-
- // Return the position of the first occurrence of an item in an array,
- // or -1 if the item is not included in the array.
- // If the array is large and already in sort order, pass `true`
- // for **isSorted** to use binary search.
- _.indexOf = function(array, item, isSorted) {
- if (array == null) return -1;
- var i = 0, length = array.length;
- if (isSorted) {
- if (typeof isSorted == 'number') {
- i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted;
- } else {
- i = _.sortedIndex(array, item);
- return array[i] === item ? i : -1;
- }
- }
- for (; i < length; i++) if (array[i] === item) return i;
- return -1;
- };
-
- _.lastIndexOf = function(array, item, from) {
- if (array == null) return -1;
- var idx = array.length;
- if (typeof from == 'number') {
- idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1);
- }
- while (--idx >= 0) if (array[idx] === item) return idx;
- return -1;
- };
-
- // Generate an integer Array containing an arithmetic progression. A port of
- // the native Python `range()` function. See
- // [the Python documentation](http://docs.python.org/library/functions.html#range).
- _.range = function(start, stop, step) {
- if (arguments.length <= 1) {
- stop = start || 0;
- start = 0;
- }
- step = step || 1;
-
- var length = Math.max(Math.ceil((stop - start) / step), 0);
- var range = Array(length);
-
- for (var idx = 0; idx < length; idx++, start += step) {
- range[idx] = start;
- }
-
- return range;
- };
-
- // Function (ahem) Functions
- // ------------------
-
- // Reusable constructor function for prototype setting.
- var Ctor = function(){};
-
- // Create a function bound to a given object (assigning `this`, and arguments,
- // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
- // available.
- _.bind = function(func, context) {
- var args, bound;
- if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
- if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
- args = slice.call(arguments, 2);
- bound = function() {
- if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
- Ctor.prototype = func.prototype;
- var self = new Ctor;
- Ctor.prototype = null;
- var result = func.apply(self, args.concat(slice.call(arguments)));
- if (_.isObject(result)) return result;
- return self;
- };
- return bound;
- };
-
- // Partially apply a function by creating a version that has had some of its
- // arguments pre-filled, without changing its dynamic `this` context. _ acts
- // as a placeholder, allowing any combination of arguments to be pre-filled.
- _.partial = function(func) {
- var boundArgs = slice.call(arguments, 1);
- return function() {
- var position = 0;
- var args = boundArgs.slice();
- for (var i = 0, length = args.length; i < length; i++) {
- if (args[i] === _) args[i] = arguments[position++];
- }
- while (position < arguments.length) args.push(arguments[position++]);
- return func.apply(this, args);
- };
- };
-
- // Bind a number of an object's methods to that object. Remaining arguments
- // are the method names to be bound. Useful for ensuring that all callbacks
- // defined on an object belong to it.
- _.bindAll = function(obj) {
- var i, length = arguments.length, key;
- if (length <= 1) throw new Error('bindAll must be passed function names');
- for (i = 1; i < length; i++) {
- key = arguments[i];
- obj[key] = _.bind(obj[key], obj);
- }
- return obj;
- };
-
- // Memoize an expensive function by storing its results.
- _.memoize = function(func, hasher) {
- var memoize = function(key) {
- var cache = memoize.cache;
- var address = hasher ? hasher.apply(this, arguments) : key;
- if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
- return cache[address];
- };
- memoize.cache = {};
- return memoize;
- };
-
- // Delays a function for the given number of milliseconds, and then calls
- // it with the arguments supplied.
- _.delay = function(func, wait) {
- var args = slice.call(arguments, 2);
- return setTimeout(function(){
- return func.apply(null, args);
- }, wait);
- };
-
- // Defers a function, scheduling it to run after the current call stack has
- // cleared.
- _.defer = function(func) {
- return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
- };
-
- // Returns a function, that, when invoked, will only be triggered at most once
- // during a given window of time. Normally, the throttled function will run
- // as much as it can, without ever going more than once per `wait` duration;
- // but if you'd like to disable the execution on the leading edge, pass
- // `{leading: false}`. To disable execution on the trailing edge, ditto.
- _.throttle = function(func, wait, options) {
- var context, args, result;
- var timeout = null;
- var previous = 0;
- if (!options) options = {};
- var later = function() {
- previous = options.leading === false ? 0 : _.now();
- timeout = null;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- };
- return function() {
- var now = _.now();
- if (!previous && options.leading === false) previous = now;
- var remaining = wait - (now - previous);
- context = this;
- args = arguments;
- if (remaining <= 0 || remaining > wait) {
- clearTimeout(timeout);
- timeout = null;
- previous = now;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- } else if (!timeout && options.trailing !== false) {
- timeout = setTimeout(later, remaining);
- }
- return result;
- };
- };
-
- // Returns a function, that, as long as it continues to be invoked, will not
- // be triggered. The function will be called after it stops being called for
- // N milliseconds. If `immediate` is passed, trigger the function on the
- // leading edge, instead of the trailing.
- _.debounce = function(func, wait, immediate) {
- var timeout, args, context, timestamp, result;
-
- var later = function() {
- var last = _.now() - timestamp;
-
- if (last < wait && last > 0) {
- timeout = setTimeout(later, wait - last);
- } else {
- timeout = null;
- if (!immediate) {
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- }
- }
- };
-
- return function() {
- context = this;
- args = arguments;
- timestamp = _.now();
- var callNow = immediate && !timeout;
- if (!timeout) timeout = setTimeout(later, wait);
- if (callNow) {
- result = func.apply(context, args);
- context = args = null;
- }
-
- return result;
- };
- };
-
- // Returns the first function passed as an argument to the second,
- // allowing you to adjust arguments, run code before and after, and
- // conditionally execute the original function.
- _.wrap = function(func, wrapper) {
- return _.partial(wrapper, func);
- };
-
- // Returns a negated version of the passed-in predicate.
- _.negate = function(predicate) {
- return function() {
- return !predicate.apply(this, arguments);
- };
- };
-
- // Returns a function that is the composition of a list of functions, each
- // consuming the return value of the function that follows.
- _.compose = function() {
- var args = arguments;
- var start = args.length - 1;
- return function() {
- var i = start;
- var result = args[start].apply(this, arguments);
- while (i--) result = args[i].call(this, result);
- return result;
- };
- };
-
- // Returns a function that will only be executed after being called N times.
- _.after = function(times, func) {
- return function() {
- if (--times < 1) {
- return func.apply(this, arguments);
- }
- };
- };
-
- // Returns a function that will only be executed before being called N times.
- _.before = function(times, func) {
- var memo;
- return function() {
- if (--times > 0) {
- memo = func.apply(this, arguments);
- } else {
- func = null;
- }
- return memo;
- };
- };
-
- // Returns a function that will be executed at most one time, no matter how
- // often you call it. Useful for lazy initialization.
- _.once = _.partial(_.before, 2);
-
- // Object Functions
- // ----------------
-
- // Retrieve the names of an object's properties.
- // Delegates to **ECMAScript 5**'s native `Object.keys`
- _.keys = function(obj) {
- if (!_.isObject(obj)) return [];
- if (nativeKeys) return nativeKeys(obj);
- var keys = [];
- for (var key in obj) if (_.has(obj, key)) keys.push(key);
- return keys;
- };
-
- // Retrieve the values of an object's properties.
- _.values = function(obj) {
- var keys = _.keys(obj);
- var length = keys.length;
- var values = Array(length);
- for (var i = 0; i < length; i++) {
- values[i] = obj[keys[i]];
- }
- return values;
- };
-
- // Convert an object into a list of `[key, value]` pairs.
- _.pairs = function(obj) {
- var keys = _.keys(obj);
- var length = keys.length;
- var pairs = Array(length);
- for (var i = 0; i < length; i++) {
- pairs[i] = [keys[i], obj[keys[i]]];
- }
- return pairs;
- };
-
- // Invert the keys and values of an object. The values must be serializable.
- _.invert = function(obj) {
- var result = {};
- var keys = _.keys(obj);
- for (var i = 0, length = keys.length; i < length; i++) {
- result[obj[keys[i]]] = keys[i];
- }
- return result;
- };
-
- // Return a sorted list of the function names available on the object.
- // Aliased as `methods`
- _.functions = _.methods = function(obj) {
- var names = [];
- for (var key in obj) {
- if (_.isFunction(obj[key])) names.push(key);
- }
- return names.sort();
- };
-
- // Extend a given object with all the properties in passed-in object(s).
- _.extend = function(obj) {
- if (!_.isObject(obj)) return obj;
- var source, prop;
- for (var i = 1, length = arguments.length; i < length; i++) {
- source = arguments[i];
- for (prop in source) {
- if (hasOwnProperty.call(source, prop)) {
- obj[prop] = source[prop];
- }
- }
- }
- return obj;
- };
-
- // Return a copy of the object only containing the whitelisted properties.
- _.pick = function(obj, iteratee, context) {
- var result = {}, key;
- if (obj == null) return result;
- if (_.isFunction(iteratee)) {
- iteratee = createCallback(iteratee, context);
- for (key in obj) {
- var value = obj[key];
- if (iteratee(value, key, obj)) result[key] = value;
- }
- } else {
- var keys = concat.apply([], slice.call(arguments, 1));
- obj = new Object(obj);
- for (var i = 0, length = keys.length; i < length; i++) {
- key = keys[i];
- if (key in obj) result[key] = obj[key];
- }
- }
- return result;
- };
-
- // Return a copy of the object without the blacklisted properties.
- _.omit = function(obj, iteratee, context) {
- if (_.isFunction(iteratee)) {
- iteratee = _.negate(iteratee);
- } else {
- var keys = _.map(concat.apply([], slice.call(arguments, 1)), String);
- iteratee = function(value, key) {
- return !_.contains(keys, key);
- };
- }
- return _.pick(obj, iteratee, context);
- };
-
- // Fill in a given object with default properties.
- _.defaults = function(obj) {
- if (!_.isObject(obj)) return obj;
- for (var i = 1, length = arguments.length; i < length; i++) {
- var source = arguments[i];
- for (var prop in source) {
- if (obj[prop] === void 0) obj[prop] = source[prop];
- }
- }
- return obj;
- };
-
- // Create a (shallow-cloned) duplicate of an object.
- _.clone = function(obj) {
- if (!_.isObject(obj)) return obj;
- return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
- };
-
- // Invokes interceptor with the obj, and then returns obj.
- // The primary purpose of this method is to "tap into" a method chain, in
- // order to perform operations on intermediate results within the chain.
- _.tap = function(obj, interceptor) {
- interceptor(obj);
- return obj;
- };
-
- // Internal recursive comparison function for `isEqual`.
- var eq = function(a, b, aStack, bStack) {
- // Identical objects are equal. `0 === -0`, but they aren't identical.
- // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
- if (a === b) return a !== 0 || 1 / a === 1 / b;
- // A strict comparison is necessary because `null == undefined`.
- if (a == null || b == null) return a === b;
- // Unwrap any wrapped objects.
- if (a instanceof _) a = a._wrapped;
- if (b instanceof _) b = b._wrapped;
- // Compare `[[Class]]` names.
- var className = toString.call(a);
- if (className !== toString.call(b)) return false;
- switch (className) {
- // Strings, numbers, regular expressions, dates, and booleans are compared by value.
- case '[object RegExp]':
- // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
- case '[object String]':
- // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
- // equivalent to `new String("5")`.
- return '' + a === '' + b;
- case '[object Number]':
- // `NaN`s are equivalent, but non-reflexive.
- // Object(NaN) is equivalent to NaN
- if (+a !== +a) return +b !== +b;
- // An `egal` comparison is performed for other numeric values.
- return +a === 0 ? 1 / +a === 1 / b : +a === +b;
- case '[object Date]':
- case '[object Boolean]':
- // Coerce dates and booleans to numeric primitive values. Dates are compared by their
- // millisecond representations. Note that invalid dates with millisecond representations
- // of `NaN` are not equivalent.
- return +a === +b;
- }
- if (typeof a != 'object' || typeof b != 'object') return false;
- // Assume equality for cyclic structures. The algorithm for detecting cyclic
- // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
- var length = aStack.length;
- while (length--) {
- // Linear search. Performance is inversely proportional to the number of
- // unique nested structures.
- if (aStack[length] === a) return bStack[length] === b;
- }
- // Objects with different constructors are not equivalent, but `Object`s
- // from different frames are.
- var aCtor = a.constructor, bCtor = b.constructor;
- if (
- aCtor !== bCtor &&
- // Handle Object.create(x) cases
- 'constructor' in a && 'constructor' in b &&
- !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
- _.isFunction(bCtor) && bCtor instanceof bCtor)
- ) {
- return false;
- }
- // Add the first object to the stack of traversed objects.
- aStack.push(a);
- bStack.push(b);
- var size, result;
- // Recursively compare objects and arrays.
- if (className === '[object Array]') {
- // Compare array lengths to determine if a deep comparison is necessary.
- size = a.length;
- result = size === b.length;
- if (result) {
- // Deep compare the contents, ignoring non-numeric properties.
- while (size--) {
- if (!(result = eq(a[size], b[size], aStack, bStack))) break;
- }
- }
- } else {
- // Deep compare objects.
- var keys = _.keys(a), key;
- size = keys.length;
- // Ensure that both objects contain the same number of properties before comparing deep equality.
- result = _.keys(b).length === size;
- if (result) {
- while (size--) {
- // Deep compare each member
- key = keys[size];
- if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
- }
- }
- }
- // Remove the first object from the stack of traversed objects.
- aStack.pop();
- bStack.pop();
- return result;
- };
-
- // Perform a deep comparison to check if two objects are equal.
- _.isEqual = function(a, b) {
- return eq(a, b, [], []);
- };
-
- // Is a given array, string, or object empty?
- // An "empty" object has no enumerable own-properties.
- _.isEmpty = function(obj) {
- if (obj == null) return true;
- if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0;
- for (var key in obj) if (_.has(obj, key)) return false;
- return true;
- };
-
- // Is a given value a DOM element?
- _.isElement = function(obj) {
- return !!(obj && obj.nodeType === 1);
- };
-
- // Is a given value an array?
- // Delegates to ECMA5's native Array.isArray
- _.isArray = nativeIsArray || function(obj) {
- return toString.call(obj) === '[object Array]';
- };
-
- // Is a given variable an object?
- _.isObject = function(obj) {
- var type = typeof obj;
- return type === 'function' || type === 'object' && !!obj;
- };
-
- // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
- _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
- _['is' + name] = function(obj) {
- return toString.call(obj) === '[object ' + name + ']';
- };
- });
-
- // Define a fallback version of the method in browsers (ahem, IE), where
- // there isn't any inspectable "Arguments" type.
- if (!_.isArguments(arguments)) {
- _.isArguments = function(obj) {
- return _.has(obj, 'callee');
- };
- }
-
- // Optimize `isFunction` if appropriate. Work around an IE 11 bug.
- if (typeof /./ !== 'function') {
- _.isFunction = function(obj) {
- return typeof obj == 'function' || false;
- };
- }
-
- // Is a given object a finite number?
- _.isFinite = function(obj) {
- return isFinite(obj) && !isNaN(parseFloat(obj));
- };
-
- // Is the given value `NaN`? (NaN is the only number which does not equal itself).
- _.isNaN = function(obj) {
- return _.isNumber(obj) && obj !== +obj;
- };
-
- // Is a given value a boolean?
- _.isBoolean = function(obj) {
- return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
- };
-
- // Is a given value equal to null?
- _.isNull = function(obj) {
- return obj === null;
- };
-
- // Is a given variable undefined?
- _.isUndefined = function(obj) {
- return obj === void 0;
- };
-
- // Shortcut function for checking if an object has a given property directly
- // on itself (in other words, not on a prototype).
- _.has = function(obj, key) {
- return obj != null && hasOwnProperty.call(obj, key);
- };
-
- // Utility Functions
- // -----------------
-
- // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
- // previous owner. Returns a reference to the Underscore object.
- _.noConflict = function() {
- root._ = previousUnderscore;
- return this;
- };
-
- // Keep the identity function around for default iteratees.
- _.identity = function(value) {
- return value;
- };
-
- _.constant = function(value) {
- return function() {
- return value;
- };
- };
-
- _.noop = function(){};
-
- _.property = function(key) {
- return function(obj) {
- return obj[key];
- };
- };
-
- // Returns a predicate for checking whether an object has a given set of `key:value` pairs.
- _.matches = function(attrs) {
- var pairs = _.pairs(attrs), length = pairs.length;
- return function(obj) {
- if (obj == null) return !length;
- obj = new Object(obj);
- for (var i = 0; i < length; i++) {
- var pair = pairs[i], key = pair[0];
- if (pair[1] !== obj[key] || !(key in obj)) return false;
- }
- return true;
- };
- };
-
- // Run a function **n** times.
- _.times = function(n, iteratee, context) {
- var accum = Array(Math.max(0, n));
- iteratee = createCallback(iteratee, context, 1);
- for (var i = 0; i < n; i++) accum[i] = iteratee(i);
- return accum;
- };
-
- // Return a random integer between min and max (inclusive).
- _.random = function(min, max) {
- if (max == null) {
- max = min;
- min = 0;
- }
- return min + Math.floor(Math.random() * (max - min + 1));
- };
-
- // A (possibly faster) way to get the current timestamp as an integer.
- _.now = Date.now || function() {
- return new Date().getTime();
- };
-
- // List of HTML entities for escaping.
- var escapeMap = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- '`': '`'
- };
- var unescapeMap = _.invert(escapeMap);
-
- // Functions for escaping and unescaping strings to/from HTML interpolation.
- var createEscaper = function(map) {
- var escaper = function(match) {
- return map[match];
- };
- // Regexes for identifying a key that needs to be escaped
- var source = '(?:' + _.keys(map).join('|') + ')';
- var testRegexp = RegExp(source);
- var replaceRegexp = RegExp(source, 'g');
- return function(string) {
- string = string == null ? '' : '' + string;
- return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
- };
- };
- _.escape = createEscaper(escapeMap);
- _.unescape = createEscaper(unescapeMap);
-
- // If the value of the named `property` is a function then invoke it with the
- // `object` as context; otherwise, return it.
- _.result = function(object, property) {
- if (object == null) return void 0;
- var value = object[property];
- return _.isFunction(value) ? object[property]() : value;
- };
-
- // Generate a unique integer id (unique within the entire client session).
- // Useful for temporary DOM ids.
- var idCounter = 0;
- _.uniqueId = function(prefix) {
- var id = ++idCounter + '';
- return prefix ? prefix + id : id;
- };
-
- // By default, Underscore uses ERB-style template delimiters, change the
- // following template settings to use alternative delimiters.
- _.templateSettings = {
- evaluate : /<%([\s\S]+?)%>/g,
- interpolate : /<%=([\s\S]+?)%>/g,
- escape : /<%-([\s\S]+?)%>/g
- };
-
- // When customizing `templateSettings`, if you don't want to define an
- // interpolation, evaluation or escaping regex, we need one that is
- // guaranteed not to match.
- var noMatch = /(.)^/;
-
- // Certain characters need to be escaped so that they can be put into a
- // string literal.
- var escapes = {
- "'": "'",
- '\\': '\\',
- '\r': 'r',
- '\n': 'n',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
-
- var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
-
- var escapeChar = function(match) {
- return '\\' + escapes[match];
- };
-
- // JavaScript micro-templating, similar to John Resig's implementation.
- // Underscore templating handles arbitrary delimiters, preserves whitespace,
- // and correctly escapes quotes within interpolated code.
- // NB: `oldSettings` only exists for backwards compatibility.
- _.template = function(text, settings, oldSettings) {
- if (!settings && oldSettings) settings = oldSettings;
- settings = _.defaults({}, settings, _.templateSettings);
-
- // Combine delimiters into one regular expression via alternation.
- var matcher = RegExp([
- (settings.escape || noMatch).source,
- (settings.interpolate || noMatch).source,
- (settings.evaluate || noMatch).source
- ].join('|') + '|$', 'g');
-
- // Compile the template source, escaping string literals appropriately.
- var index = 0;
- var source = "__p+='";
- text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
- source += text.slice(index, offset).replace(escaper, escapeChar);
- index = offset + match.length;
-
- if (escape) {
- source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
- } else if (interpolate) {
- source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
- } else if (evaluate) {
- source += "';\n" + evaluate + "\n__p+='";
- }
-
- // Adobe VMs need the match returned to produce the correct offest.
- return match;
- });
- source += "';\n";
-
- // If a variable is not specified, place data values in local scope.
- if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
-
- source = "var __t,__p='',__j=Array.prototype.join," +
- "print=function(){__p+=__j.call(arguments,'');};\n" +
- source + 'return __p;\n';
-
- try {
- var render = new Function(settings.variable || 'obj', '_', source);
- } catch (e) {
- e.source = source;
- throw e;
- }
-
- var template = function(data) {
- return render.call(this, data, _);
- };
-
- // Provide the compiled source as a convenience for precompilation.
- var argument = settings.variable || 'obj';
- template.source = 'function(' + argument + '){\n' + source + '}';
-
- return template;
- };
-
- // Add a "chain" function. Start chaining a wrapped Underscore object.
- _.chain = function(obj) {
- var instance = _(obj);
- instance._chain = true;
- return instance;
- };
-
- // OOP
- // ---------------
- // If Underscore is called as a function, it returns a wrapped object that
- // can be used OO-style. This wrapper holds altered versions of all the
- // underscore functions. Wrapped objects may be chained.
-
- // Helper function to continue chaining intermediate results.
- var result = function(obj) {
- return this._chain ? _(obj).chain() : obj;
- };
-
- // Add your own custom functions to the Underscore object.
- _.mixin = function(obj) {
- _.each(_.functions(obj), function(name) {
- var func = _[name] = obj[name];
- _.prototype[name] = function() {
- var args = [this._wrapped];
- push.apply(args, arguments);
- return result.call(this, func.apply(_, args));
- };
- });
- };
-
- // Add all of the Underscore functions to the wrapper object.
- _.mixin(_);
-
- // Add all mutator Array functions to the wrapper.
- _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
- var method = ArrayProto[name];
- _.prototype[name] = function() {
- var obj = this._wrapped;
- method.apply(obj, arguments);
- if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
- return result.call(this, obj);
- };
- });
-
- // Add all accessor Array functions to the wrapper.
- _.each(['concat', 'join', 'slice'], function(name) {
- var method = ArrayProto[name];
- _.prototype[name] = function() {
- return result.call(this, method.apply(this._wrapped, arguments));
- };
- });
-
- // Extracts the result from a wrapped and chained object.
- _.prototype.value = function() {
- return this._wrapped;
- };
-
- // AMD registration happens at the end for compatibility with AMD loaders
- // that may not enforce next-turn semantics on modules. Even though general
- // practice for AMD registration is to be anonymous, underscore registers
- // as a named module because, like jQuery, it is a base library that is
- // popular enough to be bundled in a third party lib, but not be part of
- // an AMD load request. Those cases could generate an error when an
- // anonymous define() is called outside of a loader request.
- if (typeof define === 'function' && define.amd) {
- define('underscore', [], function() {
- return _;
- });
- }
-}.call(this));
diff --git a/docs/_build/html/_static/up-pressed.png b/docs/_build/html/_static/up-pressed.png
deleted file mode 100644
index 99e7210..0000000
Binary files a/docs/_build/html/_static/up-pressed.png and /dev/null differ
diff --git a/docs/_build/html/_static/up.png b/docs/_build/html/_static/up.png
deleted file mode 100644
index 26de002..0000000
Binary files a/docs/_build/html/_static/up.png and /dev/null differ
diff --git a/docs/_build/html/_static/websupport.js b/docs/_build/html/_static/websupport.js
deleted file mode 100644
index ffd9b2b..0000000
--- a/docs/_build/html/_static/websupport.js
+++ /dev/null
@@ -1,808 +0,0 @@
-/*
- * websupport.js
- * ~~~~~~~~~~~~~
- *
- * sphinx.websupport utilties for all documentation.
- *
- * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
- */
-
-(function($) {
- $.fn.autogrow = function() {
- return this.each(function() {
- var textarea = this;
-
- $.fn.autogrow.resize(textarea);
-
- $(textarea)
- .focus(function() {
- textarea.interval = setInterval(function() {
- $.fn.autogrow.resize(textarea);
- }, 500);
- })
- .blur(function() {
- clearInterval(textarea.interval);
- });
- });
- };
-
- $.fn.autogrow.resize = function(textarea) {
- var lineHeight = parseInt($(textarea).css('line-height'), 10);
- var lines = textarea.value.split('\n');
- var columns = textarea.cols;
- var lineCount = 0;
- $.each(lines, function() {
- lineCount += Math.ceil(this.length / columns) || 1;
- });
- var height = lineHeight * (lineCount + 1);
- $(textarea).css('height', height);
- };
-})(jQuery);
-
-(function($) {
- var comp, by;
-
- function init() {
- initEvents();
- initComparator();
- }
-
- function initEvents() {
- $(document).on("click", 'a.comment-close', function(event) {
- event.preventDefault();
- hide($(this).attr('id').substring(2));
- });
- $(document).on("click", 'a.vote', function(event) {
- event.preventDefault();
- handleVote($(this));
- });
- $(document).on("click", 'a.reply', function(event) {
- event.preventDefault();
- openReply($(this).attr('id').substring(2));
- });
- $(document).on("click", 'a.close-reply', function(event) {
- event.preventDefault();
- closeReply($(this).attr('id').substring(2));
- });
- $(document).on("click", 'a.sort-option', function(event) {
- event.preventDefault();
- handleReSort($(this));
- });
- $(document).on("click", 'a.show-proposal', function(event) {
- event.preventDefault();
- showProposal($(this).attr('id').substring(2));
- });
- $(document).on("click", 'a.hide-proposal', function(event) {
- event.preventDefault();
- hideProposal($(this).attr('id').substring(2));
- });
- $(document).on("click", 'a.show-propose-change', function(event) {
- event.preventDefault();
- showProposeChange($(this).attr('id').substring(2));
- });
- $(document).on("click", 'a.hide-propose-change', function(event) {
- event.preventDefault();
- hideProposeChange($(this).attr('id').substring(2));
- });
- $(document).on("click", 'a.accept-comment', function(event) {
- event.preventDefault();
- acceptComment($(this).attr('id').substring(2));
- });
- $(document).on("click", 'a.delete-comment', function(event) {
- event.preventDefault();
- deleteComment($(this).attr('id').substring(2));
- });
- $(document).on("click", 'a.comment-markup', function(event) {
- event.preventDefault();
- toggleCommentMarkupBox($(this).attr('id').substring(2));
- });
- }
-
- /**
- * Set comp, which is a comparator function used for sorting and
- * inserting comments into the list.
- */
- function setComparator() {
- // If the first three letters are "asc", sort in ascending order
- // and remove the prefix.
- if (by.substring(0,3) == 'asc') {
- var i = by.substring(3);
- comp = function(a, b) { return a[i] - b[i]; };
- } else {
- // Otherwise sort in descending order.
- comp = function(a, b) { return b[by] - a[by]; };
- }
-
- // Reset link styles and format the selected sort option.
- $('a.sel').attr('href', '#').removeClass('sel');
- $('a.by' + by).removeAttr('href').addClass('sel');
- }
-
- /**
- * Create a comp function. If the user has preferences stored in
- * the sortBy cookie, use those, otherwise use the default.
- */
- function initComparator() {
- by = 'rating'; // Default to sort by rating.
- // If the sortBy cookie is set, use that instead.
- if (document.cookie.length > 0) {
- var start = document.cookie.indexOf('sortBy=');
- if (start != -1) {
- start = start + 7;
- var end = document.cookie.indexOf(";", start);
- if (end == -1) {
- end = document.cookie.length;
- by = unescape(document.cookie.substring(start, end));
- }
- }
- }
- setComparator();
- }
-
- /**
- * Show a comment div.
- */
- function show(id) {
- $('#ao' + id).hide();
- $('#ah' + id).show();
- var context = $.extend({id: id}, opts);
- var popup = $(renderTemplate(popupTemplate, context)).hide();
- popup.find('textarea[name="proposal"]').hide();
- popup.find('a.by' + by).addClass('sel');
- var form = popup.find('#cf' + id);
- form.submit(function(event) {
- event.preventDefault();
- addComment(form);
- });
- $('#s' + id).after(popup);
- popup.slideDown('fast', function() {
- getComments(id);
- });
- }
-
- /**
- * Hide a comment div.
- */
- function hide(id) {
- $('#ah' + id).hide();
- $('#ao' + id).show();
- var div = $('#sc' + id);
- div.slideUp('fast', function() {
- div.remove();
- });
- }
-
- /**
- * Perform an ajax request to get comments for a node
- * and insert the comments into the comments tree.
- */
- function getComments(id) {
- $.ajax({
- type: 'GET',
- url: opts.getCommentsURL,
- data: {node: id},
- success: function(data, textStatus, request) {
- var ul = $('#cl' + id);
- var speed = 100;
- $('#cf' + id)
- .find('textarea[name="proposal"]')
- .data('source', data.source);
-
- if (data.comments.length === 0) {
- ul.html('<li>No comments yet.</li>');
- ul.data('empty', true);
- } else {
- // If there are comments, sort them and put them in the list.
- var comments = sortComments(data.comments);
- speed = data.comments.length * 100;
- appendComments(comments, ul);
- ul.data('empty', false);
- }
- $('#cn' + id).slideUp(speed + 200);
- ul.slideDown(speed);
- },
- error: function(request, textStatus, error) {
- showError('Oops, there was a problem retrieving the comments.');
- },
- dataType: 'json'
- });
- }
-
- /**
- * Add a comment via ajax and insert the comment into the comment tree.
- */
- function addComment(form) {
- var node_id = form.find('input[name="node"]').val();
- var parent_id = form.find('input[name="parent"]').val();
- var text = form.find('textarea[name="comment"]').val();
- var proposal = form.find('textarea[name="proposal"]').val();
-
- if (text == '') {
- showError('Please enter a comment.');
- return;
- }
-
- // Disable the form that is being submitted.
- form.find('textarea,input').attr('disabled', 'disabled');
-
- // Send the comment to the server.
- $.ajax({
- type: "POST",
- url: opts.addCommentURL,
- dataType: 'json',
- data: {
- node: node_id,
- parent: parent_id,
- text: text,
- proposal: proposal
- },
- success: function(data, textStatus, error) {
- // Reset the form.
- if (node_id) {
- hideProposeChange(node_id);
- }
- form.find('textarea')
- .val('')
- .add(form.find('input'))
- .removeAttr('disabled');
- var ul = $('#cl' + (node_id || parent_id));
- if (ul.data('empty')) {
- $(ul).empty();
- ul.data('empty', false);
- }
- insertComment(data.comment);
- var ao = $('#ao' + node_id);
- ao.find('img').attr({'src': opts.commentBrightImage});
- if (node_id) {
- // if this was a "root" comment, remove the commenting box
- // (the user can get it back by reopening the comment popup)
- $('#ca' + node_id).slideUp();
- }
- },
- error: function(request, textStatus, error) {
- form.find('textarea,input').removeAttr('disabled');
- showError('Oops, there was a problem adding the comment.');
- }
- });
- }
-
- /**
- * Recursively append comments to the main comment list and children
- * lists, creating the comment tree.
- */
- function appendComments(comments, ul) {
- $.each(comments, function() {
- var div = createCommentDiv(this);
- ul.append($(document.createElement('li')).html(div));
- appendComments(this.children, div.find('ul.comment-children'));
- // To avoid stagnating data, don't store the comments children in data.
- this.children = null;
- div.data('comment', this);
- });
- }
-
- /**
- * After adding a new comment, it must be inserted in the correct
- * location in the comment tree.
- */
- function insertComment(comment) {
- var div = createCommentDiv(comment);
-
- // To avoid stagnating data, don't store the comments children in data.
- comment.children = null;
- div.data('comment', comment);
-
- var ul = $('#cl' + (comment.node || comment.parent));
- var siblings = getChildren(ul);
-
- var li = $(document.createElement('li'));
- li.hide();
-
- // Determine where in the parents children list to insert this comment.
- for(i=0; i < siblings.length; i++) {
- if (comp(comment, siblings[i]) <= 0) {
- $('#cd' + siblings[i].id)
- .parent()
- .before(li.html(div));
- li.slideDown('fast');
- return;
- }
- }
-
- // If we get here, this comment rates lower than all the others,
- // or it is the only comment in the list.
- ul.append(li.html(div));
- li.slideDown('fast');
- }
-
- function acceptComment(id) {
- $.ajax({
- type: 'POST',
- url: opts.acceptCommentURL,
- data: {id: id},
- success: function(data, textStatus, request) {
- $('#cm' + id).fadeOut('fast');
- $('#cd' + id).removeClass('moderate');
- },
- error: function(request, textStatus, error) {
- showError('Oops, there was a problem accepting the comment.');
- }
- });
- }
-
- function deleteComment(id) {
- $.ajax({
- type: 'POST',
- url: opts.deleteCommentURL,
- data: {id: id},
- success: function(data, textStatus, request) {
- var div = $('#cd' + id);
- if (data == 'delete') {
- // Moderator mode: remove the comment and all children immediately
- div.slideUp('fast', function() {
- div.remove();
- });
- return;
- }
- // User mode: only mark the comment as deleted
- div
- .find('span.user-id:first')
- .text('[deleted]').end()
- .find('div.comment-text:first')
- .text('[deleted]').end()
- .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id +
- ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id)
- .remove();
- var comment = div.data('comment');
- comment.username = '[deleted]';
- comment.text = '[deleted]';
- div.data('comment', comment);
- },
- error: function(request, textStatus, error) {
- showError('Oops, there was a problem deleting the comment.');
- }
- });
- }
-
- function showProposal(id) {
- $('#sp' + id).hide();
- $('#hp' + id).show();
- $('#pr' + id).slideDown('fast');
- }
-
- function hideProposal(id) {
- $('#hp' + id).hide();
- $('#sp' + id).show();
- $('#pr' + id).slideUp('fast');
- }
-
- function showProposeChange(id) {
- $('#pc' + id).hide();
- $('#hc' + id).show();
- var textarea = $('#pt' + id);
- textarea.val(textarea.data('source'));
- $.fn.autogrow.resize(textarea[0]);
- textarea.slideDown('fast');
- }
-
- function hideProposeChange(id) {
- $('#hc' + id).hide();
- $('#pc' + id).show();
- var textarea = $('#pt' + id);
- textarea.val('').removeAttr('disabled');
- textarea.slideUp('fast');
- }
-
- function toggleCommentMarkupBox(id) {
- $('#mb' + id).toggle();
- }
-
- /** Handle when the user clicks on a sort by link. */
- function handleReSort(link) {
- var classes = link.attr('class').split(/\s+/);
- for (var i=0; i<classes.length; i++) {
- if (classes[i] != 'sort-option') {
- by = classes[i].substring(2);
- }
- }
- setComparator();
- // Save/update the sortBy cookie.
- var expiration = new Date();
- expiration.setDate(expiration.getDate() + 365);
- document.cookie= 'sortBy=' + escape(by) +
- ';expires=' + expiration.toUTCString();
- $('ul.comment-ul').each(function(index, ul) {
- var comments = getChildren($(ul), true);
- comments = sortComments(comments);
- appendComments(comments, $(ul).empty());
- });
- }
-
- /**
- * Function to process a vote when a user clicks an arrow.
- */
- function handleVote(link) {
- if (!opts.voting) {
- showError("You'll need to login to vote.");
- return;
- }
-
- var id = link.attr('id');
- if (!id) {
- // Didn't click on one of the voting arrows.
- return;
- }
- // If it is an unvote, the new vote value is 0,
- // Otherwise it's 1 for an upvote, or -1 for a downvote.
- var value = 0;
- if (id.charAt(1) != 'u') {
- value = id.charAt(0) == 'u' ? 1 : -1;
- }
- // The data to be sent to the server.
- var d = {
- comment_id: id.substring(2),
- value: value
- };
-
- // Swap the vote and unvote links.
- link.hide();
- $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id)
- .show();
-
- // The div the comment is displayed in.
- var div = $('div#cd' + d.comment_id);
- var data = div.data('comment');
-
- // If this is not an unvote, and the other vote arrow has
- // already been pressed, unpress it.
- if ((d.value !== 0) && (data.vote === d.value * -1)) {
- $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide();
- $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show();
- }
-
- // Update the comments rating in the local data.
- data.rating += (data.vote === 0) ? d.value : (d.value - data.vote);
- data.vote = d.value;
- div.data('comment', data);
-
- // Change the rating text.
- div.find('.rating:first')
- .text(data.rating + ' point' + (data.rating == 1 ? '' : 's'));
-
- // Send the vote information to the server.
- $.ajax({
- type: "POST",
- url: opts.processVoteURL,
- data: d,
- error: function(request, textStatus, error) {
- showError('Oops, there was a problem casting that vote.');
- }
- });
- }
-
- /**
- * Open a reply form used to reply to an existing comment.
- */
- function openReply(id) {
- // Swap out the reply link for the hide link
- $('#rl' + id).hide();
- $('#cr' + id).show();
-
- // Add the reply li to the children ul.
- var div = $(renderTemplate(replyTemplate, {id: id})).hide();
- $('#cl' + id)
- .prepend(div)
- // Setup the submit handler for the reply form.
- .find('#rf' + id)
- .submit(function(event) {
- event.preventDefault();
- addComment($('#rf' + id));
- closeReply(id);
- })
- .find('input[type=button]')
- .click(function() {
- closeReply(id);
- });
- div.slideDown('fast', function() {
- $('#rf' + id).find('textarea').focus();
- });
- }
-
- /**
- * Close the reply form opened with openReply.
- */
- function closeReply(id) {
- // Remove the reply div from the DOM.
- $('#rd' + id).slideUp('fast', function() {
- $(this).remove();
- });
-
- // Swap out the hide link for the reply link
- $('#cr' + id).hide();
- $('#rl' + id).show();
- }
-
- /**
- * Recursively sort a tree of comments using the comp comparator.
- */
- function sortComments(comments) {
- comments.sort(comp);
- $.each(comments, function() {
- this.children = sortComments(this.children);
- });
- return comments;
- }
-
- /**
- * Get the children comments from a ul. If recursive is true,
- * recursively include childrens' children.
- */
- function getChildren(ul, recursive) {
- var children = [];
- ul.children().children("[id^='cd']")
- .each(function() {
- var comment = $(this).data('comment');
- if (recursive)
- comment.children = getChildren($(this).find('#cl' + comment.id), true);
- children.push(comment);
- });
- return children;
- }
-
- /** Create a div to display a comment in. */
- function createCommentDiv(comment) {
- if (!comment.displayed && !opts.moderator) {
- return $('<div class="moderate">Thank you! Your comment will show up '
- + 'once it is has been approved by a moderator.</div>');
- }
- // Prettify the comment rating.
- comment.pretty_rating = comment.rating + ' point' +
- (comment.rating == 1 ? '' : 's');
- // Make a class (for displaying not yet moderated comments differently)
- comment.css_class = comment.displayed ? '' : ' moderate';
- // Create a div for this comment.
- var context = $.extend({}, opts, comment);
- var div = $(renderTemplate(commentTemplate, context));
-
- // If the user has voted on this comment, highlight the correct arrow.
- if (comment.vote) {
- var direction = (comment.vote == 1) ? 'u' : 'd';
- div.find('#' + direction + 'v' + comment.id).hide();
- div.find('#' + direction + 'u' + comment.id).show();
- }
-
- if (opts.moderator || comment.text != '[deleted]') {
- div.find('a.reply').show();
- if (comment.proposal_diff)
- div.find('#sp' + comment.id).show();
- if (opts.moderator && !comment.displayed)
- div.find('#cm' + comment.id).show();
- if (opts.moderator || (opts.username == comment.username))
- div.find('#dc' + comment.id).show();
- }
- return div;
- }
-
- /**
- * A simple template renderer. Placeholders such as <%id%> are replaced
- * by context['id'] with items being escaped. Placeholders such as <#id#>
- * are not escaped.
- */
- function renderTemplate(template, context) {
- var esc = $(document.createElement('div'));
-
- function handle(ph, escape) {
- var cur = context;
- $.each(ph.split('.'), function() {
- cur = cur[this];
- });
- return escape ? esc.text(cur || "").html() : cur;
- }
-
- return template.replace(/<([%#])([\w\.]*)\1>/g, function() {
- return handle(arguments[2], arguments[1] == '%' ? true : false);
- });
- }
-
- /** Flash an error message briefly. */
- function showError(message) {
- $(document.createElement('div')).attr({'class': 'popup-error'})
- .append($(document.createElement('div'))
- .attr({'class': 'error-message'}).text(message))
- .appendTo('body')
- .fadeIn("slow")
- .delay(2000)
- .fadeOut("slow");
- }
-
- /** Add a link the user uses to open the comments popup. */
- $.fn.comment = function() {
- return this.each(function() {
- var id = $(this).attr('id').substring(1);
- var count = COMMENT_METADATA[id];
- var title = count + ' comment' + (count == 1 ? '' : 's');
- var image = count > 0 ? opts.commentBrightImage : opts.commentImage;
- var addcls = count == 0 ? ' nocomment' : '';
- $(this)
- .append(
- $(document.createElement('a')).attr({
- href: '#',
- 'class': 'sphinx-comment-open' + addcls,
- id: 'ao' + id
- })
- .append($(document.createElement('img')).attr({
- src: image,
- alt: 'comment',
- title: title
- }))
- .click(function(event) {
- event.preventDefault();
- show($(this).attr('id').substring(2));
- })
- )
- .append(
- $(document.createElement('a')).attr({
- href: '#',
- 'class': 'sphinx-comment-close hidden',
- id: 'ah' + id
- })
- .append($(document.createElement('img')).attr({
- src: opts.closeCommentImage,
- alt: 'close',
- title: 'close'
- }))
- .click(function(event) {
- event.preventDefault();
- hide($(this).attr('id').substring(2));
- })
- );
- });
- };
-
- var opts = {
- processVoteURL: '/_process_vote',
- addCommentURL: '/_add_comment',
- getCommentsURL: '/_get_comments',
- acceptCommentURL: '/_accept_comment',
- deleteCommentURL: '/_delete_comment',
- commentImage: '/static/_static/comment.png',
- closeCommentImage: '/static/_static/comment-close.png',
- loadingImage: '/static/_static/ajax-loader.gif',
- commentBrightImage: '/static/_static/comment-bright.png',
- upArrow: '/static/_static/up.png',
- downArrow: '/static/_static/down.png',
- upArrowPressed: '/static/_static/up-pressed.png',
- downArrowPressed: '/static/_static/down-pressed.png',
- voting: false,
- moderator: false
- };
-
- if (typeof COMMENT_OPTIONS != "undefined") {
- opts = jQuery.extend(opts, COMMENT_OPTIONS);
- }
-
- var popupTemplate = '\
- <div class="sphinx-comments" id="sc<%id%>">\
- <p class="sort-options">\
- Sort by:\
- <a href="#" class="sort-option byrating">best rated</a>\
- <a href="#" class="sort-option byascage">newest</a>\
- <a href="#" class="sort-option byage">oldest</a>\
- </p>\
- <div class="comment-header">Comments</div>\
- <div class="comment-loading" id="cn<%id%>">\
- loading comments... <img src="<%loadingImage%>" alt="" /></div>\
- <ul id="cl<%id%>" class="comment-ul"></ul>\
- <div id="ca<%id%>">\
- <p class="add-a-comment">Add a comment\
- (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\
- <div class="comment-markup-box" id="mb<%id%>">\
- reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \
- <code>``code``</code>, \
- code blocks: <code>::</code> and an indented block after blank line</div>\
- <form method="post" id="cf<%id%>" class="comment-form" action="">\
- <textarea name="comment" cols="80"></textarea>\
- <p class="propose-button">\
- <a href="#" id="pc<%id%>" class="show-propose-change">\
- Propose a change ▹\
- </a>\
- <a href="#" id="hc<%id%>" class="hide-propose-change">\
- Propose a change ▿\
- </a>\
- </p>\
- <textarea name="proposal" id="pt<%id%>" cols="80"\
- spellcheck="false"></textarea>\
- <input type="submit" value="Add comment" />\
- <input type="hidden" name="node" value="<%id%>" />\
- <input type="hidden" name="parent" value="" />\
- </form>\
- </div>\
- </div>';
-
- var commentTemplate = '\
- <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\
- <div class="vote">\
- <div class="arrow">\
- <a href="#" id="uv<%id%>" class="vote" title="vote up">\
- <img src="<%upArrow%>" />\
- </a>\
- <a href="#" id="uu<%id%>" class="un vote" title="vote up">\
- <img src="<%upArrowPressed%>" />\
- </a>\
- </div>\
- <div class="arrow">\
- <a href="#" id="dv<%id%>" class="vote" title="vote down">\
- <img src="<%downArrow%>" id="da<%id%>" />\
- </a>\
- <a href="#" id="du<%id%>" class="un vote" title="vote down">\
- <img src="<%downArrowPressed%>" />\
- </a>\
- </div>\
- </div>\
- <div class="comment-content">\
- <p class="tagline comment">\
- <span class="user-id"><%username%></span>\
- <span class="rating"><%pretty_rating%></span>\
- <span class="delta"><%time.delta%></span>\
- </p>\
- <div class="comment-text comment"><#text#></div>\
- <p class="comment-opts comment">\
- <a href="#" class="reply hidden" id="rl<%id%>">reply ▹</a>\
- <a href="#" class="close-reply" id="cr<%id%>">reply ▿</a>\
- <a href="#" id="sp<%id%>" class="show-proposal">proposal ▹</a>\
- <a href="#" id="hp<%id%>" class="hide-proposal">proposal ▿</a>\
- <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\
- <span id="cm<%id%>" class="moderation hidden">\
- <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\
- </span>\
- </p>\
- <pre class="proposal" id="pr<%id%>">\
-<#proposal_diff#>\
- </pre>\
- <ul class="comment-children" id="cl<%id%>"></ul>\
- </div>\
- <div class="clearleft"></div>\
- </div>\
- </div>';
-
- var replyTemplate = '\
- <li>\
- <div class="reply-div" id="rd<%id%>">\
- <form id="rf<%id%>">\
- <textarea name="comment" cols="80"></textarea>\
- <input type="submit" value="Add reply" />\
- <input type="button" value="Cancel" />\
- <input type="hidden" name="parent" value="<%id%>" />\
- <input type="hidden" name="node" value="" />\
- </form>\
- </div>\
- </li>';
-
- $(document).ready(function() {
- init();
- });
-})(jQuery);
-
-$(document).ready(function() {
- // add comment anchors for all paragraphs that are commentable
- $('.sphinx-has-comment').comment();
-
- // highlight search words in search results
- $("div.context").each(function() {
- var params = $.getQueryParameters();
- var terms = (params.q) ? params.q[0].split(/\s+/) : [];
- var result = $(this);
- $.each(terms, function() {
- result.highlightText(this.toLowerCase(), 'highlighted');
- });
- });
-
- // directly open comment window if requested
- var anchor = document.location.hash;
- if (anchor.substring(0, 9) == '#comment-') {
- $('#ao' + anchor.substring(9)).click();
- document.location.hash = '#s' + anchor.substring(9);
- }
-});
diff --git a/docs/_build/html/api.html b/docs/_build/html/api.html
deleted file mode 100644
index f3571bb..0000000
--- a/docs/_build/html/api.html
+++ /dev/null
@@ -1,604 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>PyWPS API Doc — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="next" title="Developers Guide" href="development.html" />
- <link rel="prev" title="PyWPS and external tools" href="external_tools.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="development.html" title="Developers Guide"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="external_tools.html" title="PyWPS and external tools"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="module-pywps">
-<span id="pywps-api-doc"></span><h1>PyWPS API Doc<a class="headerlink" href="#module-pywps" title="Permalink to this headline">¶</a></h1>
-<div class="section" id="process">
-<h2>Process<a class="headerlink" href="#process" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pywps.Process">
-<em class="property">class </em><code class="descclassname">pywps.</code><code class="descname">Process</code><span class="sig-paren">(</span><em>handler</em>, <em>identifier</em>, <em>title</em>, <em>abstract=''</em>, <em>profile=[]</em>, <em>metadata=[]</em>, <em>inputs=[]</em>, <em>outputs=[]</em>, <em>version='None'</em>, <em>store_supported=False</em>, <em>status_supported=False</em>, <em>grass_location=None</em><span class="sig-paren">)</span><a class="reference internal" href="_mo [...]
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>handler</strong> – A callable that gets invoked for each incoming
-request. It should accept a single
-<a class="reference internal" href="#pywps.app.WPSRequest" title="pywps.app.WPSRequest"><code class="xref py py-class docutils literal"><span class="pre">pywps.app.WPSRequest</span></code></a> argument and return a
-<a class="reference internal" href="#pywps.app.WPSResponse" title="pywps.app.WPSResponse"><code class="xref py py-class docutils literal"><span class="pre">pywps.app.WPSResponse</span></code></a> object.</li>
-<li><strong>identifier</strong> – Name of this process.</li>
-<li><strong>inputs</strong> – List of inputs accepted by this process. They
-should be <a class="reference internal" href="#pywps.LiteralInput" title="pywps.LiteralInput"><code class="xref py py-class docutils literal"><span class="pre">LiteralInput</span></code></a> and <a class="reference internal" href="#pywps.ComplexInput" title="pywps.ComplexInput"><code class="xref py py-class docutils literal"><span class="pre">ComplexInput</span></code></a>
-and <a class="reference internal" href="#pywps.BoundingBoxInput" title="pywps.BoundingBoxInput"><code class="xref py py-class docutils literal"><span class="pre">BoundingBoxInput</span></code></a>
-objects.</li>
-<li><strong>outputs</strong> – List of outputs returned by this process. They
-should be <a class="reference internal" href="#pywps.LiteralOutput" title="pywps.LiteralOutput"><code class="xref py py-class docutils literal"><span class="pre">LiteralOutput</span></code></a> and <a class="reference internal" href="#pywps.ComplexOutput" title="pywps.ComplexOutput"><code class="xref py py-class docutils literal"><span class="pre">ComplexOutput</span></code></a>
-and <a class="reference internal" href="#pywps.BoundingBoxOutput" title="pywps.BoundingBoxOutput"><code class="xref py py-class docutils literal"><span class="pre">BoundingBoxOutput</span></code></a>
-objects.</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-</div>
-<div class="section" id="inputs-and-outputs">
-<h2>Inputs and outputs<a class="headerlink" href="#inputs-and-outputs" title="Permalink to this headline">¶</a></h2>
-<dl class="class">
-<dt id="pywps.validator.mode.MODE">
-<em class="property">class </em><code class="descclassname">pywps.validator.mode.</code><code class="descname">MODE</code><a class="reference internal" href="_modules/pywps/validator/mode.html#MODE"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.validator.mode.MODE" title="Permalink to this definition">¶</a></dt>
-<dd><p>Validation mode enumeration</p>
-<dl class="attribute">
-<dt id="pywps.validator.mode.MODE.NONE">
-<code class="descname">NONE</code><em class="property"> = 0</em><a class="headerlink" href="#pywps.validator.mode.MODE.NONE" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="attribute">
-<dt id="pywps.validator.mode.MODE.SIMPLE">
-<code class="descname">SIMPLE</code><em class="property"> = 1</em><a class="headerlink" href="#pywps.validator.mode.MODE.SIMPLE" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="attribute">
-<dt id="pywps.validator.mode.MODE.STRICT">
-<code class="descname">STRICT</code><em class="property"> = 2</em><a class="headerlink" href="#pywps.validator.mode.MODE.STRICT" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-<dl class="attribute">
-<dt id="pywps.validator.mode.MODE.VERYSTRICT">
-<code class="descname">VERYSTRICT</code><em class="property"> = 3</em><a class="headerlink" href="#pywps.validator.mode.MODE.VERYSTRICT" title="Permalink to this definition">¶</a></dt>
-<dd></dd></dl>
-
-</dd></dl>
-
-<p>Most of the inputs nad outputs are derived from the <cite>IOHandler</cite> class</p>
-<dl class="class">
-<dt id="pywps.inout.basic.IOHandler">
-<em class="property">class </em><code class="descclassname">pywps.inout.basic.</code><code class="descname">IOHandler</code><span class="sig-paren">(</span><em>workdir=None</em>, <em>mode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/inout/basic.html#IOHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.inout.basic.IOHandler" title="Permalink to this definition">¶</a></dt>
-<dd><p>Basic IO class. Provides functions, to accept input data in file,
-memory object and stream object and give them out in all three types</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="c1"># setting up </span>
-<span class="gp">>>> </span><span class="kn">import</span> <span class="nn">os</span>
-<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">io</span> <span class="kn">import</span> <span class="n">RawIOBase</span>
-<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">io</span> <span class="kn">import</span> <span class="n">FileIO</span>
-<span class="gp">>>> </span><span class="kn">import</span> <span class="nn">types</span>
-<span class="go">>>></span>
-<span class="gp">>>> </span><span class="n">ioh_file</span> <span class="o">=</span> <span class="n">IOHandler</span><span class="p">(</span><span class="n">workdir</span><span class="o">=</span><span class="n">tmp</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">ioh_file</span><span class="p">,</span> <span class="n">IOHandler</span><span class="p">)</span>
-<span class="go">>>></span>
-<span class="gp">>>> </span><span class="c1"># Create test file input</span>
-<span class="gp">>>> </span><span class="n">fileobj</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tmp</span><span class="p">,</span> <span class="s1">'myfile.txt'</span><span class="p">),</span> <span class="s1">'w'</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">fileobj</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'ASDF ASFADSF ASF ASF ASDF ASFASF'</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="n">fileobj</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
-<span class="go">>>></span>
-<span class="gp">>>> </span><span class="c1"># testing file object on input</span>
-<span class="gp">>>> </span><span class="n">ioh_file</span><span class="o">.</span><span class="n">file</span> <span class="o">=</span> <span class="n">fileobj</span><span class="o">.</span><span class="n">name</span>
-<span class="gp">>>> </span><span class="k">assert</span> <span class="n">ioh_file</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">FILE</span>
-<span class="gp">>>> </span><span class="nb">file</span> <span class="o">=</span> <span class="n">ioh_file</span><span class="o">.</span><span class="n">file</span>
-<span class="gp">>>> </span><span class="n">stream</span> <span class="o">=</span> <span class="n">ioh_file</span><span class="o">.</span><span class="n">stream</span>
-<span class="go">>>></span>
-<span class="gp">>>> </span><span class="k">assert</span> <span class="nb">file</span> <span class="o">==</span> <span class="n">fileobj</span><span class="o">.</span><span class="n">name</span>
-<span class="gp">>>> </span><span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">stream</span><span class="p">,</span> <span class="n">RawIOBase</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="c1"># skipped assert isinstance(ioh_file.memory_object, POSH)</span>
-<span class="go">>>></span>
-<span class="gp">>>> </span><span class="c1"># testing stream object on input</span>
-<span class="gp">>>> </span><span class="n">ioh_stream</span> <span class="o">=</span> <span class="n">IOHandler</span><span class="p">(</span><span class="n">workdir</span><span class="o">=</span><span class="n">tmp</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="k">assert</span> <span class="n">ioh_stream</span><span class="o">.</span><span class="n">workdir</span> <span class="o">==</span> <span class="n">tmp</span>
-<span class="gp">>>> </span><span class="n">ioh_stream</span><span class="o">.</span><span class="n">stream</span> <span class="o">=</span> <span class="n">FileIO</span><span class="p">(</span><span class="n">fileobj</span><span class="o">.</span><span class="n">name</span><span class="p">,</span><span class="s1">'r'</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="k">assert</span> <span class="n">ioh_stream</span><span class="o">.</span><span class="n">source_type</span> <span class="o">==</span> <span class="n">SOURCE_TYPE</span><span class="o">.</span><span class="n">STREAM</span>
-<span class="gp">>>> </span><span class="nb">file</span> <span class="o">=</span> <span class="n">ioh_stream</span><span class="o">.</span><span class="n">file</span>
-<span class="gp">>>> </span><span class="n">stream</span> <span class="o">=</span> <span class="n">ioh_stream</span><span class="o">.</span><span class="n">stream</span>
-<span class="go">>>></span>
-<span class="gp">>>> </span><span class="k">assert</span> <span class="nb">open</span><span class="p">(</span><span class="nb">file</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span> <span class="o">==</span> <span class="n">ioh_file</span><span class="o">.</span><span class="n">stream</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
-<span class="gp">>>> </span><span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">stream</span><span class="p">,</span> <span class="n">RawIOBase</span><span class="p">)</span>
-<span class="gp">>>> </span><span class="c1"># skipped assert isinstance(ioh_stream.memory_object, POSH)</span>
-<span class="go">>>></span>
-<span class="gp">>>> </span><span class="c1"># testing in memory object object on input</span>
-<span class="gp">>>> </span><span class="c1"># skipped ioh_mo = IOHandler(workdir=tmp)</span>
-<span class="gp">>>> </span><span class="c1"># skipped ioh_mo.memory_object = POSH</span>
-<span class="gp">>>> </span><span class="c1"># skipped assert ioh_mo.source_type == SOURCE_TYPE.MEMORY</span>
-<span class="gp">>>> </span><span class="c1"># skipped file = ioh_mo.file</span>
-<span class="gp">>>> </span><span class="c1"># skipped stream = ioh_mo.stream</span>
-<span class="gp">>>> </span><span class="c1"># skipped posh = ioh_mo.memory_object</span>
-<span class="gp">>>> </span><span class="c1">#</span>
-<span class="gp">>>> </span><span class="c1"># skipped assert open(file).read() == ioh_file.stream.read()</span>
-<span class="gp">>>> </span><span class="c1"># skipped assert isinstance(ioh_mo.stream, RawIOBase)</span>
-<span class="gp">>>> </span><span class="c1"># skipped assert isinstance(ioh_mo.memory_object, POSH)</span>
-</pre></div>
-</div>
-</dd></dl>
-
-<div class="section" id="literaldata">
-<h3>LiteralData<a class="headerlink" href="#literaldata" title="Permalink to this headline">¶</a></h3>
-<dl class="class">
-<dt id="pywps.LiteralInput">
-<em class="property">class </em><code class="descclassname">pywps.</code><code class="descname">LiteralInput</code><span class="sig-paren">(</span><em>identifier</em>, <em>title</em>, <em>data_type='integer'</em>, <em>abstract=''</em>, <em>metadata=None</em>, <em>uoms=None</em>, <em>default=None</em>, <em>min_occurs=1</em>, <em>max_occurs=1</em>, <em>mode=1</em>, <em>allowed_values=<class 'pywps.inout.literaltypes.AnyValue'></em><span class="sig-paren">)</span><a class="reference i [...]
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>identifier</strong> (<em>str</em>) – The name of this input.</li>
-<li><strong>title</strong> (<em>str</em>) – Title of the input</li>
-<li><strong>data_type</strong> (<a class="reference internal" href="#pywps.inout.literaltypes.LITERAL_DATA_TYPES" title="pywps.inout.literaltypes.LITERAL_DATA_TYPES"><em>pywps.inout.literaltypes.LITERAL_DATA_TYPES</em></a>) – data type</li>
-<li><strong>abstract</strong> (<em>str</em>) – Input abstract</li>
-<li><strong>metadata</strong> (<em>list</em>) – TODO</li>
-<li><strong>uoms</strong> (<em>str</em>) – units</li>
-<li><strong>min_occurs</strong> (<em>int</em>) – minimum occurence</li>
-<li><strong>max_occurs</strong> (<em>int</em>) – maximum occurence</li>
-<li><strong>mode</strong> (<a class="reference internal" href="#pywps.validator.mode.MODE" title="pywps.validator.mode.MODE"><em>pywps.validator.mode.MODE</em></a>) – validation mode (none to strict)</li>
-<li><strong>allowed_values</strong> (<a class="reference internal" href="#pywps.inout.literaltypes.AnyValue" title="pywps.inout.literaltypes.AnyValue"><em>pywps.inout.literaltypes.AnyValue</em></a>) – or <a class="reference internal" href="#pywps.inout.literaltypes.AllowedValue" title="pywps.inout.literaltypes.AllowedValue"><code class="xref py py-class docutils literal"><span class="pre">pywps.inout.literaltypes.AllowedValue</span></code></a> object</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.LiteralOutput">
-<em class="property">class </em><code class="descclassname">pywps.</code><code class="descname">LiteralOutput</code><span class="sig-paren">(</span><em>identifier</em>, <em>title</em>, <em>data_type='string'</em>, <em>abstract=''</em>, <em>metadata=[]</em>, <em>uoms=[]</em>, <em>mode=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/inout/outputs.html#LiteralOutput"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.Li [...]
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>identifier</strong> – The name of this output.</li>
-<li><strong>title</strong> (<em>str</em>) – Title of the input</li>
-<li><strong>data_type</strong> (<a class="reference internal" href="#pywps.inout.literaltypes.LITERAL_DATA_TYPES" title="pywps.inout.literaltypes.LITERAL_DATA_TYPES"><em>pywps.inout.literaltypes.LITERAL_DATA_TYPES</em></a>) – data type</li>
-<li><strong>abstract</strong> (<em>str</em>) – Input abstract</li>
-<li><strong>uoms</strong> (<em>str</em>) – units</li>
-<li><strong>mode</strong> (<a class="reference internal" href="#pywps.validator.mode.MODE" title="pywps.validator.mode.MODE"><em>pywps.validator.mode.MODE</em></a>) – validation mode (none to strict)</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.inout.literaltypes.AnyValue">
-<em class="property">class </em><code class="descclassname">pywps.inout.literaltypes.</code><code class="descname">AnyValue</code><a class="reference internal" href="_modules/pywps/inout/literaltypes.html#AnyValue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.inout.literaltypes.AnyValue" title="Permalink to this definition">¶</a></dt>
-<dd><p>Any value for literal input</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.inout.literaltypes.AllowedValue">
-<em class="property">class </em><code class="descclassname">pywps.inout.literaltypes.</code><code class="descname">AllowedValue</code><span class="sig-paren">(</span><em>allowed_type='value'</em>, <em>value=None</em>, <em>minval=None</em>, <em>maxval=None</em>, <em>spacing=None</em>, <em>range_closure='closed'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/inout/literaltypes.html#AllowedValue"><span class="viewcode-link">[source]</span></a><a class [...]
-<dd><p>Allowed value parameters
-the values are evaluated in literal validator functions</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>allowed_type</strong> (<em>pywps.validator.allowed_value.ALLOWEDVALUETYPE</em>) – VALUE or RANGE</li>
-<li><strong>value</strong> – single value</li>
-<li><strong>minval</strong> – minimal value in case of Range</li>
-<li><strong>maxval</strong> – maximal value in case of Range</li>
-<li><strong>spacing</strong> – spacing in case of Range</li>
-<li><strong>range_closure</strong> (<em>pywps.input.literaltypes.RANGECLOSURETYPE</em>) – </li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="data">
-<dt id="pywps.inout.literaltypes.LITERAL_DATA_TYPES">
-<code class="descclassname">pywps.inout.literaltypes.</code><code class="descname">LITERAL_DATA_TYPES</code><em class="property"> = ('float', 'boolean', 'integer', 'string', 'positiveInteger', 'anyURI', 'time', 'scale', 'angle', 'nonNegativeInteger')</em><a class="headerlink" href="#pywps.inout.literaltypes.LITERAL_DATA_TYPES" title="Permalink to this definition">¶</a></dt>
-<dd><p>tuple() -> empty tuple
-tuple(iterable) -> tuple initialized from iterable’s items</p>
-<p>If the argument is a tuple, the return value is the same object.</p>
-</dd></dl>
-
-</div>
-<div class="section" id="complexdata">
-<h3>ComplexData<a class="headerlink" href="#complexdata" title="Permalink to this headline">¶</a></h3>
-<dl class="class">
-<dt id="pywps.ComplexInput">
-<em class="property">class </em><code class="descclassname">pywps.</code><code class="descname">ComplexInput</code><span class="sig-paren">(</span><em>identifier</em>, <em>title</em>, <em>supported_formats=None</em>, <em>data_format=None</em>, <em>abstract=''</em>, <em>metadata=[]</em>, <em>min_occurs=1</em>, <em>max_occurs=1</em>, <em>mode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/inout/inputs.html#ComplexInput"><span class="viewcode-link"> [...]
-<dd><p>Complex data input</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>identifier</strong> (<em>str</em>) – The name of this input.</li>
-<li><strong>title</strong> (<em>str</em>) – Title of the input</li>
-<li><strong>supported_formats</strong> (<em>pywps.inout.formats.Format</em>) – List of supported formats</li>
-<li><strong>data_format</strong> (<em>pywps.inout.formats.Format</em>) – default data format</li>
-<li><strong>abstract</strong> (<em>str</em>) – Input abstract</li>
-<li><strong>metada</strong> (<em>list</em>) – TODO</li>
-<li><strong>min_occurs</strong> (<em>int</em>) – minimum occurence</li>
-<li><strong>max_occurs</strong> (<em>int</em>) – maximum occurence</li>
-<li><strong>mode</strong> (<a class="reference internal" href="#pywps.validator.mode.MODE" title="pywps.validator.mode.MODE"><em>pywps.validator.mode.MODE</em></a>) – validation mode (none to strict)</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.ComplexOutput">
-<em class="property">class </em><code class="descclassname">pywps.</code><code class="descname">ComplexOutput</code><span class="sig-paren">(</span><em>identifier</em>, <em>title</em>, <em>supported_formats=None</em>, <em>abstract=''</em>, <em>metadata=None</em>, <em>mode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/inout/outputs.html#ComplexOutput"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.ComplexOutput" [...]
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>identifier</strong> – The name of this output.</li>
-<li><strong>title</strong> – Readable form of the output name.</li>
-<li><strong>supported_formats</strong> (<em>pywps.inout.formats.Format</em>) – List of supported
-formats. The first format in the list will be used as the default.</li>
-<li><strong>abstract</strong> (<em>str</em>) – Description of the output</li>
-<li><strong>mode</strong> (<a class="reference internal" href="#pywps.validator.mode.MODE" title="pywps.validator.mode.MODE"><em>pywps.validator.mode.MODE</em></a>) – validation mode (none to strict)</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.Format">
-<em class="property">class </em><code class="descclassname">pywps.</code><code class="descname">Format</code><span class="sig-paren">(</span><em>mime_type</em>, <em>schema=None</em>, <em>encoding=None</em>, <em>validate=<function emptyvalidator></em>, <em>mode=1</em>, <em>extension=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/inout/formats.html#Format"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.Fo [...]
-<dd><p>Input/output format specification</p>
-<p>Predefined Formats are stored in <a class="reference internal" href="#pywps.inout.formats.FORMATS" title="pywps.inout.formats.FORMATS"><code class="xref py py-class docutils literal"><span class="pre">pywps.inout.formats.FORMATS</span></code></a></p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>mime_type</strong> (<em>str</em>) – mimetype definition</li>
-<li><strong>schema</strong> (<em>str</em>) – xml schema definition</li>
-<li><strong>encoding</strong> (<em>str</em>) – base64 or not</li>
-<li><strong>validate</strong> (<em>function</em>) – function, which will perform validation. e.g.</li>
-<li><strong>mode</strong> (<em>number</em>) – validation mode</li>
-<li><strong>extension</strong> (<em>str</em>) – file extension</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="data">
-<dt id="pywps.inout.formats.FORMATS">
-<code class="descclassname">pywps.inout.formats.</code><code class="descname">FORMATS</code><a class="headerlink" href="#pywps.inout.formats.FORMATS" title="Permalink to this definition">¶</a></dt>
-<dd><p>FORMATS(GEOJSON, JSON, SHP, GML, GEOTIFF, WCS, WCS100, WCS110, WCS20, WFS, WFS100, WFS110, WFS20, WMS, WMS130, WMS110, WMS100)</p>
-<p>List of out of the box supported formats. User can add custom formats to the
-array.</p>
-</dd></dl>
-
-<dl class="function">
-<dt id="pywps.validator.complexvalidator.validategml">
-<code class="descclassname">pywps.validator.complexvalidator.</code><code class="descname">validategml</code><span class="sig-paren">(</span><em>data_input</em>, <em>mode</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/validator/complexvalidator.html#validategml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.validator.complexvalidator.validategml" title="Permalink to this definition">¶</a></dt>
-<dd><p>GML validation function</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>data_input</strong> – <a class="reference internal" href="#pywps.ComplexInput" title="pywps.ComplexInput"><code class="xref py py-class docutils literal"><span class="pre">ComplexInput</span></code></a></li>
-<li><strong>mode</strong> (<a class="reference internal" href="#pywps.validator.mode.MODE" title="pywps.validator.mode.MODE"><em>pywps.validator.mode.MODE</em></a>) – </li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<p>This function validates GML input based on given validation mode. Following
-happens, if <cite>mode</cite> parameter is given:</p>
-<dl class="docutils">
-<dt><cite>MODE.NONE</cite></dt>
-<dd>it will return always <cite>True</cite></dd>
-<dt><cite>MODE.SIMPLE</cite></dt>
-<dd>the mimetype will be checked</dd>
-<dt><cite>MODE.STRICT</cite></dt>
-<dd><a class="reference external" href="http://gdal.org/">GDAL/OGR</a> is used for getting the propper format.</dd>
-<dt><cite>MODE.VERYSTRICT</cite></dt>
-<dd>the <code class="xref py py-class docutils literal"><span class="pre">lxml.etree</span></code> is used along with given input <cite>schema</cite> and the
-GML file is properly validated against given schema.</dd>
-</dl>
-</dd></dl>
-
-</div>
-<div class="section" id="boundingboxdata">
-<h3>BoundingBoxData<a class="headerlink" href="#boundingboxdata" title="Permalink to this headline">¶</a></h3>
-<dl class="class">
-<dt id="pywps.BoundingBoxInput">
-<em class="property">class </em><code class="descclassname">pywps.</code><code class="descname">BoundingBoxInput</code><span class="sig-paren">(</span><em>identifier</em>, <em>title</em>, <em>crss</em>, <em>abstract=''</em>, <em>dimensions=2</em>, <em>metadata=None</em>, <em>min_occurs=1</em>, <em>max_occurs=1</em>, <em>mode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/inout/inputs.html#BoundingBoxInput"><span class="viewcode-link">[source]</sp [...]
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>identifier</strong> (<em>string</em>) – The name of this input.</li>
-<li><strong>title</strong> (<em>string</em>) – Human readable title</li>
-<li><strong>abstract</strong> (<em>string</em>) – Longer text description</li>
-<li><strong>crss</strong> – List of supported coordinate reference system (e.g. [‘EPSG:4326’])</li>
-<li><strong>dimensions</strong> (<em>int</em>) – 2 or 3</li>
-<li><strong>min_occurs</strong> (<em>int</em>) – how many times this input occurs</li>
-<li><strong>max_occurs</strong> (<em>int</em>) – how many times this input occurs</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.BoundingBoxOutput">
-<em class="property">class </em><code class="descclassname">pywps.</code><code class="descname">BoundingBoxOutput</code><span class="sig-paren">(</span><em>identifier</em>, <em>title</em>, <em>crss</em>, <em>abstract=''</em>, <em>dimensions=2</em>, <em>metadata=None</em>, <em>min_occurs='1'</em>, <em>max_occurs='1'</em>, <em>as_reference=False</em>, <em>mode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/inout/outputs.html#BoundingBoxOutput"><spa [...]
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>identifier</strong> – The name of this input.</li>
-<li><strong>title</strong> (<em>str</em>) – Title of the input</li>
-<li><strong>abstract</strong> (<em>str</em>) – Input abstract</li>
-<li><strong>crss</strong> – List of supported coordinate reference system (e.g. [‘EPSG:4326’])</li>
-<li><strong>dimensions</strong> (<em>int</em>) – number of dimensions (2 or 3)</li>
-<li><strong>min_occurs</strong> (<em>int</em>) – minimum occurence</li>
-<li><strong>max_occurs</strong> (<em>int</em>) – maximum occurence</li>
-<li><strong>mode</strong> (<a class="reference internal" href="#pywps.validator.mode.MODE" title="pywps.validator.mode.MODE"><em>pywps.validator.mode.MODE</em></a>) – validation mode (none to strict)</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-</div>
-<div class="section" id="request-and-response-objects">
-<h3>Request and response objects<a class="headerlink" href="#request-and-response-objects" title="Permalink to this headline">¶</a></h3>
-<dl class="data">
-<dt id="pywps.app.WPSResponse.STATUS">
-<code class="descclassname">pywps.app.WPSResponse.</code><code class="descname">STATUS</code><a class="headerlink" href="#pywps.app.WPSResponse.STATUS" title="Permalink to this definition">¶</a></dt>
-<dd><p>Status(NO_STATUS, STORE_STATUS, STORE_AND_UPDATE_STATUS, DONE_STATUS)</p>
-<p>Process status information</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.app.WPSRequest">
-<em class="property">class </em><code class="descclassname">pywps.app.</code><code class="descname">WPSRequest</code><span class="sig-paren">(</span><em>http_request=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/app/WPSRequest.html#WPSRequest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.app.WPSRequest" title="Permalink to this definition">¶</a></dt>
-<dd><dl class="attribute">
-<dt id="pywps.WPSRequest.operation">
-<code class="descname">operation</code><a class="headerlink" href="#pywps.WPSRequest.operation" title="Permalink to this definition">¶</a></dt>
-<dd><p>Type of operation requested by the client. Can be
-<cite>getcapabilities</cite>, <cite>describeprocess</cite> or <cite>execute</cite>.</p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pywps.WPSRequest.http_request">
-<code class="descname">http_request</code><a class="headerlink" href="#pywps.WPSRequest.http_request" title="Permalink to this definition">¶</a></dt>
-<dd><p>Original Werkzeug HTTPRequest object.</p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pywps.WPSRequest.inputs">
-<code class="descname">inputs</code><a class="headerlink" href="#pywps.WPSRequest.inputs" title="Permalink to this definition">¶</a></dt>
-<dd><p>A MultiDict object containing input values sent by the client.</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="pywps.app.WPSRequest.check_accepted_versions">
-<code class="descname">check_accepted_versions</code><span class="sig-paren">(</span><em>acceptedversions</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/app/WPSRequest.html#WPSRequest.check_accepted_versions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.app.WPSRequest.check_accepted_versions" title="Permalink to this definition">¶</a></dt>
-<dd><table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>acceptedversions</strong> – string</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="pywps.app.WPSRequest.check_and_set_language">
-<code class="descname">check_and_set_language</code><span class="sig-paren">(</span><em>language</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/app/WPSRequest.html#WPSRequest.check_and_set_language"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.app.WPSRequest.check_and_set_language" title="Permalink to this definition">¶</a></dt>
-<dd><p>set this.language</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="pywps.app.WPSRequest.check_and_set_version">
-<code class="descname">check_and_set_version</code><span class="sig-paren">(</span><em>version</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/app/WPSRequest.html#WPSRequest.check_and_set_version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.app.WPSRequest.check_and_set_version" title="Permalink to this definition">¶</a></dt>
-<dd><p>set this.version</p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="pywps.app.WPSRequest.json">
-<code class="descname">json</code><a class="headerlink" href="#pywps.app.WPSRequest.json" title="Permalink to this definition">¶</a></dt>
-<dd><p>Return JSON encoded representation of the request</p>
-</dd></dl>
-
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.app.WPSResponse">
-<em class="property">class </em><code class="descclassname">pywps.app.</code><code class="descname">WPSResponse</code><span class="sig-paren">(</span><em>process</em>, <em>wps_request</em>, <em>uuid</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/app/WPSResponse.html#WPSResponse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.app.WPSResponse" title="Permalink to this definition">¶</a></dt>
-<dd><dl class="attribute">
-<dt id="pywps.WPSResponse.status">
-<code class="descname">status</code><a class="headerlink" href="#pywps.WPSResponse.status" title="Permalink to this definition">¶</a></dt>
-<dd><p>Information about currently running process status
-<a class="reference internal" href="#pywps.app.WPSResponse.STATUS" title="pywps.app.WPSResponse.STATUS"><code class="xref py py-class docutils literal"><span class="pre">pywps.app.WPSResponse.STATUS</span></code></a></p>
-</dd></dl>
-
-<dl class="method">
-<dt id="pywps.app.WPSResponse.call_on_close">
-<code class="descname">call_on_close</code><span class="sig-paren">(</span><em>function</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/app/WPSResponse.html#WPSResponse.call_on_close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.app.WPSResponse.call_on_close" title="Permalink to this definition">¶</a></dt>
-<dd><p>Custom implementation of call_on_close of werkzeug
-TODO: rewrite this using werkzeug’s tools</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="pywps.app.WPSResponse.update_status">
-<code class="descname">update_status</code><span class="sig-paren">(</span><em>message=None</em>, <em>status_percentage=None</em>, <em>status=None</em>, <em>clean=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/app/WPSResponse.html#WPSResponse.update_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.app.WPSResponse.update_status" title="Permalink to this definition">¶</a></dt>
-<dd><p>Update status report of currently running process instance</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>message</strong> (<em>str</em>) – Message you need to share with the client</li>
-<li><strong>status_percentage</strong> (<em>int</em>) – Percent done (number betwen <0-100>)</li>
-<li><strong>status</strong> (<a class="reference internal" href="#pywps.app.WPSResponse.STATUS" title="pywps.app.WPSResponse.STATUS"><em>pywps.app.WPSResponse.STATUS</em></a>) – process status - user should usually
-ommit this parameter</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-</dd></dl>
-
-<p>Refer <a class="reference internal" href="exceptions.html#exceptions"><span>Exceptions</span></a> for their description.</p>
-</div>
-</div>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h3><a href="index.html">Table Of Contents</a></h3>
- <ul>
-<li><a class="reference internal" href="#">PyWPS API Doc</a><ul>
-<li><a class="reference internal" href="#process">Process</a></li>
-<li><a class="reference internal" href="#inputs-and-outputs">Inputs and outputs</a><ul>
-<li><a class="reference internal" href="#literaldata">LiteralData</a></li>
-<li><a class="reference internal" href="#complexdata">ComplexData</a></li>
-<li><a class="reference internal" href="#boundingboxdata">BoundingBoxData</a></li>
-<li><a class="reference internal" href="#request-and-response-objects">Request and response objects</a></li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>
-
- <h4>Previous topic</h4>
- <p class="topless"><a href="external_tools.html"
- title="previous chapter">PyWPS and external tools</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="development.html"
- title="next chapter">Developers Guide</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/api.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="development.html" title="Developers Guide"
- >next</a> |</li>
- <li class="right" >
- <a href="external_tools.html" title="PyWPS and external tools"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/configuration.html b/docs/_build/html/configuration.html
deleted file mode 100644
index 064d9e5..0000000
--- a/docs/_build/html/configuration.html
+++ /dev/null
@@ -1,340 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Configuration — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="next" title="Processes" href="process.html" />
- <link rel="prev" title="Installation" href="install.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="process.html" title="Processes"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="install.html" title="Installation"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="configuration">
-<span id="id1"></span><h1>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h1>
-<p>PyWPS is configured using a configuration file. The file uses the
-<a class="reference external" href="https://wiki.python.org/moin/ConfigParserExamples">ConfigParser</a> format.</p>
-<div class="versionadded">
-<p><span class="versionmodified">New in version 4.0.0.</span></p>
-</div>
-<div class="admonition warning">
-<p class="first admonition-title">Warning</p>
-<p class="last">Compatibility with PyWPS 3.x: major changes have been made
-to the config file in order to allow for shared configurations with <a class="reference external" href="http://pycsw.org/">PyCSW</a> and other projects.</p>
-</div>
-<p>The configuration file has 3 sections:</p>
-<blockquote>
-<div><ul class="simple">
-<li><cite>metadata:main</cite> for the server metadata inputs</li>
-<li><cite>server</cite> for server configuration</li>
-<li><cite>grass</cite> for <em>optional</em> configuration to support <a class="reference external" href="http://grass.osgeo.org">GRASS GIS</a></li>
-</ul>
-</div></blockquote>
-<p>PyWPS ships with a sample configuration file (<code class="docutils literal"><span class="pre">default-sample.cfg</span></code>).
-A similar file is also available in the <cite>demo</cite> service as
-described in <a class="reference internal" href="install.html#demo"><span>The demo service and its sample processes</span></a> section.</p>
-<p>Copy the file to <code class="docutils literal"><span class="pre">default.cfg</span></code> and edit the following:</p>
-<div class="section" id="metadata-main">
-<h2>[metadata:main]<a class="headerlink" href="#metadata-main" title="Permalink to this headline">¶</a></h2>
-<p>The <cite>[metadata:main]</cite> section was designed according to the <a class="reference external" href="http://docs.pycsw.org/en/latest/configuration.html">PyCSW project
-configuration file</a>.</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name" colspan="2">identification_title:</th></tr>
-<tr class="field-odd field"><td> </td><td class="field-body">the title of the service</td>
-</tr>
-<tr class="field-even field"><th class="field-name" colspan="2">identification_abstract:</th></tr>
-<tr class="field-even field"><td> </td><td class="field-body">some descriptive text about the service</td>
-</tr>
-<tr class="field-odd field"><th class="field-name" colspan="2">identification_keywords:</th></tr>
-<tr class="field-odd field"><td> </td><td class="field-body">comma delimited list of keywords about the service</td>
-</tr>
-<tr class="field-even field"><th class="field-name" colspan="2">identification_keywords_type:</th></tr>
-<tr class="field-even field"><td> </td><td class="field-body">keyword type as per the <a class="reference external" href="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode">ISO 19115 MD_KeywordTypeCode codelist</a>).
-Accepted values are <code class="docutils literal"><span class="pre">discipline</span></code>, <code class="docutils literal"><span class="pre">temporal</span></code>, <code class="docutils literal"><span class="pre">place</span></code>, <code class="docutils literal"><span class="pre">theme</span></code>,
-<code class="docutils literal"><span class="pre">stratum</span></code></td>
-</tr>
-<tr class="field-odd field"><th class="field-name" colspan="2">identification_fees:</th></tr>
-<tr class="field-odd field"><td> </td><td class="field-body">fees associated with the service</td>
-</tr>
-<tr class="field-even field"><th class="field-name" colspan="2">identification_accessconstraints:</th></tr>
-<tr class="field-even field"><td> </td><td class="field-body">access constraints associated with the service</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">provider_name:</th><td class="field-body">the name of the service provider</td>
-</tr>
-<tr class="field-even field"><th class="field-name">provider_url:</th><td class="field-body">the URL of the service provider</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">contact_name:</th><td class="field-body">the name of the provider contact</td>
-</tr>
-<tr class="field-even field"><th class="field-name" colspan="2">contact_position:</th></tr>
-<tr class="field-even field"><td> </td><td class="field-body">the position title of the provider contact</td>
-</tr>
-<tr class="field-odd field"><th class="field-name" colspan="2">contact_address:</th></tr>
-<tr class="field-odd field"><td> </td><td class="field-body">the address of the provider contact</td>
-</tr>
-<tr class="field-even field"><th class="field-name">contact_city:</th><td class="field-body">the city of the provider contact</td>
-</tr>
-<tr class="field-odd field"><th class="field-name" colspan="2">contact_stateorprovince:</th></tr>
-<tr class="field-odd field"><td> </td><td class="field-body">the province or territory of the provider contact</td>
-</tr>
-<tr class="field-even field"><th class="field-name" colspan="2">contact_postalcode:</th></tr>
-<tr class="field-even field"><td> </td><td class="field-body">the postal code of the provider contact</td>
-</tr>
-<tr class="field-odd field"><th class="field-name" colspan="2">contact_country:</th></tr>
-<tr class="field-odd field"><td> </td><td class="field-body">the country of the provider contact</td>
-</tr>
-<tr class="field-even field"><th class="field-name">contact_phone:</th><td class="field-body">the phone number of the provider contact</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">contact_fax:</th><td class="field-body">the facsimile number of the provider contact</td>
-</tr>
-<tr class="field-even field"><th class="field-name">contact_email:</th><td class="field-body">the email address of the provider contact</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">contact_url:</th><td class="field-body">the URL to more information about the provider contact</td>
-</tr>
-<tr class="field-even field"><th class="field-name">contact_hours:</th><td class="field-body">the hours of service to contact the provider</td>
-</tr>
-<tr class="field-odd field"><th class="field-name" colspan="2">contact_instructions:</th></tr>
-<tr class="field-odd field"><td> </td><td class="field-body">the how to contact the provider contact</td>
-</tr>
-<tr class="field-even field"><th class="field-name">contact_role:</th><td class="field-body">the role of the provider contact as per the <a class="reference external" href="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode">ISO 19115 CI_RoleCode codelist</a>).
-Accepted values are <code class="docutils literal"><span class="pre">author</span></code>, <code class="docutils literal"><span class="pre">processor</span></code>, <code class="docutils literal"><span class="pre">publisher</span></code>, <code class="docutils literal"><span class="pre">custodian</span></code>,
-<code class="docutils literal"><span class="pre">pointOfContact</span></code>, <code class="docutils literal"><span class="pre">distributor</span></code>, <code class="docutils literal"><span class="pre">user</span></code>, <code class="docutils literal"><span class="pre">resourceProvider</span></code>,
-<code class="docutils literal"><span class="pre">originator</span></code>, <code class="docutils literal"><span class="pre">owner</span></code>, <code class="docutils literal"><span class="pre">principalInvestigator</span></code></td>
-</tr>
-</tbody>
-</table>
-</div>
-<div class="section" id="server">
-<h2>[server]<a class="headerlink" href="#server" title="Permalink to this headline">¶</a></h2>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">url:</th><td class="field-body">the URL of the WPS service endpoint</td>
-</tr>
-<tr class="field-even field"><th class="field-name">language:</th><td class="field-body">the ISO 639-1 language and ISO 3166-1 alpha2 country code of the service
-(e.g. <code class="docutils literal"><span class="pre">en-CA</span></code>, <code class="docutils literal"><span class="pre">fr-CA</span></code>, <code class="docutils literal"><span class="pre">en-US</span></code>)</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">encoding:</th><td class="field-body">the content type encoding (e.g. <code class="docutils literal"><span class="pre">ISO-8859-1</span></code>, see
-<a class="reference external" href="https://docs.python.org/2/library/codecs.html#standard-encodings">https://docs.python.org/2/library/codecs.html#standard-encodings</a>). Default
-value is ‘UTF-8’</td>
-</tr>
-<tr class="field-even field"><th class="field-name">loglevel:</th><td class="field-body">the logging level (see
-<a class="reference external" href="http://docs.python.org/library/logging.html#logging-levels">http://docs.python.org/library/logging.html#logging-levels</a>)</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">logfile:</th><td class="field-body">the full file path to the log file</td>
-</tr>
-<tr class="field-even field"><th class="field-name" colspan="2">parallelprocesses:</th></tr>
-<tr class="field-even field"><td> </td><td class="field-body">maximum number of parallel running processes - set this number carefully.
-The effective number of parallel running processes is limited by the number
-of cores in the processor of the hosting machine. As well, speed and
-response time of hard drives impact ultimate processing performance. A
-reasonable number of parallel running processes is not higher than the
-number of processor cores.</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">logdatabase:</th><td class="field-body">SQLite3 file, where the login about requests/responses is to be stored. It
-can be set to <cite>”:memory:”</cite> to store the database in memory.</td>
-</tr>
-<tr class="field-even field"><th class="field-name">maxrequestsize:</th><td class="field-body">maximal request size. 0 for no limit</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">workdir:</th><td class="field-body">a directory to store all temporary files (which should be always deleted,
-once the process is finished).</td>
-</tr>
-<tr class="field-even field"><th class="field-name">outputpath:</th><td class="field-body">server path where to store output files.</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">outputurl:</th><td class="field-body">corresponding URL</td>
-</tr>
-</tbody>
-</table>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p><cite>outputpath</cite> and <cite>outputurl</cite> must corespond. <cite>outputpath</cite> is the name
-of the resulting target directory, where all output data files are
-stored (with unique names). <cite>outputurl</cite> is the corresponding full URL,
-which is targeting to <cite>outputpath</cite> directory.</p>
-<p class="last">Example: <cite>outputpath=/var/www/wps/outputs</cite> shall correspond with
-<cite>outputurl=http://foo.bar/wps/outputs</cite></p>
-</div>
-</div>
-<div class="section" id="grass">
-<h2>[grass]<a class="headerlink" href="#grass" title="Permalink to this headline">¶</a></h2>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">gisbase:</th><td class="field-body">directory of the GRASS GIS instalation, refered as <a class="reference external" href="https://grass.osgeo.org/grass73/manuals/variables.html">GISBASE</a></td>
-</tr>
-</tbody>
-</table>
-<div class="section" id="sample-file">
-<h3>Sample file<a class="headerlink" href="#sample-file" title="Permalink to this headline">¶</a></h3>
-<div class="highlight-python"><div class="highlight"><pre>[server]
-encoding=utf-8
-language=en-US
-url=http://localhost/wps
-maxoperations=30
-maxinputparamlength=1024
-maxsingleinputsize=
-maxrequestsize=3mb
-temp_path=/tmp/pywps/
-processes_path=
-outputurl=/data/
-outputpath=/tmp/outputs/
-logfile=
-loglevel=INFO
-logdatabase=
-workdir=
-
-[metadata:main]
-identification_title=PyWPS Processing Service
-identification_abstract=PyWPS is an implementation of the Web Processing Service standard from the Open Geospatial Consortium. PyWPS is written in Python.
-identification_keywords=PyWPS,WPS,OGC,processing
-identification_keywords_type=theme
-identification_fees=NONE
-identification_accessconstraints=NONE
-provider_name=Organization Name
-provider_url=http://pywps.org/
-contact_name=Lastname, Firstname
-contact_position=Position Title
-contact_address=Mailing Address
-contact_city=City
-contact_stateorprovince=Administrative Area
-contact_postalcode=Zip or Postal Code
-contact_country=Country
-contact_phone=+xx-xxx-xxx-xxxx
-contact_fax=+xx-xxx-xxx-xxxx
-contact_email=Email Address
-contact_url=Contact URL
-contact_hours=Hours of Service
-contact_instructions=During hours of service. Off on weekends.
-contact_role=pointOfContact
-
-[grass]
-gisbase=/usr/local/grass-7.3.svn/
-</pre></div>
-</div>
-</div>
-</div>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h3><a href="index.html">Table Of Contents</a></h3>
- <ul>
-<li><a class="reference internal" href="#">Configuration</a><ul>
-<li><a class="reference internal" href="#metadata-main">[metadata:main]</a></li>
-<li><a class="reference internal" href="#server">[server]</a></li>
-<li><a class="reference internal" href="#grass">[grass]</a><ul>
-<li><a class="reference internal" href="#sample-file">Sample file</a></li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>
-
- <h4>Previous topic</h4>
- <p class="topless"><a href="install.html"
- title="previous chapter">Installation</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="process.html"
- title="next chapter">Processes</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/configuration.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="process.html" title="Processes"
- >next</a> |</li>
- <li class="right" >
- <a href="install.html" title="Installation"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/deployment.html b/docs/_build/html/deployment.html
deleted file mode 100644
index a024508..0000000
--- a/docs/_build/html/deployment.html
+++ /dev/null
@@ -1,322 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Deployment to a production server — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="next" title="Migrating from PyWP 3.x to 4.x" href="migration.html" />
- <link rel="prev" title="Processes" href="process.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="migration.html" title="Migrating from PyWP 3.x to 4.x"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="process.html" title="Processes"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="deployment-to-a-production-server">
-<span id="deployment"></span><h1>Deployment to a production server<a class="headerlink" href="#deployment-to-a-production-server" title="Permalink to this headline">¶</a></h1>
-<p>As already described in the <a class="reference internal" href="install.html#installation"><span>Installation</span></a> section, no specific deployment
-procedures are for PyWPS when using flask-based server. But this formula is not
-intended to be used in a production environment. For production, <a class="reference external" href="https://httpd.apache.org/">Apache httpd</a> or <a class="reference external" href="https://nginx.org/">nginx</a> servers are
-more advised. PyWPS is runs as a <a class="reference external" href="https://wsgi.readthedocs.io/en/latest/">WSGI</a> application on those servers. PyWPS
-relies on the <a class="reference external" href="http://werkzeug.pocoo.org/">Werkzeug</a> library for this purpose.</p>
-<div class="section" id="deoploying-an-individual-pywps-instance">
-<h2>Deoploying an individual PyWPS instance<a class="headerlink" href="#deoploying-an-individual-pywps-instance" title="Permalink to this headline">¶</a></h2>
-<p>PyWPS should be installed in your computer (as per the <a class="reference internal" href="install.html#installation"><span>Installation</span></a>
-section). As a following step, you can now create several instances of your WPS
-server.</p>
-<p>It is advisable for each PyWPS instance to have its own directory, where the
-WSGI file along with available processes should reside. Therefore create a new
-directory for the PyWPS instance:</p>
-<div class="highlight-python"><div class="highlight"><pre>$ sudo mkdir /var/www/pywps/
-
-# create a directory for your processes too
-$ sudo mkdir /var/www/pywps/processes
-</pre></div>
-</div>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">In this configuration example it is assumed that there is only one
-instance of PyWPS on the server.</p>
-</div>
-<p>Each instance is represented by a single <cite>WSGI</cite> script (written in Python),
-which:</p>
-<blockquote>
-<div><ol class="arabic simple">
-<li>Loads the configuration files</li>
-<li>Serves processes</li>
-<li>Takes care about maximum number of concurrent processes and similar</li>
-</ol>
-</div></blockquote>
-</div>
-<div class="section" id="creating-a-pywps-wsgi-instance">
-<h2>Creating a PyWPS <cite>WSGI</cite> instance<a class="headerlink" href="#creating-a-pywps-wsgi-instance" title="Permalink to this headline">¶</a></h2>
-<p>An example WSGI script is distributed along with PyWPS-Demo service, as
-described in the <a class="reference internal" href="install.html#installation"><span>Installation</span></a> section. The script is actually
-straightforward - in fact, it’s a just wrapper around the PyWPS server with a
-list of processes and configuration files passed as arguments. Here is an
-example of a PyWPS WSGI script:</p>
-<div class="highlight-python"><div class="highlight"><pre>$ $EDITOR /var/www/pywps/pywps.wcgi
-</pre></div>
-</div>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30</pre></div></td><td class="code"><div class="highlight"><pre><span class="ch">#!/usr/bin/env python3</span>
-
-<span class="kn">from</span> <span class="nn">pywps.app.Service</span> <span class="kn">import</span> <span class="n">Service</span>
-
-<span class="c1"># processes need to be installed in PYTHON_PATH</span>
-<span class="kn">from</span> <span class="nn">processes.sleep</span> <span class="kn">import</span> <span class="n">Sleep</span>
-<span class="kn">from</span> <span class="nn">processes.ultimate_question</span> <span class="kn">import</span> <span class="n">UltimateQuestion</span>
-<span class="kn">from</span> <span class="nn">processes.centroids</span> <span class="kn">import</span> <span class="n">Centroids</span>
-<span class="kn">from</span> <span class="nn">processes.sayhello</span> <span class="kn">import</span> <span class="n">SayHello</span>
-<span class="kn">from</span> <span class="nn">processes.feature_count</span> <span class="kn">import</span> <span class="n">FeatureCount</span>
-<span class="kn">from</span> <span class="nn">processes.buffer</span> <span class="kn">import</span> <span class="n">Buffer</span>
-<span class="kn">from</span> <span class="nn">processes.area</span> <span class="kn">import</span> <span class="n">Area</span>
-
-<span class="n">processes</span> <span class="o">=</span> <span class="p">[</span>
- <span class="n">FeatureCount</span><span class="p">(),</span>
- <span class="n">SayHello</span><span class="p">(),</span>
- <span class="n">Centroids</span><span class="p">(),</span>
- <span class="n">UltimateQuestion</span><span class="p">(),</span>
- <span class="n">Sleep</span><span class="p">(),</span>
- <span class="n">Buffer</span><span class="p">(),</span>
- <span class="n">Area</span><span class="p">()</span>
-<span class="p">]</span>
-
-<span class="c1"># Service accepts two parameters:</span>
-<span class="c1"># 1 - list of process instances</span>
-<span class="c1"># 2 - list of configuration files</span>
-<span class="n">application</span> <span class="o">=</span> <span class="n">Service</span><span class="p">(</span>
- <span class="n">processes</span><span class="p">,</span>
- <span class="p">[</span><span class="s1">'/var/www/pywps/pywps.cfg'</span><span class="p">]</span>
-<span class="p">)</span>
-</pre></div>
-</td></tr></table></div>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p>The WSGI script is assuming that there are already some
-processes at hand that can be directly included. Also it assumes, that
-the configuration file already exists - which is not the case yet.</p>
-<p class="last">The Configuration is described in next chapter (<a class="reference internal" href="configuration.html#configuration"><span>Configuration</span></a>),
-as well as process creation and deployment (<a class="reference internal" href="process.html#process"><span>Processes</span></a>).</p>
-</div>
-</div>
-<div class="section" id="deployment-on-apache2-httpd-server">
-<h2>Deployment on Apache2 httpd server<a class="headerlink" href="#deployment-on-apache2-httpd-server" title="Permalink to this headline">¶</a></h2>
-<p>First, the WSGI module must be installed and enabled:</p>
-<div class="highlight-python"><div class="highlight"><pre>$ sudo apt-get install libapache2-mod-wsgi
-$ sudo a2enmod wsgi
-</pre></div>
-</div>
-<p>You then can edit your site configuration file
-(<cite>/etc/apache2/sites-enabled/yoursite.conf</cite>) and add the following:</p>
-<div class="highlight-python"><div class="highlight"><pre># PyWPS-4
-WSGIDaemonProcess pywps user=www-data group=www-data processes=2 threads=5
-WSGIScriptAlias /pywps /var/www/pywps/pywps.wsgi
-
-<Directory /home/jachym/www/htdocs/wps/>
- WSGIScriptReloading On
- WSGIProcessGroup group
- WSGIApplicationGroup %{GLOBAL}
- Order deny,allow
- Allow from all
-</Directory>
-</pre></div>
-</div>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last"><cite>WSGIScriptAlias</cite> points to the <cite>pywps.wsgi</cite> script created
-before - it will be available under the url <a class="reference external" href="http://localhost/pywps">http://localhost/pywps</a></p>
-</div>
-<p>And of course restart the server:</p>
-<div class="highlight-python"><div class="highlight"><pre>$ sudo service apache2 restart
-</pre></div>
-</div>
-</div>
-<div class="section" id="deployment-on-nginx">
-<h2>Deployment on nginx<a class="headerlink" href="#deployment-on-nginx" title="Permalink to this headline">¶</a></h2>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">We are currently missing documentation about <cite>nginx</cite>.
-Please help documenting the deployment of PyWPS to nginx.</p>
-</div>
-<p>You should be able to deploy PyWPS on nginx as a standard WSGI application. The
-best documentation is probably to be found at <a class="reference external" href="http://uwsgi-docs.readthedocs.io/en/latest/WSGIquickstart.html">Readthedocs</a>.</p>
-</div>
-<div class="section" id="testing-the-deployment-of-a-pywps-instance">
-<span id="deployment-testing"></span><h2>Testing the deployment of a PyWPS instance<a class="headerlink" href="#testing-the-deployment-of-a-pywps-instance" title="Permalink to this headline">¶</a></h2>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">For the purpose of this documentation, it is assumed that you’ve
-installed PyWPS using the <cite>localhost</cite> server domain name.</p>
-</div>
-<p>As stated, before, PyWPS should be available at <a class="reference external" href="http://localhost/pywps">http://localhost/pywps</a>, we now
-can visit the url (or use <cite>wget</cite>):</p>
-<div class="highlight-python"><div class="highlight"><pre># the --content-error parameter makes sure, error response is displayed
-$ wget --content-error -O - "http://localhost/pywps"
-</pre></div>
-</div>
-<p>The result should be an XML-encoded error message.</p>
-<div class="highlight-xml"><div class="highlight"><pre><span class="cp"><?xml version="1.0" encoding="UTF-8"?></span>
-<span class="c"><!-- PyWPS 4.0.0-alpha2 --></span>
-<span class="nt"><ows:ExceptionReport</span> <span class="na">xmlns:ows=</span><span class="s">"http://www.opengis.net/ows/1.1"</span> <span class="na">xmlns:xsi=</span><span class="s">"http://www.w3.org/2001/XMLSchema-instance"</span> <span class="na">xsi:schemaLocation=</span><span class="s">"http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd"</span> <span class="na">version=</span><span class="s">"1.0.0" [...]
- <span class="nt"><ows:Exception</span> <span class="na">exceptionCode=</span><span class="s">"MissingParameterValue"</span> <span class="na">locator=</span><span class="s">"service"</span> <span class="nt">></span>
- <span class="nt"><ows:ExceptionText></span>service<span class="nt"></ows:ExceptionText></span>
- <span class="nt"></ows:Exception></span>
-<span class="nt"></ows:ExceptionReport></span>
-</pre></div>
-</div>
-<p>The server responded with the <a class="reference internal" href="exceptions.html#pywps.exceptions.MissingParameterValue" title="pywps.exceptions.MissingParameterValue"><code class="xref py py-class docutils literal"><span class="pre">pywps.exceptions.MissingParameterValue</span></code></a>
-exception, telling us that the parameter <cite>service</cite> was not set. This is
-compliant with the OGC WPS standard, since each request mast have at least the
-<cite>service</cite> and <cite>request</cite> parameters. We can say for now, that this PyWPS
-instance is properly deployed on the server, since it returns proper exception
-report.</p>
-<p>We now have to configure the instance by editing the <cite>pywps.cfg</cite> file and adding
-some processes.</p>
-</div>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h3><a href="index.html">Table Of Contents</a></h3>
- <ul>
-<li><a class="reference internal" href="#">Deployment to a production server</a><ul>
-<li><a class="reference internal" href="#deoploying-an-individual-pywps-instance">Deoploying an individual PyWPS instance</a></li>
-<li><a class="reference internal" href="#creating-a-pywps-wsgi-instance">Creating a PyWPS <cite>WSGI</cite> instance</a></li>
-<li><a class="reference internal" href="#deployment-on-apache2-httpd-server">Deployment on Apache2 httpd server</a></li>
-<li><a class="reference internal" href="#deployment-on-nginx">Deployment on nginx</a></li>
-<li><a class="reference internal" href="#testing-the-deployment-of-a-pywps-instance">Testing the deployment of a PyWPS instance</a></li>
-</ul>
-</li>
-</ul>
-
- <h4>Previous topic</h4>
- <p class="topless"><a href="process.html"
- title="previous chapter">Processes</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="migration.html"
- title="next chapter">Migrating from PyWP 3.x to 4.x</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/deployment.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="migration.html" title="Migrating from PyWP 3.x to 4.x"
- >next</a> |</li>
- <li class="right" >
- <a href="process.html" title="Processes"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/development.html b/docs/_build/html/development.html
deleted file mode 100644
index 70f6828..0000000
--- a/docs/_build/html/development.html
+++ /dev/null
@@ -1,232 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Developers Guide — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="next" title="Exceptions" href="exceptions.html" />
- <link rel="prev" title="PyWPS API Doc" href="api.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="exceptions.html" title="Exceptions"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="api.html" title="PyWPS API Doc"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="developers-guide">
-<h1>Developers Guide<a class="headerlink" href="#developers-guide" title="Permalink to this headline">¶</a></h1>
-<p>If you identify a bug in the PyWPS code base and want to fix it, if you would
-like to add further functionality, or if you wish to expand the documentation,
-you are welcomed to contribute such changes. However, contributions to the
-code base must follow an orderly process, described below. This facilitates
-both the work on your contribution as its review.</p>
-<div class="section" id="github-account">
-<h2>0. GitHub account<a class="headerlink" href="#github-account" title="Permalink to this headline">¶</a></h2>
-<p>The PyWPS source code is hosted at GitHub, therefore you need an account to contribute.
-If you do not have one, you can follow
-<a class="reference external" href="https://help.github.com/categories/setup/">these instructions</a>.</p>
-</div>
-<div class="section" id="open-a-new-issue">
-<h2>1. Open a new issue<a class="headerlink" href="#open-a-new-issue" title="Permalink to this headline">¶</a></h2>
-<p>The first action to take is to clearly identify the goal of your contribution.
-Be it a bug fix, a new feature or documentation, a clear record must be left
-for future tracking. This is made by opening an issue at the <a class="reference external" href="https://github.com/geopython/pywps/issues">GitHub issue
-tracker</a>. In this new issue you
-should identify not only the subject or goal, but also a draft
-of the changes you expect to achieve. For example:</p>
-<blockquote>
-<div><p><strong>Title</strong>: Process class must be magic</p>
-<p><strong>Description</strong>: The Process class must start performing some magics. Give it
-a magic wand.</p>
-</div></blockquote>
-</div>
-<div class="section" id="fork-and-clone-the-pywps-repository">
-<h2>2. Fork and clone the PyWPS repository<a class="headerlink" href="#fork-and-clone-the-pywps-repository" title="Permalink to this headline">¶</a></h2>
-<p>When you start modifying to the code, there is always the possibility for
-something to go wrong, rendering PyWPS unusable. The first action to avoid such
-a situation is to create a development sand box. In GitHub this can
-easily be made by creating a fork of the main PyWPS repository. Access the
-<a class="reference external" href="https://github.com/geopython/PyWPS">PyWPS code repository</a> and click the
-<em>Fork</em> button. This action creates a copy of the repository associated with
-your GitHub user. For more details please read <a class="reference external" href="https://guides.github.com/activities/forking/">the forking guide</a>.</p>
-<p>Now you can clone this forked repository into your development environment,
-issuing a command like:</p>
-<div class="highlight-python"><div class="highlight"><pre>git clone https://github.com/<github-user>/PyWPS.git pywps
-</pre></div>
-</div>
-<p>Where you should replace <em><github-user></em> with your GitHub user name.</p>
-<p>You can finally start programming your new feature, or fixing that bug you
-found. Keep in mind that PyWPS depends on a few libraries, refer to the
-<a class="reference internal" href="install.html#installation"><span>Installation</span></a> section to make sure you have all of them installed.</p>
-</div>
-<div class="section" id="commit-and-pull-request">
-<h2>3. Commit and pull request<a class="headerlink" href="#commit-and-pull-request" title="Permalink to this headline">¶</a></h2>
-<p>If your modification to code is relatively small and can be included in a
-single <em>commit</em> then all you need to is reference the issue in the <strong>commit</strong>
-message, e.g.:</p>
-<div class="highlight-python"><div class="highlight"><pre>git commit -m "Fixes #107"
-</pre></div>
-</div>
-<p>Where <em>107</em> is the number of the issue you opened initially in the PyWPS
-issue tracker. Please refer to <a class="reference external" href="https://help.github.com/articles/closing-issues-via-commit-messages/">the guide on closing issues with commits
-messages</a>. Then
-you push the changes to your forked repository, issuing a command like:</p>
-<div class="highlight-python"><div class="highlight"><pre>git push origin master
-</pre></div>
-</div>
-<p>Finally you an create a pull request. This it is a formal request to merge your
-contribution with the code base; it is fully managed by GitHub and greatly
-facilitates the review process. You do so by accessing the repository
-associated with your user and clicking the <em>New pull request</em> button. Make sure
-your contribution is not creating conflicts and click <em>Create pull request</em>.
-If needed, there is also a <a class="reference external" href="https://help.github.com/articles/creating-a-pull-request/">guide on pull requests</a>.</p>
-<p>If you contribution is more substantial, and composed of multiple commits, then
-you must identify the issue it closes in the pull request itself. Check out
-<a class="reference external" href="https://github.com/blog/1506-closing-issues-via-pull-requests">this guide</a> for
-the details.</p>
-<p>The members of the PyWPS PSC are then notified if your pull request. They
-review your contribution and hopefully accept merging it to the code base.</p>
-</div>
-<div class="section" id="updating-local-repository">
-<h2>4. Updating local repository<a class="headerlink" href="#updating-local-repository" title="Permalink to this headline">¶</a></h2>
-<p>Later on, if you wish to make further contributions, you must make sure to be
-working with the very latest version of the code base. You can add another
-<em>remote</em> reference in your local repository pointing to the main PyWPS
-repository:</p>
-<div class="highlight-python"><div class="highlight"><pre>git remote add upstream https://github.com/geopython/PyWPS
-</pre></div>
-</div>
-<p>Then you can use the <em>fetch</em> command to update your local repository metadata:</p>
-<div class="highlight-python"><div class="highlight"><pre>git fetch upstream
-</pre></div>
-</div>
-<p>Finally you use a <em>pull</em> command to merge the latest <em>commits</em> into your local
-repository:</p>
-<div class="highlight-python"><div class="highlight"><pre>git pull upstream master
-</pre></div>
-</div>
-</div>
-<div class="section" id="help-and-discussion">
-<h2>5. Help and discussion<a class="headerlink" href="#help-and-discussion" title="Permalink to this headline">¶</a></h2>
-<p>If you have any doubts or questions about this contribution process or about the
-code please use the <a class="reference external" href="http://lists.osgeo.org/mailman/listinfo/pywps-dev">PyWPS mailing list</a> . This is also the right
-place to propose and discuss the changes you intend to introduce.</p>
-</div>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h3><a href="index.html">Table Of Contents</a></h3>
- <ul>
-<li><a class="reference internal" href="#">Developers Guide</a><ul>
-<li><a class="reference internal" href="#github-account">0. GitHub account</a></li>
-<li><a class="reference internal" href="#open-a-new-issue">1. Open a new issue</a></li>
-<li><a class="reference internal" href="#fork-and-clone-the-pywps-repository">2. Fork and clone the PyWPS repository</a></li>
-<li><a class="reference internal" href="#commit-and-pull-request">3. Commit and pull request</a></li>
-<li><a class="reference internal" href="#updating-local-repository">4. Updating local repository</a></li>
-<li><a class="reference internal" href="#help-and-discussion">5. Help and discussion</a></li>
-</ul>
-</li>
-</ul>
-
- <h4>Previous topic</h4>
- <p class="topless"><a href="api.html"
- title="previous chapter">PyWPS API Doc</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="exceptions.html"
- title="next chapter">Exceptions</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/development.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="exceptions.html" title="Exceptions"
- >next</a> |</li>
- <li class="right" >
- <a href="api.html" title="PyWPS API Doc"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/exceptions.html b/docs/_build/html/exceptions.html
deleted file mode 100644
index c982a77..0000000
--- a/docs/_build/html/exceptions.html
+++ /dev/null
@@ -1,166 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Exceptions — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="prev" title="Developers Guide" href="development.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="development.html" title="Developers Guide"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="exceptions">
-<span id="id1"></span><h1>Exceptions<a class="headerlink" href="#exceptions" title="Permalink to this headline">¶</a></h1>
-<span class="target" id="module-pywps.exceptions"></span><p>PyWPS-4 will throw exceptions based on the error occurred.
-The exceptions will point out what is missing or what went wrong
-as accurately as possible.</p>
-<p>Here is the list of Exceptions and HTTP error codes associated with them:</p>
-<dl class="class">
-<dt id="pywps.exceptions.NoApplicableCode">
-<em class="property">class </em><code class="descclassname">pywps.exceptions.</code><code class="descname">NoApplicableCode</code><span class="sig-paren">(</span><em>description</em>, <em>locator=''</em>, <em>code=400</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/exceptions.html#NoApplicableCode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.exceptions.NoApplicableCode" title="Permalink to this definition">¶</a></dt>
-<dd><p>No applicable code exception implementation</p>
-<p>also</p>
-<p>Base exception class</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.exceptions.InvalidParameterValue">
-<em class="property">class </em><code class="descclassname">pywps.exceptions.</code><code class="descname">InvalidParameterValue</code><span class="sig-paren">(</span><em>description</em>, <em>locator=''</em>, <em>code=400</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/exceptions.html#InvalidParameterValue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.exceptions.InvalidParameterValue" title="Permalink to this de [...]
-<dd><p>Invalid parameter value exception implementation</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.exceptions.MissingParameterValue">
-<em class="property">class </em><code class="descclassname">pywps.exceptions.</code><code class="descname">MissingParameterValue</code><span class="sig-paren">(</span><em>description</em>, <em>locator=''</em>, <em>code=400</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/exceptions.html#MissingParameterValue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.exceptions.MissingParameterValue" title="Permalink to this de [...]
-<dd><p>Missing parameter value exception implementation</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.exceptions.FileSizeExceeded">
-<em class="property">class </em><code class="descclassname">pywps.exceptions.</code><code class="descname">FileSizeExceeded</code><span class="sig-paren">(</span><em>description</em>, <em>locator=''</em>, <em>code=400</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/exceptions.html#FileSizeExceeded"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.exceptions.FileSizeExceeded" title="Permalink to this definition">¶</a></dt>
-<dd><p>File size exceeded exception implementation</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.exceptions.VersionNegotiationFailed">
-<em class="property">class </em><code class="descclassname">pywps.exceptions.</code><code class="descname">VersionNegotiationFailed</code><span class="sig-paren">(</span><em>description</em>, <em>locator=''</em>, <em>code=400</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/exceptions.html#VersionNegotiationFailed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.exceptions.VersionNegotiationFailed" title="Permalink t [...]
-<dd><p>Version negotiation exception implementation</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.exceptions.OperationNotSupported">
-<em class="property">class </em><code class="descclassname">pywps.exceptions.</code><code class="descname">OperationNotSupported</code><span class="sig-paren">(</span><em>description</em>, <em>locator=''</em>, <em>code=400</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/exceptions.html#OperationNotSupported"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.exceptions.OperationNotSupported" title="Permalink to this de [...]
-<dd><p>Operation not supported exception implementation</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.exceptions.StorageNotSupported">
-<em class="property">class </em><code class="descclassname">pywps.exceptions.</code><code class="descname">StorageNotSupported</code><span class="sig-paren">(</span><em>description</em>, <em>locator=''</em>, <em>code=400</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/exceptions.html#StorageNotSupported"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.exceptions.StorageNotSupported" title="Permalink to this definiti [...]
-<dd><p>Storage not supported exception implementation</p>
-</dd></dl>
-
-<dl class="class">
-<dt id="pywps.exceptions.NotEnoughStorage">
-<em class="property">class </em><code class="descclassname">pywps.exceptions.</code><code class="descname">NotEnoughStorage</code><span class="sig-paren">(</span><em>description</em>, <em>locator=''</em>, <em>code=400</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pywps/exceptions.html#NotEnoughStorage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pywps.exceptions.NotEnoughStorage" title="Permalink to this definition">¶</a></dt>
-<dd><p>Storage not supported exception implementation</p>
-</dd></dl>
-
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h4>Previous topic</h4>
- <p class="topless"><a href="development.html"
- title="previous chapter">Developers Guide</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/exceptions.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="development.html" title="Developers Guide"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/external_tools.html b/docs/_build/html/external_tools.html
deleted file mode 100644
index d13cfcd..0000000
--- a/docs/_build/html/external_tools.html
+++ /dev/null
@@ -1,138 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>PyWPS and external tools — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="next" title="PyWPS API Doc" href="api.html" />
- <link rel="prev" title="Migrating from PyWP 3.x to 4.x" href="migration.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="api.html" title="PyWPS API Doc"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="migration.html" title="Migrating from PyWP 3.x to 4.x"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="pywps-and-external-tools">
-<h1>PyWPS and external tools<a class="headerlink" href="#pywps-and-external-tools" title="Permalink to this headline">¶</a></h1>
-<div class="section" id="grass-gis">
-<h2>GRASS GIS<a class="headerlink" href="#grass-gis" title="Permalink to this headline">¶</a></h2>
-<div class="admonition-todo admonition" id="index-0">
-<p class="first admonition-title">Todo</p>
-<p class="last">How to setup and get GRASS GIS up and running with PyWPS and example
-process</p>
-</div>
-</div>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h3><a href="index.html">Table Of Contents</a></h3>
- <ul>
-<li><a class="reference internal" href="#">PyWPS and external tools</a><ul>
-<li><a class="reference internal" href="#grass-gis">GRASS GIS</a></li>
-</ul>
-</li>
-</ul>
-
- <h4>Previous topic</h4>
- <p class="topless"><a href="migration.html"
- title="previous chapter">Migrating from PyWP 3.x to 4.x</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="api.html"
- title="next chapter">PyWPS API Doc</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/external_tools.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="api.html" title="PyWPS API Doc"
- >next</a> |</li>
- <li class="right" >
- <a href="migration.html" title="Migrating from PyWP 3.x to 4.x"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html
deleted file mode 100644
index c40b66a..0000000
--- a/docs/_build/html/genindex.html
+++ /dev/null
@@ -1,430 +0,0 @@
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Index — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="#" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
-
-<h1 id="index">Index</h1>
-
-<div class="genindex-jumpbox">
- <a href="#A"><strong>A</strong></a>
- | <a href="#B"><strong>B</strong></a>
- | <a href="#C"><strong>C</strong></a>
- | <a href="#E"><strong>E</strong></a>
- | <a href="#F"><strong>F</strong></a>
- | <a href="#H"><strong>H</strong></a>
- | <a href="#I"><strong>I</strong></a>
- | <a href="#J"><strong>J</strong></a>
- | <a href="#L"><strong>L</strong></a>
- | <a href="#M"><strong>M</strong></a>
- | <a href="#N"><strong>N</strong></a>
- | <a href="#O"><strong>O</strong></a>
- | <a href="#P"><strong>P</strong></a>
- | <a href="#S"><strong>S</strong></a>
- | <a href="#U"><strong>U</strong></a>
- | <a href="#V"><strong>V</strong></a>
- | <a href="#W"><strong>W</strong></a>
-
-</div>
-<h2 id="A">A</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.inout.literaltypes.AllowedValue">AllowedValue (class in pywps.inout.literaltypes)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.inout.literaltypes.AnyValue">AnyValue (class in pywps.inout.literaltypes)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="B">B</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.BoundingBoxInput">BoundingBoxInput (class in pywps)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.BoundingBoxOutput">BoundingBoxOutput (class in pywps)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="C">C</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.app.WPSResponse.call_on_close">call_on_close() (pywps.app.WPSResponse method)</a>
- </dt>
-
-
- <dt><a href="api.html#pywps.app.WPSRequest.check_accepted_versions">check_accepted_versions() (pywps.app.WPSRequest method)</a>
- </dt>
-
-
- <dt><a href="api.html#pywps.app.WPSRequest.check_and_set_language">check_and_set_language() (pywps.app.WPSRequest method)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.app.WPSRequest.check_and_set_version">check_and_set_version() (pywps.app.WPSRequest method)</a>
- </dt>
-
-
- <dt><a href="api.html#pywps.ComplexInput">ComplexInput (class in pywps)</a>
- </dt>
-
-
- <dt><a href="api.html#pywps.ComplexOutput">ComplexOutput (class in pywps)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="E">E</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt>
- environment variable
- </dt>
-
- <dd><dl>
-
- <dt><a href="process.html#index-1">PYTHONPATH</a>
- </dt>
-
- </dl></dd>
- </dl></td>
-</tr></table>
-
-<h2 id="F">F</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="exceptions.html#pywps.exceptions.FileSizeExceeded">FileSizeExceeded (class in pywps.exceptions)</a>
- </dt>
-
-
- <dt><a href="api.html#pywps.Format">Format (class in pywps)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.inout.formats.FORMATS">FORMATS (in module pywps.inout.formats)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="H">H</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.WPSRequest.http_request">http_request (pywps.WPSRequest attribute)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="I">I</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.WPSRequest.inputs">inputs (pywps.WPSRequest attribute)</a>
- </dt>
-
-
- <dt><a href="exceptions.html#pywps.exceptions.InvalidParameterValue">InvalidParameterValue (class in pywps.exceptions)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.inout.basic.IOHandler">IOHandler (class in pywps.inout.basic)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="J">J</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.app.WPSRequest.json">json (pywps.app.WPSRequest attribute)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="L">L</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.inout.literaltypes.LITERAL_DATA_TYPES">LITERAL_DATA_TYPES (in module pywps.inout.literaltypes)</a>
- </dt>
-
-
- <dt><a href="api.html#pywps.LiteralInput">LiteralInput (class in pywps)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.LiteralOutput">LiteralOutput (class in pywps)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="M">M</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="exceptions.html#pywps.exceptions.MissingParameterValue">MissingParameterValue (class in pywps.exceptions)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.validator.mode.MODE">MODE (class in pywps.validator.mode)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="N">N</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="exceptions.html#pywps.exceptions.NoApplicableCode">NoApplicableCode (class in pywps.exceptions)</a>
- </dt>
-
-
- <dt><a href="api.html#pywps.validator.mode.MODE.NONE">NONE (pywps.validator.mode.MODE attribute)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="exceptions.html#pywps.exceptions.NotEnoughStorage">NotEnoughStorage (class in pywps.exceptions)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="O">O</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.WPSRequest.operation">operation (pywps.WPSRequest attribute)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="exceptions.html#pywps.exceptions.OperationNotSupported">OperationNotSupported (class in pywps.exceptions)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="P">P</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.Process">Process (class in pywps)</a>
- </dt>
-
-
- <dt><a href="process.html#index-1">PYTHONPATH</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#module-pywps">pywps (module)</a>
- </dt>
-
-
- <dt><a href="exceptions.html#module-pywps.exceptions">pywps.exceptions (module)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="S">S</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.validator.mode.MODE.SIMPLE">SIMPLE (pywps.validator.mode.MODE attribute)</a>
- </dt>
-
-
- <dt><a href="api.html#pywps.app.WPSResponse.STATUS">STATUS (in module pywps.app.WPSResponse)</a>
- </dt>
-
-
- <dt><a href="api.html#pywps.WPSResponse.status">status (pywps.WPSResponse attribute)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="exceptions.html#pywps.exceptions.StorageNotSupported">StorageNotSupported (class in pywps.exceptions)</a>
- </dt>
-
-
- <dt><a href="api.html#pywps.validator.mode.MODE.STRICT">STRICT (pywps.validator.mode.MODE attribute)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="U">U</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.app.WPSResponse.update_status">update_status() (pywps.app.WPSResponse method)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="V">V</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.validator.complexvalidator.validategml">validategml() (in module pywps.validator.complexvalidator)</a>
- </dt>
-
-
- <dt><a href="exceptions.html#pywps.exceptions.VersionNegotiationFailed">VersionNegotiationFailed (class in pywps.exceptions)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.validator.mode.MODE.VERYSTRICT">VERYSTRICT (pywps.validator.mode.MODE attribute)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-<h2 id="W">W</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.app.WPSRequest">WPSRequest (class in pywps.app)</a>
- </dt>
-
- </dl></td>
- <td style="width: 33%" valign="top"><dl>
-
- <dt><a href="api.html#pywps.app.WPSResponse">WPSResponse (class in pywps.app)</a>
- </dt>
-
- </dl></td>
-</tr></table>
-
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
-
-
-
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="#" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html
deleted file mode 100644
index 7dae7cd..0000000
--- a/docs/_build/html/index.html
+++ /dev/null
@@ -1,227 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Welcome to the PyWPS-4 documentation! — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="#" />
- <link rel="next" title="OGC Web Processing Service (OGC WPS)" href="wps.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="wps.html" title="OGC Web Processing Service (OGC WPS)"
- accesskey="N">next</a> |</li>
- <li class="nav-item nav-item-0"><a href="#">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="welcome-to-the-pywps-4-documentation">
-<h1>Welcome to the PyWPS-4 documentation!<a class="headerlink" href="#welcome-to-the-pywps-4-documentation" title="Permalink to this headline">¶</a></h1>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">Please be awere that PyWPS-4 is still in pre-release state,
-there is no stable release yet.</p>
-</div>
-<p>PyWPS is a server side implementation of the <a class="reference external" href="http://opengeospatial.org/standards/wps">OGC Web Processing Service
-(OGC WPS) standard</a> , using the
-<a class="reference external" href="http://python.org">Python</a> programming language. PyWPS is currently
-supporting WPS 1.0.0. Support for the version 2.0.0. of OGC WPS standard is
-presently being planned.</p>
-<p>PyWPS has a bicycle in it’s logo, because:</p>
-<ul class="simple">
-<li>It’s simple to maintain</li>
-<li>It’s fast to drive</li>
-<li>It can carry a lot</li>
-<li>It’s easy to hack</li>
-</ul>
-<p><strong>Mount your bike and setup & configure your PyWPS instance!</strong></p>
-<div class="admonition-todo admonition" id="index-0">
-<p class="first admonition-title">Todo</p>
-<ul class="last simple">
-<li>request queue management (probably linked from documentation)</li>
-<li>inputs and outputs IOhandler class description (file, stream, ...)</li>
-</ul>
-</div>
-<div class="section" id="contents">
-<h2>Contents:<a class="headerlink" href="#contents" title="Permalink to this headline">¶</a></h2>
-<div class="toctree-wrapper compound">
-<ul>
-<li class="toctree-l1"><a class="reference internal" href="wps.html">OGC Web Processing Service (OGC WPS)</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="wps.html#process">Process</a></li>
-<li class="toctree-l2"><a class="reference internal" href="wps.html#data-in-and-outputs">Data in- and outputs</a></li>
-<li class="toctree-l2"><a class="reference internal" href="wps.html#passing-data-to-process-instance">Passing data to process instance</a></li>
-<li class="toctree-l2"><a class="reference internal" href="wps.html#sychronous-versus-asynchronous-process-request">Sychronous versus asynchronous process request</a></li>
-<li class="toctree-l2"><a class="reference internal" href="wps.html#process-status">Process status</a></li>
-<li class="toctree-l2"><a class="reference internal" href="wps.html#request-encoding-http-get-and-post">Request encoding, HTTP GET and POST</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="pywps.html">PyWPS</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="pywps.html#pywps-philosophy">PyWPS philosophy</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pywps.html#why-is-pywps-there">Why is PyWPS there</a></li>
-<li class="toctree-l2"><a class="reference internal" href="pywps.html#pywps-history">PyWPS History</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="install.html#dependencies-and-requirements">Dependencies and requirements</a></li>
-<li class="toctree-l2"><a class="reference internal" href="install.html#download-and-install">Download and install</a></li>
-<li class="toctree-l2"><a class="reference internal" href="install.html#the-demo-service-and-its-sample-processes">The demo service and its sample processes</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="configuration.html#metadata-main">[metadata:main]</a></li>
-<li class="toctree-l2"><a class="reference internal" href="configuration.html#server">[server]</a></li>
-<li class="toctree-l2"><a class="reference internal" href="configuration.html#grass">[grass]</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="process.html">Processes</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="process.html#writing-a-process">Writing a Process</a></li>
-<li class="toctree-l2"><a class="reference internal" href="process.html#example-vector-buffer-process">Example vector buffer process</a></li>
-<li class="toctree-l2"><a class="reference internal" href="process.html#declaring-inputs-and-outputs">Declaring inputs and outputs</a></li>
-<li class="toctree-l2"><a class="reference internal" href="process.html#accessing-the-inputs-and-outputs-in-the-handler-method">Accessing the inputs and outputs in the <cite>handler</cite> method</a></li>
-<li class="toctree-l2"><a class="reference internal" href="process.html#progress-and-status-report">Progress and status report</a></li>
-<li class="toctree-l2"><a class="reference internal" href="process.html#returning-large-data">Returning large data</a></li>
-<li class="toctree-l2"><a class="reference internal" href="process.html#process-deployment">Process deployment</a></li>
-<li class="toctree-l2"><a class="reference internal" href="process.html#running-the-dev-server">Running the dev server</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="deployment.html">Deployment to a production server</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="deployment.html#deoploying-an-individual-pywps-instance">Deoploying an individual PyWPS instance</a></li>
-<li class="toctree-l2"><a class="reference internal" href="deployment.html#creating-a-pywps-wsgi-instance">Creating a PyWPS <cite>WSGI</cite> instance</a></li>
-<li class="toctree-l2"><a class="reference internal" href="deployment.html#deployment-on-apache2-httpd-server">Deployment on Apache2 httpd server</a></li>
-<li class="toctree-l2"><a class="reference internal" href="deployment.html#deployment-on-nginx">Deployment on nginx</a></li>
-<li class="toctree-l2"><a class="reference internal" href="deployment.html#testing-the-deployment-of-a-pywps-instance">Testing the deployment of a PyWPS instance</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="migration.html">Migrating from PyWP 3.x to 4.x</a></li>
-<li class="toctree-l1"><a class="reference internal" href="external_tools.html">PyWPS and external tools</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="external_tools.html#grass-gis">GRASS GIS</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="api.html">PyWPS API Doc</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="api.html#process">Process</a></li>
-<li class="toctree-l2"><a class="reference internal" href="api.html#inputs-and-outputs">Inputs and outputs</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="development.html">Developers Guide</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="development.html#github-account">0. GitHub account</a></li>
-<li class="toctree-l2"><a class="reference internal" href="development.html#open-a-new-issue">1. Open a new issue</a></li>
-<li class="toctree-l2"><a class="reference internal" href="development.html#fork-and-clone-the-pywps-repository">2. Fork and clone the PyWPS repository</a></li>
-<li class="toctree-l2"><a class="reference internal" href="development.html#commit-and-pull-request">3. Commit and pull request</a></li>
-<li class="toctree-l2"><a class="reference internal" href="development.html#updating-local-repository">4. Updating local repository</a></li>
-<li class="toctree-l2"><a class="reference internal" href="development.html#help-and-discussion">5. Help and discussion</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="exceptions.html">Exceptions</a></li>
-</ul>
-</div>
-</div>
-</div>
-<div class="section" id="indices-and-tables">
-<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
-<ul class="simple">
-<li><a class="reference internal" href="genindex.html"><span>Index</span></a></li>
-<li><a class="reference internal" href="py-modindex.html"><span>Module Index</span></a></li>
-<li><a class="reference internal" href="search.html"><span>Search Page</span></a></li>
-</ul>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="#">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h3><a href="#">Table Of Contents</a></h3>
- <ul>
-<li><a class="reference internal" href="#">Welcome to the PyWPS-4 documentation!</a><ul>
-<li><a class="reference internal" href="#contents">Contents:</a></li>
-</ul>
-</li>
-<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
-</ul>
-
- <h4>Next topic</h4>
- <p class="topless"><a href="wps.html"
- title="next chapter">OGC Web Processing Service (OGC WPS)</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/index.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="wps.html" title="OGC Web Processing Service (OGC WPS)"
- >next</a> |</li>
- <li class="nav-item nav-item-0"><a href="#">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/install.html b/docs/_build/html/install.html
deleted file mode 100644
index 243ba26..0000000
--- a/docs/_build/html/install.html
+++ /dev/null
@@ -1,205 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Installation — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="next" title="Configuration" href="configuration.html" />
- <link rel="prev" title="PyWPS" href="pywps.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="configuration.html" title="Configuration"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="pywps.html" title="PyWPS"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="installation">
-<span id="id1"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">PyWPS-4 is not tested on the MS Windows platform. Please join the
-development team if you need this platform to be supported. This is mainly
-because of the lack of a multiprocessing library. It is used to process
-asynchronous execution, i.e., when making requests storing the response
-document and updating a status document displaying the progress of
-execution.</p>
-</div>
-<div class="section" id="dependencies-and-requirements">
-<h2>Dependencies and requirements<a class="headerlink" href="#dependencies-and-requirements" title="Permalink to this headline">¶</a></h2>
-<p>PyWPS-4 runs on Python 2.7, 3.3 or newer. PyWPS is currently tested and
-developed on Linux (mostly Ubuntu). In the documentation we take this
-distribution as reference.</p>
-<p>Prior to installing PyWPS-4, Git and the Python bindings for GDAL must be
-installed in the system. In Debian based systems these packages can be
-installed with a tool like <em>apt</em>:</p>
-<div class="highlight-python"><div class="highlight"><pre>$ sudo apt install git python-gdal
-</pre></div>
-</div>
-</div>
-<div class="section" id="download-and-install">
-<h2>Download and install<a class="headerlink" href="#download-and-install" title="Permalink to this headline">¶</a></h2>
-<dl class="docutils">
-<dt>Using PIP</dt>
-<dd><p class="first">The easiest way to install PyWPS-4 is using the Python Package Index
-(PIP). It fetches the source code from the repository and installs it
-automatically in the system. This might require superuser permissions
-(e.g. <em>sudo</em> in Debian based systems):</p>
-<div class="last highlight-python"><div class="highlight"><pre>$ sudo pip install -e git+https://github.com/geopython/pywps.git@master#egg=pywps-dev
-</pre></div>
-</div>
-</dd>
-<dt>Manual installation</dt>
-<dd><p class="first">In alternative PyWPS-4 can be installed manually.
-It requires the cloning of the source code from the repository and then the
-usage of the <cite>setup.py</cite> script. An example again for Debian based systems (note
-the usage of <cite>sudo</cite> for install):</p>
-<div class="highlight-python"><div class="highlight"><pre>$ git clone https://github.com/geopython/pywps.git pywps-4
-
-$ cd pywps-4/
-</pre></div>
-</div>
-<p>Then install the package dependencies using pip:</p>
-<div class="highlight-python"><div class="highlight"><pre>$ pip install -r requirements.txt
-$ pip install -r requirements-dev.txt # for developer tasks
-</pre></div>
-</div>
-<p>To install PyWPS system-wide run:</p>
-<div class="last highlight-python"><div class="highlight"><pre>$ sudo python setup.py install
-</pre></div>
-</div>
-</dd>
-</dl>
-</div>
-<div class="section" id="the-demo-service-and-its-sample-processes">
-<span id="demo"></span><h2>The demo service and its sample processes<a class="headerlink" href="#the-demo-service-and-its-sample-processes" title="Permalink to this headline">¶</a></h2>
-<p>To use PyWPS-4 the user must code processes and publish them through a service.
-A demo service is available that makes up a good starting point for first time
-users. This launches a very simple built-in server (relying on <a class="reference external" href="http://flask.pocoo.org/">flask</a>), which is good enough for testing but probably not
-appropriate for production. It can be cloned directly into the user
-area:</p>
-<div class="highlight-python"><div class="highlight"><pre>$ git clone https://github.com/geopython/pywps-demo.git
-</pre></div>
-</div>
-<p>It may be run right away through the <cite>demo.py</cite> script. First time users should
-start by studying the demo project structure and then code their own processes.</p>
-<p>Full more details please consult the <a class="reference internal" href="process.html#process"><span>Processes</span></a> section. The <cite>demo</cite> service
-contains some basic processes too, so you could get started with some examples
-(like <cite>area</cite>, <cite>buffer</cite>, <cite>feature_count</cite> and <cite>grassbuffer</cite>). These processes are
-to be taken just as inspiration and code documentation - most of them do not
-make any sense (e.g. <cite>sayhello</cite>).</p>
-</div>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h3><a href="index.html">Table Of Contents</a></h3>
- <ul>
-<li><a class="reference internal" href="#">Installation</a><ul>
-<li><a class="reference internal" href="#dependencies-and-requirements">Dependencies and requirements</a></li>
-<li><a class="reference internal" href="#download-and-install">Download and install</a></li>
-<li><a class="reference internal" href="#the-demo-service-and-its-sample-processes">The demo service and its sample processes</a></li>
-</ul>
-</li>
-</ul>
-
- <h4>Previous topic</h4>
- <p class="topless"><a href="pywps.html"
- title="previous chapter">PyWPS</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="configuration.html"
- title="next chapter">Configuration</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/install.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="configuration.html" title="Configuration"
- >next</a> |</li>
- <li class="right" >
- <a href="pywps.html" title="PyWPS"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/migration.html b/docs/_build/html/migration.html
deleted file mode 100644
index e72b2b5..0000000
--- a/docs/_build/html/migration.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Migrating from PyWP 3.x to 4.x — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="next" title="PyWPS and external tools" href="external_tools.html" />
- <link rel="prev" title="Deployment to a production server" href="deployment.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="external_tools.html" title="PyWPS and external tools"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="deployment.html" title="Deployment to a production server"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="migrating-from-pywp-3-x-to-4-x">
-<h1>Migrating from PyWP 3.x to 4.x<a class="headerlink" href="#migrating-from-pywp-3-x-to-4-x" title="Permalink to this headline">¶</a></h1>
-<p>TODO</p>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h4>Previous topic</h4>
- <p class="topless"><a href="deployment.html"
- title="previous chapter">Deployment to a production server</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="external_tools.html"
- title="next chapter">PyWPS and external tools</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/migration.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="external_tools.html" title="PyWPS and external tools"
- >next</a> |</li>
- <li class="right" >
- <a href="deployment.html" title="Deployment to a production server"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv
deleted file mode 100644
index 0f14aec..0000000
Binary files a/docs/_build/html/objects.inv and /dev/null differ
diff --git a/docs/_build/html/process.html b/docs/_build/html/process.html
deleted file mode 100644
index 731f3a4..0000000
--- a/docs/_build/html/process.html
+++ /dev/null
@@ -1,651 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Processes — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="next" title="Deployment to a production server" href="deployment.html" />
- <link rel="prev" title="Configuration" href="configuration.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="deployment.html" title="Deployment to a production server"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="configuration.html" title="Configuration"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="processes">
-<span id="process"></span><h1>Processes<a class="headerlink" href="#processes" title="Permalink to this headline">¶</a></h1>
-<div class="versionadded">
-<p><span class="versionmodified">New in version 4.0.0.</span></p>
-</div>
-<div class="admonition-todo admonition" id="index-0">
-<p class="first admonition-title">Todo</p>
-<ul class="last simple">
-<li>Input validation</li>
-<li>IOHandler</li>
-</ul>
-</div>
-<p>PyWPS works with processes and services. A process is a Python <cite>Class</cite>
-containing an <cite>handler</cite> method and a list of inputs and outputs. A PyWPS
-service instance is then a collection of selected processes.</p>
-<p>PyWPS does not ship with any processes predefined - it’s on you, as user of
-PyWPS to set up the processes of your choice. PyWPS is here to help you
-publishing your awesome geospatial operation on the web - it takes care of
-communication and security, you then have to add the content.</p>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">There are some example processes in the <a class="reference external" href="http://github.com/geopython/pywps-demo">PyWPS-Demo</a> project.</p>
-</div>
-<div class="section" id="writing-a-process">
-<h2>Writing a Process<a class="headerlink" href="#writing-a-process" title="Permalink to this headline">¶</a></h2>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p>At this place, you should prepare your environment for final
-<a class="reference internal" href="deployment.html#deployment"><span>Deployment to a production server</span></a>. At least, you should create a single directory with
-your processes, which is typically named <cite>processes</cite>:</p>
-<div class="highlight-python"><div class="highlight"><pre>$ mkdir processes
-</pre></div>
-</div>
-<p>In this directory, we will create single python scripts containing
-processes.</p>
-<p class="last">Processes can be located <em>anywhere in the system</em> as long as their
-location is identified in the <span class="target" id="index-1"></span><code class="xref std std-envvar docutils literal"><span class="pre">PYTHONPATH</span></code> environment
-variable, and can be imported in the final server instance.</p>
-</div>
-<p>A processes is coded as a class inheriting from <a class="reference internal" href="api.html#pywps.Process" title="pywps.Process"><code class="xref py py-class docutils literal"><span class="pre">Process</span></code></a>.
-In the <a class="reference external" href="http://github.com/geopython/pywps-demo">PyWPS-Demo</a> server they are
-kept inside the <em>processes</em> folder, usually in separated files.</p>
-<p>The instance of a <em>Process</em> needs following attributes to be configured:</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">identifier:</th><td class="field-body">unique identifier of the process</td>
-</tr>
-<tr class="field-even field"><th class="field-name">title:</th><td class="field-body">corresponding title</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">inputs:</th><td class="field-body">list of process inputs</td>
-</tr>
-<tr class="field-even field"><th class="field-name">outputs:</th><td class="field-body">list of process outputs</td>
-</tr>
-<tr class="field-odd field"><th class="field-name">handler:</th><td class="field-body">method which recieves <a class="reference internal" href="api.html#pywps.app.WPSRequest" title="pywps.app.WPSRequest"><code class="xref py py-class docutils literal"><span class="pre">pywps.app.WPSRequest</span></code></a> and <a class="reference internal" href="api.html#pywps.app.WPSResponse" title="pywps.app.WPSResponse"><code class="xref py py-class docutils literal"><span class="pre">pywps.app.WPSR [...]
-</tr>
-</tbody>
-</table>
-</div>
-<div class="section" id="example-vector-buffer-process">
-<h2>Example vector buffer process<a class="headerlink" href="#example-vector-buffer-process" title="Permalink to this headline">¶</a></h2>
-<p>As an example, we will create a <em>buffer</em> process - which will take a vector
-file as the input, create specified the buffer around the data (using <a class="reference external" href="http://toblerity.org/shapely/">Shapely</a>), and return back the result.</p>
-<p>Therefore, the process will have two inputs:</p>
-<ul class="simple">
-<li><cite>ComplexData</cite> input - the vector file</li>
-<li><cite>LiteralData</cite> input - the buffer size</li>
-</ul>
-<p>And it will have one output:</p>
-<ul class="simple">
-<li><cite>ComplexData</cite> output - the final buffer</li>
-</ul>
-<p>The process can be called <cite>demobuffer</cite> and we can now start coding it:</p>
-<div class="highlight-python"><div class="highlight"><pre>$ cd processes
-$ $EDITOR demobuffer.py
-</pre></div>
-</div>
-<p>At the beginning, we have to import the required classes and modules</p>
-<p>Here is a very basic example:</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>10
-11
-12</pre></div></td><td class="code"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">Process</span><span class="p">,</span> <span class="n">LiteralInput</span><span class="p">,</span> <span class="n">ComplexOutput</span><span class="p">,</span> <span class="n">ComplexInput</span><span class="p">,</span> <span class="n">Format</span>
-<span class="kn">from</span> <span class="nn">pywps.validator.mode</span> <span class="kn">import</span> <span class="n">MODE</span>
-<span class="kn">from</span> <span class="nn">pywps.inout.formats</span> <span class="kn">import</span> <span class="n">FORMATS</span>
-</pre></div>
-</td></tr></table></div>
-<p>As the next step, we define a list of inputs. The first input is
-<a class="reference internal" href="api.html#pywps.ComplexInput" title="pywps.ComplexInput"><code class="xref py py-class docutils literal"><span class="pre">pywps.ComplexInput</span></code></a> with the identifier <cite>vector</cite>, title <cite>Vector map</cite>
-and there is only one allowed format: GML.</p>
-<p>The next input is <a class="reference internal" href="api.html#pywps.LiteralInput" title="pywps.LiteralInput"><code class="xref py py-class docutils literal"><span class="pre">pywps.LiteralInput</span></code></a>, with the identifier <cite>size</cite> and
-the data type set to <cite>float</cite>:</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>14
-15
-16
-17
-18
-19
-20
-21</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">inpt_vector</span> <span class="o">=</span> <span class="n">ComplexInput</span><span class="p">(</span>
- <span class="s1">'vector'</span><span class="p">,</span>
- <span class="s1">'Vector map'</span><span class="p">,</span>
- <span class="n">supported_formats</span><span class="o">=</span><span class="p">[</span><span class="n">Format</span><span class="p">(</span><span class="s1">'application/gml+xml'</span><span class="p">)],</span>
- <span class="n">mode</span><span class="o">=</span><span class="n">MODE</span><span class="o">.</span><span class="n">STRICT</span>
-<span class="p">)</span>
-
-<span class="n">inpt_size</span> <span class="o">=</span> <span class="n">LiteralInput</span><span class="p">(</span><span class="s1">'size'</span><span class="p">,</span> <span class="s1">'Buffer size'</span><span class="p">,</span> <span class="n">data_type</span><span class="o">=</span><span class="s1">'float'</span><span class="p">)</span>
-</pre></div>
-</td></tr></table></div>
-<p>Next we define the output <cite>output</cite> as <a class="reference internal" href="api.html#pywps.ComplexOutput" title="pywps.ComplexOutput"><code class="xref py py-class docutils literal"><span class="pre">pywps.ComplexOutput</span></code></a>. This
-output supports GML format only.</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>23
-24
-25
-26
-27</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">out_output</span> <span class="o">=</span> <span class="n">ComplexOutput</span><span class="p">(</span>
- <span class="s1">'output'</span><span class="p">,</span>
- <span class="s1">'HelloWorld Output'</span><span class="p">,</span>
- <span class="n">supported_formats</span><span class="o">=</span><span class="p">[</span><span class="n">Format</span><span class="p">(</span><span class="s1">'application/gml+xml'</span><span class="p">)]</span>
-<span class="p">)</span>
-</pre></div>
-</td></tr></table></div>
-<p>Next we create a new list variables for inputs and outputs.</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>29
-30</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">inputs</span> <span class="o">=</span> <span class="p">[</span><span class="n">inpt_vector</span><span class="p">,</span> <span class="n">inpt_size</span><span class="p">]</span>
-<span class="n">outputs</span> <span class="o">=</span> <span class="p">[</span><span class="n">out_output</span><span class="p">]</span>
-</pre></div>
-</td></tr></table></div>
-<p>Next we define the <em>handler</em> method. In it, <em>geospatial analysis
-may happen</em>. The method gets a <a class="reference internal" href="api.html#pywps.app.WPSRequest" title="pywps.app.WPSRequest"><code class="xref py py-class docutils literal"><span class="pre">pywps.app.WPSRequest</span></code></a> and a
-<a class="reference internal" href="api.html#pywps.app.WPSResponse" title="pywps.app.WPSResponse"><code class="xref py py-class docutils literal"><span class="pre">pywps.app.WPSResponse</span></code></a> object as parameters. In our case, we
-calculate the buffer around each vector feature using
-<a class="reference external" href="http://gdal.org">GDAL/OGR library</a>. We will not got much into the details,
-what you should note is how to get input data from the
-<a class="reference internal" href="api.html#pywps.app.WPSRequest" title="pywps.app.WPSRequest"><code class="xref py py-class docutils literal"><span class="pre">pywps.app.WPSRequest</span></code></a> object and how to set data as outputs in the
-<a class="reference internal" href="api.html#pywps.app.WPSResponse" title="pywps.app.WPSResponse"><code class="xref py py-class docutils literal"><span class="pre">pywps.app.WPSResponse</span></code></a> object.</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
-100</pre></div></td><td class="code"><div class="highlight"><pre><span class="k">def</span> <span class="nf">_handler</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">response</span><span class="p">):</span>
- <span class="sd">"""Handler method - this method obtains request object and response</span>
-<span class="sd"> object and creates the buffer</span>
-<span class="sd"> """</span>
-
- <span class="kn">from</span> <span class="nn">osgeo</span> <span class="kn">import</span> <span class="n">ogr</span>
-
-<span class="hll"> <span class="c1"># obtaining input with identifier 'vector' as file name</span>
-</span><span class="hll"> <span class="n">input_file</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="s1">'vector'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">file</span>
-</span><span class="hll">
-</span><span class="hll"> <span class="c1"># obtaining input with identifier 'size' as data directly</span>
-</span><span class="hll"> <span class="n">size</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="s1">'size'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">data</span>
-</span>
- <span class="c1"># open file the "gdal way"</span>
- <span class="n">input_source</span> <span class="o">=</span> <span class="n">ogr</span><span class="o">.</span><span class="n">Open</span><span class="p">(</span><span class="n">input_file</span><span class="p">)</span>
- <span class="n">input_layer</span> <span class="o">=</span> <span class="n">input_source</span><span class="o">.</span><span class="n">GetLayer</span><span class="p">()</span>
- <span class="n">layer_name</span> <span class="o">=</span> <span class="n">input_layer</span><span class="o">.</span><span class="n">GetName</span><span class="p">()</span>
-
- <span class="c1"># create output file</span>
- <span class="n">driver</span> <span class="o">=</span> <span class="n">ogr</span><span class="o">.</span><span class="n">GetDriverByName</span><span class="p">(</span><span class="s1">'GML'</span><span class="p">)</span>
- <span class="n">output_source</span> <span class="o">=</span> <span class="n">driver</span><span class="o">.</span><span class="n">CreateDataSource</span><span class="p">(</span><span class="n">layer_name</span><span class="p">,</span>
- <span class="p">[</span><span class="s2">"XSISCHEMAURI=http://schemas.opengis.net/gml/2.1.2/feature.xsd"</span><span class="p">])</span>
- <span class="n">output_layer</span> <span class="o">=</span> <span class="n">output_source</span><span class="o">.</span><span class="n">CreateLayer</span><span class="p">(</span><span class="n">layer_name</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="n">ogr</span><span class="o">.</span><span class="n">wkbUnknown</span><span class="p">)</span>
-
- <span class="c1"># get feature count</span>
- <span class="n">count</span> <span class="o">=</span> <span class="n">input_layer</span><span class="o">.</span><span class="n">GetFeatureCount</span><span class="p">()</span>
- <span class="n">index</span> <span class="o">=</span> <span class="mi">0</span>
-
- <span class="c1"># make buffer for each feature</span>
- <span class="k">while</span> <span class="n">index</span> <span class="o"><</span> <span class="n">count</span><span class="p">:</span>
-
- <span class="n">response</span><span class="o">.</span><span class="n">update_status</span><span class="p">(</span><span class="s1">'Buffering feature </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="n">index</span><span class="p">,</span> <span class="nb">float</span><span class="p">(</span><span class="n">index</span><span class="p">)</span><span class="o">/</span><span class="n">count</span><span class="p">)</span>
-
- <span class="c1"># get the geometry</span>
- <span class="n">input_feature</span> <span class="o">=</span> <span class="n">input_layer</span><span class="o">.</span><span class="n">GetNextFeature</span><span class="p">()</span>
- <span class="n">input_geometry</span> <span class="o">=</span> <span class="n">input_feature</span><span class="o">.</span><span class="n">GetGeometryRef</span><span class="p">()</span>
-
- <span class="c1"># make the buffer</span>
- <span class="n">buffer_geometry</span> <span class="o">=</span> <span class="n">input_geometry</span><span class="o">.</span><span class="n">Buffer</span><span class="p">(</span>
- <span class="nb">float</span><span class="p">(</span><span class="n">size</span><span class="p">)</span>
- <span class="p">)</span>
-
- <span class="c1"># create output feature to the file</span>
- <span class="n">output_feature</span> <span class="o">=</span> <span class="n">ogr</span><span class="o">.</span><span class="n">Feature</span><span class="p">(</span><span class="n">feature_def</span><span class="o">=</span><span class="n">output_layer</span><span class="o">.</span><span class="n">GetLayerDefn</span><span class="p">())</span>
- <span class="n">output_feature</span><span class="o">.</span><span class="n">SetGeometryDirectly</span><span class="p">(</span><span class="n">buffer_geometry</span><span class="p">)</span>
- <span class="n">output_layer</span><span class="o">.</span><span class="n">CreateFeature</span><span class="p">(</span><span class="n">output_feature</span><span class="p">)</span>
- <span class="n">output_feature</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
- <span class="n">index</span> <span class="o">+=</span> <span class="mi">1</span>
-
-<span class="hll"> <span class="c1"># set output format</span>
-</span><span class="hll"> <span class="n">response</span><span class="o">.</span><span class="n">outputs</span><span class="p">[</span><span class="s1">'output'</span><span class="p">]</span><span class="o">.</span><span class="n">output_format</span> <span class="o">=</span> <span class="n">FORMATS</span><span class="o">.</span><span class="n">GML</span>
-</span><span class="hll">
-</span><span class="hll"> <span class="c1"># set output data as file name</span>
-</span><span class="hll"> <span class="n">response</span><span class="o">.</span><span class="n">outputs</span><span class="p">[</span><span class="s1">'output'</span><span class="p">]</span><span class="o">.</span><span class="n">file</span> <span class="o">=</span> <span class="n">layer_name</span>
-</span>
- <span class="k">return</span> <span class="n">response</span>
-</pre></div>
-</td></tr></table></div>
-<p>At the end, we put everything together and create new a <cite>DemoBuffer</cite> class with
-handler, inputs and outputs. It’s based on <a class="reference internal" href="api.html#pywps.Process" title="pywps.Process"><code class="xref py py-class docutils literal"><span class="pre">pywps.Process</span></code></a>:</p>
-<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45</pre></div></td><td class="code"><div class="highlight"><pre><span class="k">class</span> <span class="nc">DemoBuffer</span><span class="p">(</span><span class="n">Process</span><span class="p">):</span>
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
-
- <span class="nb">super</span><span class="p">(</span><span class="n">DemoBuffer</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span>
- <span class="n">_handler</span><span class="p">,</span>
- <span class="n">identifier</span><span class="o">=</span><span class="s1">'demobuffer'</span><span class="p">,</span>
- <span class="n">version</span><span class="o">=</span><span class="s1">'1.0.0'</span><span class="p">,</span>
- <span class="n">title</span><span class="o">=</span><span class="s1">'Buffer'</span><span class="p">,</span>
- <span class="n">abstract</span><span class="o">=</span><span class="s1">'This process demonstrates, how to create any process in PyWPS environment'</span><span class="p">,</span>
- <span class="n">inputs</span><span class="o">=</span><span class="n">inputs</span><span class="p">,</span>
- <span class="n">outputs</span><span class="o">=</span><span class="n">outputs</span><span class="p">,</span>
- <span class="n">store_supported</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
- <span class="n">status_supported</span><span class="o">=</span><span class="bp">True</span>
- <span class="p">)</span>
-</pre></div>
-</td></tr></table></div>
-</div>
-<div class="section" id="declaring-inputs-and-outputs">
-<h2>Declaring inputs and outputs<a class="headerlink" href="#declaring-inputs-and-outputs" title="Permalink to this headline">¶</a></h2>
-<p>Clients need to know which inputs the processes expects. They can be declared
-as <code class="xref py py-class docutils literal"><span class="pre">pywps.Input</span></code> objects in the <a class="reference internal" href="api.html#pywps.Process" title="pywps.Process"><code class="xref py py-class docutils literal"><span class="pre">Process</span></code></a> class declaration:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">Process</span><span class="p">,</span> <span class="n">LiteralInput</span><span class="p">,</span> <span class="n">LiteralOutput</span>
-
-<span class="k">class</span> <span class="nc">FooProcess</span><span class="p">(</span><span class="n">Process</span><span class="p">):</span>
- <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
- <span class="n">inputs</span> <span class="o">=</span> <span class="p">[</span>
- <span class="n">LiteralInput</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">,</span> <span class="n">data_type</span><span class="o">=</span><span class="s1">'string'</span><span class="p">),</span>
- <span class="n">ComplexInput</span><span class="p">(</span><span class="s1">'bar'</span><span class="p">,</span> <span class="p">[</span><span class="n">Format</span><span class="p">(</span><span class="s1">'text/xml'</span><span class="p">)])</span>
- <span class="p">]</span>
- <span class="n">outputs</span> <span class="o">=</span> <span class="p">[</span>
- <span class="n">LiteralOutput</span><span class="p">(</span><span class="s1">'foo_output'</span><span class="p">,</span> <span class="n">data_type</span><span class="o">=</span><span class="s1">'string'</span><span class="p">),</span>
- <span class="n">ComplexOutput</span><span class="p">(</span><span class="s1">'bar_output'</span><span class="p">,</span> <span class="p">[</span><span class="n">Format</span><span class="p">(</span><span class="s1">'JSON'</span><span class="p">)])</span>
- <span class="p">]</span>
-
- <span class="nb">super</span><span class="p">(</span><span class="n">FooProcess</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span>
- <span class="o">...</span>
- <span class="n">inputs</span><span class="o">=</span><span class="n">inputs</span><span class="p">,</span>
- <span class="n">outputs</span><span class="o">=</span><span class="n">outputs</span>
- <span class="p">)</span>
- <span class="o">...</span>
-</pre></div>
-</div>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">A more generic description can be found in <a class="reference internal" href="wps.html#wps"><span>OGC Web Processing Service (OGC WPS)</span></a> chapter.</p>
-</div>
-<div class="section" id="literaldata">
-<h3>LiteralData<a class="headerlink" href="#literaldata" title="Permalink to this headline">¶</a></h3>
-<ul class="simple">
-<li><a class="reference internal" href="api.html#pywps.LiteralInput" title="pywps.LiteralInput"><code class="xref py py-class docutils literal"><span class="pre">LiteralInput</span></code></a></li>
-<li><a class="reference internal" href="api.html#pywps.LiteralOutput" title="pywps.LiteralOutput"><code class="xref py py-class docutils literal"><span class="pre">LiteralOutput</span></code></a></li>
-</ul>
-<p>A simple value embedded in the request. The first argument is a
-name. The second argument is the type, one of <cite>string</cite>, <cite>float</cite>,
-<cite>integer</cite> or <cite>boolean</cite>.</p>
-</div>
-<div class="section" id="complexdata">
-<h3>ComplexData<a class="headerlink" href="#complexdata" title="Permalink to this headline">¶</a></h3>
-<ul class="simple">
-<li><a class="reference internal" href="api.html#pywps.ComplexInput" title="pywps.ComplexInput"><code class="xref py py-class docutils literal"><span class="pre">ComplexInput</span></code></a></li>
-<li><a class="reference internal" href="api.html#pywps.ComplexOutput" title="pywps.ComplexOutput"><code class="xref py py-class docutils literal"><span class="pre">ComplexOutput</span></code></a></li>
-</ul>
-<p>A large data object, for example a layer. ComplexData do have a <cite>format</cite>
-attribute as one of their key properties. It’s either a list of supported
-formats or a single (already selected) format. It shall be an instance of
-the <code class="xref py py-class docutils literal"><span class="pre">pywps.inout.formats.Format</span></code> class.</p>
-</div>
-<div class="section" id="complexdata-format-and-input-validation">
-<h3>ComplexData <a class="reference internal" href="api.html#pywps.Format" title="pywps.Format"><code class="xref py py-class docutils literal"><span class="pre">Format</span></code></a> and input validation<a class="headerlink" href="#complexdata-format-and-input-validation" title="Permalink to this headline">¶</a></h3>
-<p>The ComplexData needs as one of its parameters a list of supported data
-formats. They are derived from the <a class="reference internal" href="api.html#pywps.Format" title="pywps.Format"><code class="xref py py-class docutils literal"><span class="pre">Format</span></code></a> class. A <a class="reference internal" href="api.html#pywps.Format" title="pywps.Format"><code class="xref py py-class docutils literal"><span class="pre">Format</span></code></a>
-instance needs, among others, a <cite>mime_type</cite> parameter, a <cite>validate</cite>
-method – which is used for input data validation – and also a <cite>mode</cite>
-parameter – defining how strict the validation should be (see
-<a class="reference internal" href="api.html#pywps.validator.mode.MODE" title="pywps.validator.mode.MODE"><code class="xref py py-class docutils literal"><span class="pre">pywps.validator.mode.MODE</span></code></a>).</p>
-<p>The <cite>Validate</cite> method is up to you, the user, to code. It requires two input
-paramers - <cite>data_input</cite> (a <a class="reference internal" href="api.html#pywps.ComplexInput" title="pywps.ComplexInput"><code class="xref py py-class docutils literal"><span class="pre">ComplexInput</span></code></a> object), and <cite>mode</cite>. This
-methid must return a <cite>boolean</cite> value indicating whether the input data are
-considered valid or not for given <cite>mode</cite>. You can draw inspiration from the
-<a class="reference internal" href="api.html#pywps.validator.complexvalidator.validategml" title="pywps.validator.complexvalidator.validategml"><code class="xref py py-func docutils literal"><span class="pre">pywps.validator.complexvalidator.validategml()</span></code></a> method.</p>
-<p>The good news is: there are already predefined validation methods for the ESRI
-Shapefile, GML and GeoJSON formats, using GDAL/OGR. There is also an XML Schema
-validaton and a JSON schema validator - you just have to pick the propper
-supported formats from the <a class="reference internal" href="api.html#pywps.inout.formats.FORMATS" title="pywps.inout.formats.FORMATS"><code class="xref py py-class docutils literal"><span class="pre">pywps.inout.formats.FORMATS</span></code></a> list and set
-the validation mode to your <a class="reference internal" href="api.html#pywps.ComplexInput" title="pywps.ComplexInput"><code class="xref py py-class docutils literal"><span class="pre">ComplexInput</span></code></a> object.</p>
-<p>Even better news is: you can define custom validation functions and validate
-input data according to your needs.</p>
-</div>
-<div class="section" id="boundingboxdata">
-<h3>BoundingBoxData<a class="headerlink" href="#boundingboxdata" title="Permalink to this headline">¶</a></h3>
-<ul class="simple">
-<li><a class="reference internal" href="api.html#pywps.BoundingBoxInput" title="pywps.BoundingBoxInput"><code class="xref py py-class docutils literal"><span class="pre">BoundingBoxInput</span></code></a></li>
-<li><a class="reference internal" href="api.html#pywps.BoundingBoxOutput" title="pywps.BoundingBoxOutput"><code class="xref py py-class docutils literal"><span class="pre">BoundingBoxOutput</span></code></a></li>
-</ul>
-<p>BoundingBoxData contain information about the bounding box of the desired area
-and coordinate reference system. Interesting attributes of the BoundingBoxData
-are:</p>
-<dl class="docutils">
-<dt><cite>crs</cite></dt>
-<dd>current coordinate reference system</dd>
-<dt><cite>dimensions</cite></dt>
-<dd>number of dimensions</dd>
-<dt><cite>ll</cite></dt>
-<dd>pair of coordinates (or triplet) of the lower-left corner</dd>
-<dt><cite>ur</cite></dt>
-<dd>pair of coordinates (or triplet) of the upper-right corner</dd>
-</dl>
-</div>
-</div>
-<div class="section" id="accessing-the-inputs-and-outputs-in-the-handler-method">
-<h2>Accessing the inputs and outputs in the <cite>handler</cite> method<a class="headerlink" href="#accessing-the-inputs-and-outputs-in-the-handler-method" title="Permalink to this headline">¶</a></h2>
-<p>Handlers receive as input argument a <code class="xref py py-class docutils literal"><span class="pre">WPSRequest</span></code> object. Input
-values are found in the <cite>inputs</cite> dictionary:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="nd">@staticmethod</span>
-<span class="k">def</span> <span class="nf">_handler</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">response</span><span class="p">):</span>
- <span class="n">name</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="s1">'name'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">data</span>
- <span class="n">response</span><span class="o">.</span><span class="n">outputs</span><span class="p">[</span><span class="s1">'output'</span><span class="p">]</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="s1">'Hello world </span><span class="si">%s</span><span class="s1">!'</span> <span class="o">%</span> <span class="n">name</span>
- <span class="k">return</span> <span class="n">response</span>
-</pre></div>
-</div>
-<p><cite>inputs</cite> is a plain Python dictionary.
-Most of the inputs and outputs are derived from the <code class="xref py py-class docutils literal"><span class="pre">IOHandler</span></code> class.
-This enables the user to access the data in 3 different ways:</p>
-<dl class="docutils">
-<dt><cite>input.file</cite></dt>
-<dd>Returns a file name - you can access the data using the name of the file
-stored on the hard drive.</dd>
-<dt><cite>input.data</cite></dt>
-<dd>Is the direct link to the data themselves. No need to create a file object
-on the hard drive or opening the file and closing it - PyWPS will do
-everything for you.</dd>
-<dt><cite>input.stream</cite></dt>
-<dd>Provides the IOStream of the data. No need for opening the file, you just
-have to <cite>read()</cite> the data.</dd>
-</dl>
-<p>PyWPS will persistently transform the input (and output) data to the desired
-form. You can also set the data for your <cite>Output</cite> object like <cite>output.data = 1</cite>
-or <cite>output.file = “myfile.json”</cite> - it works the same way.</p>
-<p>Example:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="n">request</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="s1">'file_input'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">file</span>
-<span class="n">request</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="s1">'data_input'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">data</span>
-<span class="n">request</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="s1">'stream_input'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">stream</span>
-</pre></div>
-</div>
-<p>Because there could be multiple input values with the same identifier, the
-inputs are accessed with an index. For <cite>LiteralInput</cite>, the value is a string.
-For <cite>ComplexInput</cite>, the value is an open file object, with a <cite>mime_type</cite>
-attribute:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="nd">@staticmethod</span>
-<span class="k">def</span> <span class="nf">handler</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">response</span><span class="p">):</span>
- <span class="n">layer_file</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">inputs</span><span class="p">[</span><span class="s1">'layer'</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">file</span>
- <span class="n">mime_type</span> <span class="o">=</span> <span class="n">layer_file</span><span class="o">.</span><span class="n">mime_type</span>
- <span class="nb">bytes</span> <span class="o">=</span> <span class="n">layer_file</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
- <span class="n">msg</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"You gave me a file of type </span><span class="si">%s</span><span class="s2"> and size </span><span class="si">%d</span><span class="s2">"</span>
- <span class="o">%</span> <span class="p">(</span><span class="n">mime_type</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="nb">bytes</span><span class="p">)))</span>
- <span class="n">response</span><span class="o">.</span><span class="n">outputs</span><span class="p">[</span><span class="s1">'output'</span><span class="p">]</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">msg</span>
- <span class="k">return</span> <span class="n">response</span>
-</pre></div>
-</div>
-</div>
-<div class="section" id="progress-and-status-report">
-<h2>Progress and status report<a class="headerlink" href="#progress-and-status-report" title="Permalink to this headline">¶</a></h2>
-<p>OGC WPS standard enables asynchronous process execution call, that is in
-particular useful, when the process execution takes longer time - process
-instance is set to background and WPS Execute Response document with <cite>ProcessAccepted</cite>
-messag is returned immediately to the client. The client has to check
-<cite>statusLocation</cite> URL, where the current status report is deployed, say every
-n-seconds or n-minutes (depends on calculation time). Content of the response is
-usually <cite>percentDone</cite> information about the progress along with <cite>statusMessage</cite>
-text information, what is currently happening.</p>
-<p>You can set process status any time in the <cite>handler</cite> using the
-<code class="xref py py-func docutils literal"><span class="pre">WPSResponse.update_status()</span></code> function.</p>
-</div>
-<div class="section" id="returning-large-data">
-<h2>Returning large data<a class="headerlink" href="#returning-large-data" title="Permalink to this headline">¶</a></h2>
-<p>WPS allows for a clever method of returning a large data file: instead
-of embedding the data in the response, it can be saved separately, and
-a URL is returned from where the data can be downloaded. In the current
-implementation, PyWPS-4 saves the file in a folder specified
-in the configuration passed by the service (or in a default location).
-The URL returned is embedded in the XML response.</p>
-<p>This behaviour can be requested either by using a GET:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="o">...</span><span class="n">ResponseDocument</span><span class="o">=</span><span class="n">output</span><span class="o">=</span><span class="nd">@asReference</span><span class="o">=</span><span class="n">true</span><span class="o">...</span>
-</pre></div>
-</div>
-<p>Or a POST request:</p>
-<div class="highlight-python"><div class="highlight"><pre>...
-<wps:ResponseForm>
- <wps:ResponseDocument>
- <wps:Output asReference="true">
- <ows:Identifier>output</ows:Identifier>
- <ows:Title>Some Output</ows:Title>
- </wps:Output>
- </wps:ResponseDocument>
-</wps:ResponseForm>
-...
-</pre></div>
-</div>
-<p><strong>output</strong> is the identifier of the output the user wishes to have stored
-and accessible from a URL. The user may request as many outputs by reference
-as needed, but only <em>one</em> may be requested in RAW format.</p>
-</div>
-<div class="section" id="process-deployment">
-<h2>Process deployment<a class="headerlink" href="#process-deployment" title="Permalink to this headline">¶</a></h2>
-<p>In order for clients to invoke processes, a PyWPS
-<code class="xref py py-class docutils literal"><span class="pre">Service</span></code> class must be present with the ability to listen for requests.
-An instance of this class must created, receiving instances of
-all the desired processes classes.</p>
-<p>In the <em>demo</em> service the <code class="xref py py-class docutils literal"><span class="pre">Service</span></code> class instance is created in the
-<code class="xref py py-class docutils literal"><span class="pre">Server</span></code> class. <code class="xref py py-class docutils literal"><span class="pre">Server</span></code> is a development server that relies
-on <a class="reference external" href="http://flask.pocoo.org">Flask</a>. The publication of processes is encapsulated in <em>demo.py</em>, where
-a main method passes a list of processes instances to the
-<code class="xref py py-class docutils literal"><span class="pre">Server</span></code> class:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">pywps</span> <span class="kn">import</span> <span class="n">Service</span>
-<span class="kn">from</span> <span class="nn">processes.helloworld</span> <span class="kn">import</span> <span class="n">HelloWorld</span>
-<span class="kn">from</span> <span class="nn">processes.demobuffer</span> <span class="kn">import</span> <span class="n">DemoBuffer</span>
-
-<span class="o">...</span>
-<span class="n">processes</span> <span class="o">=</span> <span class="p">[</span> <span class="n">DemoBuffer</span><span class="p">(),</span> <span class="o">...</span> <span class="p">]</span>
-
-<span class="n">server</span> <span class="o">=</span> <span class="n">Server</span><span class="p">(</span><span class="n">processes</span><span class="o">=</span><span class="n">processes</span><span class="p">)</span>
-
-<span class="o">...</span>
-</pre></div>
-</div>
-</div>
-<div class="section" id="running-the-dev-server">
-<h2>Running the dev server<a class="headerlink" href="#running-the-dev-server" title="Permalink to this headline">¶</a></h2>
-<p>The <a class="reference internal" href="install.html#demo"><span>The demo service and its sample processes</span></a> server is a <a class="reference external" href="http://werkzeug.pocoo.org/docs/terms/#wsgi">WSGI application</a> that accepts incoming <cite>Execute</cite>
-requests and calls the appropriate process to handle them. It also
-answers <cite>GetCapabilities</cite> and <cite>DescribeProcess</cite> requests based on the
-process identifier and their inputs and outputs.</p>
-<p>A host, a port, a config file and the processes can be passed as arguments to the
-<code class="xref py py-class docutils literal"><span class="pre">Server</span></code> constructor.
-<strong>host</strong> and <strong>port</strong> will be <strong>prioritised</strong> if passed to the constructor,
-otherwise the contents of the config file (<em>pywps.cfg</em>) are used.</p>
-<p>Use the <cite>run</cite> method to start the server:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="o">...</span>
-<span class="n">s</span> <span class="o">=</span> <span class="n">Server</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s1">'0.0.0.0'</span><span class="p">,</span> <span class="n">processes</span><span class="o">=</span><span class="n">processes</span><span class="p">,</span> <span class="n">config_file</span><span class="o">=</span><span class="n">config_file</span><span class="p">)</span>
-
-<span class="n">s</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>
-<span class="o">...</span>
-</pre></div>
-</div>
-<p>To make the server visible from another computer, replace <code class="docutils literal"><span class="pre">localhost</span></code> with <code class="docutils literal"><span class="pre">0.0.0.0</span></code>.</p>
-</div>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h3><a href="index.html">Table Of Contents</a></h3>
- <ul>
-<li><a class="reference internal" href="#">Processes</a><ul>
-<li><a class="reference internal" href="#writing-a-process">Writing a Process</a></li>
-<li><a class="reference internal" href="#example-vector-buffer-process">Example vector buffer process</a></li>
-<li><a class="reference internal" href="#declaring-inputs-and-outputs">Declaring inputs and outputs</a><ul>
-<li><a class="reference internal" href="#literaldata">LiteralData</a></li>
-<li><a class="reference internal" href="#complexdata">ComplexData</a></li>
-<li><a class="reference internal" href="#complexdata-format-and-input-validation">ComplexData <code class="docutils literal"><span class="pre">Format</span></code> and input validation</a></li>
-<li><a class="reference internal" href="#boundingboxdata">BoundingBoxData</a></li>
-</ul>
-</li>
-<li><a class="reference internal" href="#accessing-the-inputs-and-outputs-in-the-handler-method">Accessing the inputs and outputs in the <cite>handler</cite> method</a></li>
-<li><a class="reference internal" href="#progress-and-status-report">Progress and status report</a></li>
-<li><a class="reference internal" href="#returning-large-data">Returning large data</a></li>
-<li><a class="reference internal" href="#process-deployment">Process deployment</a></li>
-<li><a class="reference internal" href="#running-the-dev-server">Running the dev server</a></li>
-</ul>
-</li>
-</ul>
-
- <h4>Previous topic</h4>
- <p class="topless"><a href="configuration.html"
- title="previous chapter">Configuration</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="deployment.html"
- title="next chapter">Deployment to a production server</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/process.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="deployment.html" title="Deployment to a production server"
- >next</a> |</li>
- <li class="right" >
- <a href="configuration.html" title="Configuration"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/py-modindex.html b/docs/_build/html/py-modindex.html
deleted file mode 100644
index fdec885..0000000
--- a/docs/_build/html/py-modindex.html
+++ /dev/null
@@ -1,118 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Python Module Index — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
-
-
-
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="#" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
-
- <h1>Python Module Index</h1>
-
- <div class="modindex-jumpbox">
- <a href="#cap-p"><strong>p</strong></a>
- </div>
-
- <table class="indextable modindextable" cellspacing="0" cellpadding="2">
- <tr class="pcap"><td></td><td> </td><td></td></tr>
- <tr class="cap" id="cap-p"><td></td><td>
- <strong>p</strong></td><td></td></tr>
- <tr>
- <td><img src="_static/minus.png" class="toggler"
- id="toggle-1" style="display: none" alt="-" /></td>
- <td>
- <a href="api.html#module-pywps"><code class="xref">pywps</code></a></td><td>
- <em></em></td></tr>
- <tr class="cg-1">
- <td></td>
- <td>
- <a href="exceptions.html#module-pywps.exceptions"><code class="xref">pywps.exceptions</code></a></td><td>
- <em></em></td></tr>
- </table>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="#" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/pywps.html b/docs/_build/html/pywps.html
deleted file mode 100644
index 0ce91e3..0000000
--- a/docs/_build/html/pywps.html
+++ /dev/null
@@ -1,169 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>PyWPS — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="next" title="Installation" href="install.html" />
- <link rel="prev" title="OGC Web Processing Service (OGC WPS)" href="wps.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="install.html" title="Installation"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="wps.html" title="OGC Web Processing Service (OGC WPS)"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="pywps">
-<span id="id1"></span><h1>PyWPS<a class="headerlink" href="#pywps" title="Permalink to this headline">¶</a></h1>
-<div class="admonition-todo admonition" id="index-0">
-<p class="first admonition-title">Todo</p>
-<ul class="last simple">
-<li>how are thnigs organised</li>
-<li>storage</li>
-<li>dblog</li>
-<li>relationship to grass gis</li>
-</ul>
-</div>
-<div class="section" id="pywps-philosophy">
-<h2>PyWPS philosophy<a class="headerlink" href="#pywps-philosophy" title="Permalink to this headline">¶</a></h2>
-<p>PyWPS is simple, fast to run, has low requirements on system resources, is
-modular. PyWPS solves the problem of exposing geospatial calculations to the
-web, taking care of security, data download, request acceptance, process running
-and final response construction. Therefore PyWPS has a bicycle in its logo.</p>
-</div>
-<div class="section" id="why-is-pywps-there">
-<h2>Why is PyWPS there<a class="headerlink" href="#why-is-pywps-there" title="Permalink to this headline">¶</a></h2>
-<p>Many scientific researchers and geospatial services provider need to setup
-system, where the geospatial operations would be calculated on the server, while
-the system resources could be exposed to clients. PyWPS is here, so that you
-could set up the server fast, deploy your awesome geospatial calculation and
-expose it to the world. PyWPS is written in Python with support for many
-geospatial tools out there, like GRASS GIS, R-Project or GDAL. Python is the
-most geo-positive scripting language out there, therefore all the best tools
-have their bindings to Python in their pocket.</p>
-</div>
-<div class="section" id="pywps-history">
-<h2>PyWPS History<a class="headerlink" href="#pywps-history" title="Permalink to this headline">¶</a></h2>
-<p>PyWPS started in 2006 as scholarship funded by <a class="reference external" href="http://dbu.de">German Foundation for
-Environment</a>. During the years, it grow to version 4.0.x. In
-2015, we officially entered to <a class="reference external" href="http://osgeo.org">OSGeo</a> incubation process.
-In 2016, <a class="reference external" href="http://pywps.org/development/psc.html">Project Steering Committee</a> has started.
-PyWPS was originally hosted by the <a class="reference external" href="http://wald.intevation.org">Wald server</a>,
-nowadays, we moved to <a class="reference external" href="http://gitub.com/geopython/">GeoPython group on GitHub</a>. Since 2016, we also have new domain <a class="reference external" href="http://pywps.org">PyWPS.org</a>.</p>
-<p>You can find more at <a class="reference external" href="http://pywps.org/history">history page</a>.</p>
-</div>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h3><a href="index.html">Table Of Contents</a></h3>
- <ul>
-<li><a class="reference internal" href="#">PyWPS</a><ul>
-<li><a class="reference internal" href="#pywps-philosophy">PyWPS philosophy</a></li>
-<li><a class="reference internal" href="#why-is-pywps-there">Why is PyWPS there</a></li>
-<li><a class="reference internal" href="#pywps-history">PyWPS History</a></li>
-</ul>
-</li>
-</ul>
-
- <h4>Previous topic</h4>
- <p class="topless"><a href="wps.html"
- title="previous chapter">OGC Web Processing Service (OGC WPS)</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="install.html"
- title="next chapter">Installation</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/pywps.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="install.html" title="Installation"
- >next</a> |</li>
- <li class="right" >
- <a href="wps.html" title="OGC Web Processing Service (OGC WPS)"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html
deleted file mode 100644
index 85ddb92..0000000
--- a/docs/_build/html/search.html
+++ /dev/null
@@ -1,109 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>Search — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <script type="text/javascript" src="_static/searchtools.js"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <script type="text/javascript">
- jQuery(function() { Search.loadIndex("searchindex.js"); });
- </script>
-
- <script type="text/javascript" id="searchindexloader"></script>
-
-
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <h1 id="search-documentation">Search</h1>
- <div id="fallback" class="admonition warning">
- <script type="text/javascript">$('#fallback').hide();</script>
- <p>
- Please activate JavaScript to enable the search
- functionality.
- </p>
- </div>
- <p>
- From here you can search these documents. Enter your search
- words into the box below and click "search". Note that the search
- function will automatically search for all of the words. Pages
- containing fewer words won't appear in the result list.
- </p>
- <form action="" method="get">
- <input type="text" name="q" value="" />
- <input type="submit" value="search" />
- <span id="search-progress" style="padding-left: 10px"></span>
- </form>
-
- <div id="search-results">
-
- </div>
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js
deleted file mode 100644
index c60e779..0000000
--- a/docs/_build/html/searchindex.js
+++ /dev/null
@@ -1 +0,0 @@
-Search.setIndex({envversion:46,filenames:["api","configuration","deployment","development","exceptions","external_tools","index","install","migration","process","pywps","wps"],objects:{"":{pywps:[0,0,0,"-"]},"pywps.WPSRequest":{http_request:[0,2,1,""],inputs:[0,2,1,""],operation:[0,2,1,""]},"pywps.WPSResponse":{status:[0,2,1,""]},"pywps.app":{WPSRequest:[0,1,1,""],WPSResponse:[0,1,1,""]},"pywps.app.WPSRequest":{check_accepted_versions:[0,3,1,""],check_and_set_language:[0,3,1,""],check_an [...]
\ No newline at end of file
diff --git a/docs/_build/html/wps.html b/docs/_build/html/wps.html
deleted file mode 100644
index ffff5b1..0000000
--- a/docs/_build/html/wps.html
+++ /dev/null
@@ -1,354 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <title>OGC Web Processing Service (OGC WPS) — PyWPS 4.0.0-rc1 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '4.0.0-rc1',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="top" title="PyWPS 4.0.0-rc1 documentation" href="index.html" />
- <link rel="next" title="PyWPS" href="pywps.html" />
- <link rel="prev" title="Welcome to the PyWPS-4 documentation!" href="index.html" />
- </head>
- <body role="document">
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="pywps.html" title="PyWPS"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="index.html" title="Welcome to the PyWPS-4 documentation!"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="ogc-web-processing-service-ogc-wps">
-<span id="wps"></span><h1>OGC Web Processing Service (OGC WPS)<a class="headerlink" href="#ogc-web-processing-service-ogc-wps" title="Permalink to this headline">¶</a></h1>
-<p><a class="reference external" href="http://opengeospatial.org/standards">OGC Web Processing Service</a> standard
-provides rules for standardizing how inputs and outputs (requests and
-responses) for geospatial processing services. The standard also defines how a
-client can request the execution of a process, and how the output from the
-process is handled. It defines an interface that facilitates the publishing of
-geospatial processes and clients discovery of and binding to those processes.
-The data required by the WPS can be delivered across a network or they can be
-available at the server.</p>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">This description is mainly refering to 1.0.0 version standard, since
-PyWPS implements this version only. There is also 2.0.0 version, which
-we are about to implement in near future.</p>
-</div>
-<p>WPS is intended to be state-less protocol (like any OGC services). For every
-request-response action, the negotiation between the server and the client has
-to start. There is no official way, how to make the server “remember”, what was
-before, there is no communication history between the server and the client.</p>
-<div class="section" id="process">
-<h2>Process<a class="headerlink" href="#process" title="Permalink to this headline">¶</a></h2>
-<p>A process <cite>p</cite> is a function that for each input returns a corresponding output</p>
-<div class="math">
-\[p: X \rightarrow Y\]</div>
-<p>where <cite>X</cite> denotes the domain of arguments <cite>x</cite> and <cite>Y</cite> denotes the co-domain of values <cite>y</cite>.</p>
-<p>Within the specification, process arguments are referred to as <em>process inputs</em> and result
-values are referred to as <em>process outputs</em>. Processes that have no process inputs represent
-value generators that deliver constant or random process outputs.</p>
-<p><em>Process</em> is just some geospatial operation, which has it’s in- and outputs and
-which is deployed on the server. It can be something relatively simple (adding
-two raster maps together) or very complicated (climate change model). It can
-take short time (seconds) or long (days) to be calculated. Process is, what you,
-as PyWPS user, want to expose to other people and let their data processed.</p>
-<p>Every process has</p>
-<dl class="docutils">
-<dt>Identifier</dt>
-<dd>Unique process identifier</dd>
-<dt>Title</dt>
-<dd>Human readable title</dd>
-<dt>Abstract</dt>
-<dd>Longer description of the process, what it does, how is it supposed to be
-used</dd>
-</dl>
-<p>And list of in- and outputs.</p>
-</div>
-<div class="section" id="data-in-and-outputs">
-<h2>Data in- and outputs<a class="headerlink" href="#data-in-and-outputs" title="Permalink to this headline">¶</a></h2>
-<p>OGC WPS defines 3 types of data inputs and data outputs <em>LiteralData</em>,
-<em>ComplexData</em> and <em>BoundingBoxData</em>.</p>
-<p>All data types do need to have following attributes:</p>
-<dl class="docutils">
-<dt>Identifier</dt>
-<dd>Unique input identifier</dd>
-<dt>Title</dt>
-<dd>Human readable title</dd>
-<dt>Abstract</dt>
-<dd>Longer description of data input or output, so that the user could get
-oriented.</dd>
-<dt>minOccurs</dt>
-<dd>Minimal occurrence of the input (e.g. there can be more bands of raster file
-and they all can be passed as input using the same identifier)</dd>
-<dt>maxOccurs</dt>
-<dd>Maxium number of times, the input or output is present</dd>
-</dl>
-<p>Depending on the data type (Literal, Complex, BoundingBox), other attributes
-might occur too.</p>
-<div class="section" id="literaldata">
-<h3>LiteralData<a class="headerlink" href="#literaldata" title="Permalink to this headline">¶</a></h3>
-<p>Literal data is any text string, usually short. It’s used for passing single
-parameters like numbers or text parameters. WPS enables to the server, to define
-<cite>allowedValues</cite> - list or intervals of allowed values, as well as data type
-(integer, float, string). Additional attributes can be set, such as <cite>units</cite> or
-<cite>encoding</cite>.</p>
-</div>
-<div class="section" id="complexdata">
-<h3>ComplexData<a class="headerlink" href="#complexdata" title="Permalink to this headline">¶</a></h3>
-<p>Complex data are usually raster or vector files, but basically any (usually
-file based) data, which are usually processed (or result of the process). The
-input can be specified more using <cite>mimeType</cite>, XML <cite>schema</cite> or <cite>encoding</cite> (such
-as <cite>base64</cite> for raster data.</p>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">PyWPS (like every server) supports limited list <cite>mimeTypes</cite>. In case
-you need some new format, just create pull request in our repository.
-Refer <a class="reference internal" href="api.html#pywps.inout.formats.FORMATS" title="pywps.inout.formats.FORMATS"><code class="xref py py-const docutils literal"><span class="pre">pywps.inout.formats.FORMATS</span></code></a> for more details.</p>
-</div>
-<p>Usually, the minimum requirement for input data identification is <cite>mimeType</cite>.
-That usually is <cite>application/gml+xml</cite> for <a class="reference external" href="http://opengeospatial.org/standards/gml">GML</a>-encoded vector files, <cite>image/tiff;
-subtype=geotiff</cite> for raster files. The input or output can also be result of any
-OGC OWS service.</p>
-</div>
-<div class="section" id="boundingboxdata">
-<h3>BoundingBoxData<a class="headerlink" href="#boundingboxdata" title="Permalink to this headline">¶</a></h3>
-<div class="admonition-todo admonition" id="index-0">
-<p class="first admonition-title">Todo</p>
-<p class="last">add reference to OGC OWS Common spec</p>
-</div>
-<p>BoundingBox data are specified in OGC OWS Common specification as two pairs of
-coordinate (for 2D and 3D space). They can either be encoded in WGS84 or EPSG
-code can be passed too. They are intended to be used as definition of the target
-region.</p>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">In real life, BoundingBox data are not that commonly used</p>
-</div>
-</div>
-</div>
-<div class="section" id="passing-data-to-process-instance">
-<h2>Passing data to process instance<a class="headerlink" href="#passing-data-to-process-instance" title="Permalink to this headline">¶</a></h2>
-<p>There are 3 typical ways, how to pass the input data from the client to the
-server:</p>
-<dl class="docutils">
-<dt><strong>Data are on the server already</strong></dt>
-<dd>In the first case, the data are already stored on the server (from the point
-of view of the client). This is the simplest case.</dd>
-<dt><strong>Data are send to the server along with the request</strong></dt>
-<dd>In this case, the data are directly part of the XML encoded document send via
-HTTP POST. Some clients/servers are expecting the data to be inserted in
-<cite>CDATA</cite> section. The data can be text based (JSON), XML based (GML) or even
-raster based - in this case, they are usually encoded using <a class="reference external" href="https://docs.python.org/3/library/base64.html">base64</a>.</dd>
-<dt><strong>Reference link to target service is passed</strong></dt>
-<dd><p class="first">Client does not have to pass the data itself, client can just send reference
-link to target data service (or file). In such case, for example OGC WFS
-<cite>GetFeatureType</cite> URL can be passed and server will download the data
-automatically.</p>
-<p class="last">Although this is usually used for <cite>ComplexData</cite> input type, it can be used
-for literal and bounding box data too.</p>
-</dd>
-</dl>
-</div>
-<div class="section" id="sychronous-versus-asynchronous-process-request">
-<h2>Sychronous versus asynchronous process request<a class="headerlink" href="#sychronous-versus-asynchronous-process-request" title="Permalink to this headline">¶</a></h2>
-<p>There are two modes of process instance execution: Synchronous and asynchronous.</p>
-<dl class="docutils">
-<dt>Synchronous mode</dt>
-<dd>The client sends the <cite>Execute</cite> request to the server and waits with open
-server connection, till the process is calculated and final response is
-returned back. This is useful for fast calculations which do not take
-longer then a couple of seconds (<a class="reference external" href="http://httpd.apache.org/docs/2.4/mod/core.html#timeout">Apache2 httpd server uses 300 seconds</a> as default value for ConnectionTimeout).</dd>
-<dt>Asynchronous mode</dt>
-<dd><p class="first">Client sends the <cite>Execute</cite> request with explicit request for asynchronous
-mode. If supported by the process (in PyWPS, we have a configuration for
-that), the server returns back <cite>ProcessAccepted</cite> response immediately with
-URL, where the client can regularly check for <em>process execution status</em>.</p>
-<div class="last admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">As you see, using WPS, the client has to apply <em>pull</em> method for
-the communication with the server. Client has to be the active element
-in the communication - server is just responding to clients request and
-is not actively <em>pushing</em> any information (like it would if e.g. web
-sockets would be implemented).</p>
-</div>
-</dd>
-</dl>
-</div>
-<div class="section" id="process-status">
-<h2>Process status<a class="headerlink" href="#process-status" title="Permalink to this headline">¶</a></h2>
-<p><cite>Process status</cite> is generic status of the process instance, reporting to the
-client, how does the calculation go. There are 4 types of process statuses</p>
-<dl class="docutils">
-<dt>ProcessAccepted</dt>
-<dd>Process was accepted by the server and the process execution will start
-soon.</dd>
-<dt>ProcessStarted</dt>
-<dd>Process calculation has started. The status also contains report about
-<cite>percentDone</cite> - calculation progress and <cite>statusMessage</cite> - text reporting
-current calculation state (example: <em>“Caculationg buffer”</em> - 33%).</dd>
-<dt>ProcessFinished</dt>
-<dd>Process instance performed the calculation successfully and the final
-<cite>Execute</cite> response is returned to the client and/or stored on final location</dd>
-<dt>ProcessFailed</dt>
-<dd>There was something wrong with the process instance and the server reports
-<cite>server exception</cite> (see <a class="reference internal" href="exceptions.html#module-pywps.exceptions" title="pywps.exceptions"><code class="xref py py-mod docutils literal"><span class="pre">pywps.exceptions</span></code></a>) along with the message,
-what could possibly go wrong.</dd>
-</dl>
-</div>
-<div class="section" id="request-encoding-http-get-and-post">
-<h2>Request encoding, HTTP GET and POST<a class="headerlink" href="#request-encoding-http-get-and-post" title="Permalink to this headline">¶</a></h2>
-<p>The request can be encoded either using Key-value-pairs (KVP) or as the
-XML-formatted document.</p>
-<dl class="docutils">
-<dt>Key-value-pair</dt>
-<dd><p class="first">is usually sent via <a class="reference external" href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods">HTTP GET request method</a>
-encoded directly in the URL. The keys and values are separated with <cite>=</cite> sign and
-each pair is separated with <cite>&</cite> sign (with <cite>?</cite> at the beginning of the request.
-Example could be the <em>get capabilities reques</em>:</p>
-<div class="highlight-python"><div class="highlight"><pre>http://server.domain/wps?service=WPS&request=GetCapabilities&version=1.0.0
-</pre></div>
-</div>
-<p class="last">In this example, there are 3 pairs of input parameter: service, request and
-version with values <cite>WPS</cite>, <cite>GetCapabilities</cite> and <cite>1.0.0</cite> respectively.</p>
-</dd>
-<dt>XML</dt>
-<dd><p class="first">is document sent via <a class="reference external" href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods">HTTP POST request method</a>.
-The XML document can be more rich, having more parameters, better to be
-parsed in complex structures. Client can also encode whole datasets to the
-request, including raster (encoded using base64) or vector data (usually as GML file).:</p>
-<div class="last highlight-python"><div class="highlight"><pre><?xml version="1.0" encoding="UTF-8"?>
-<wps:GetCapabilities language="cz" service="WPS" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsGetCapabilities_request.xsd">
- <wps:AcceptVersions>
- <ows:Version>1.0.0</ows:Version>
- </wps:AcceptVersions>
-</wps:GetCapabilities>
-</pre></div>
-</div>
-</dd>
-</dl>
-<div class="admonition note">
-<p class="first admonition-title">Note</p>
-<p class="last">Even it might be looking more complicated to use XML over KVP, for
-some complex request it usually is more safe and efficient to use XML
-encoding. The KVP way, especially for WPS Execute request can be tricky
-and lead to unpredictable errors.</p>
-</div>
-</div>
-</div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p class="logo"><a href="index.html">
- <img class="logo" src="_static/pywps.png" alt="Logo"/>
- </a></p>
- <h3><a href="index.html">Table Of Contents</a></h3>
- <ul>
-<li><a class="reference internal" href="#">OGC Web Processing Service (OGC WPS)</a><ul>
-<li><a class="reference internal" href="#process">Process</a></li>
-<li><a class="reference internal" href="#data-in-and-outputs">Data in- and outputs</a><ul>
-<li><a class="reference internal" href="#literaldata">LiteralData</a></li>
-<li><a class="reference internal" href="#complexdata">ComplexData</a></li>
-<li><a class="reference internal" href="#boundingboxdata">BoundingBoxData</a></li>
-</ul>
-</li>
-<li><a class="reference internal" href="#passing-data-to-process-instance">Passing data to process instance</a></li>
-<li><a class="reference internal" href="#sychronous-versus-asynchronous-process-request">Sychronous versus asynchronous process request</a></li>
-<li><a class="reference internal" href="#process-status">Process status</a></li>
-<li><a class="reference internal" href="#request-encoding-http-get-and-post">Request encoding, HTTP GET and POST</a></li>
-</ul>
-</li>
-</ul>
-
- <h4>Previous topic</h4>
- <p class="topless"><a href="index.html"
- title="previous chapter">Welcome to the PyWPS-4 documentation!</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="pywps.html"
- title="next chapter">PyWPS</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/wps.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="pywps.html" title="PyWPS"
- >next</a> |</li>
- <li class="right" >
- <a href="index.html" title="Welcome to the PyWPS-4 documentation!"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">PyWPS 4.0.0-rc1 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky.This work is licensed under a Creative Commons Attribution 4.0 International License.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
- </div>
- </body>
-</html>
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pywps.git
More information about the Pkg-grass-devel
mailing list