Update docs to newer sphinx.
BIN
docs/_build/doctrees/ec2_tut.doctree
vendored
BIN
docs/_build/doctrees/environment.pickle
vendored
BIN
docs/_build/doctrees/getting_started.doctree
vendored
BIN
docs/_build/doctrees/index.doctree
vendored
2
docs/_build/html/.buildinfo
vendored
@ -1,4 +1,4 @@
|
||||
# Sphinx build info version 1
|
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||
config: 62fbc8d3ca48f640a11cb99a547e1056
|
||||
config: c0b40518469bd0810863cee40e68f904
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
|
74
docs/_build/html/_sources/ec2_tut.rst.txt
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
.. _ec2_tut:
|
||||
|
||||
=======================
|
||||
Use Moto as EC2 backend
|
||||
=======================
|
||||
|
||||
This tutorial explains ``moto.ec2``'s features and how to use it. This
|
||||
tutorial assumes that you have already downloaded and installed boto and moto.
|
||||
Before all code examples the following snippet is launched::
|
||||
|
||||
>>> import boto.ec2, moto
|
||||
>>> mock_ec2 = moto.mock_ec2()
|
||||
>>> mock_ec2.start()
|
||||
>>> conn = boto.ec2.connect_to_region("eu-west-1")
|
||||
|
||||
Launching instances
|
||||
-------------------
|
||||
|
||||
After mock is started, the behavior is the same than previously::
|
||||
|
||||
>>> reservation = conn.run_instances('ami-f00ba4')
|
||||
>>> reservation.instances[0]
|
||||
Instance:i-91dd2f32
|
||||
|
||||
Moto set static or generate random object's attributes::
|
||||
|
||||
>>> vars(reservation.instances[0])
|
||||
{'_in_monitoring_element': False,
|
||||
'_placement': None,
|
||||
'_previous_state': None,
|
||||
'_state': pending(0),
|
||||
'ami_launch_index': u'0',
|
||||
'architecture': u'x86_64',
|
||||
'block_device_mapping': None,
|
||||
'client_token': '',
|
||||
'connection': EC2Connection:ec2.eu-west-1.amazonaws.com,
|
||||
'dns_name': u'ec2-54.214.135.84.compute-1.amazonaws.com',
|
||||
'ebs_optimized': False,
|
||||
'eventsSet': None,
|
||||
'group_name': None,
|
||||
'groups': [],
|
||||
'hypervisor': u'xen',
|
||||
'id': u'i-91dd2f32',
|
||||
'image_id': u'f00ba4',
|
||||
'instance_profile': None,
|
||||
'instance_type': u'm1.small',
|
||||
'interfaces': [NetworkInterface:eni-ed65f870],
|
||||
'ip_address': u'54.214.135.84',
|
||||
'item': u'\n ',
|
||||
'kernel': u'None',
|
||||
'key_name': u'None',
|
||||
'launch_time': u'2015-07-27T05:59:57Z',
|
||||
'monitored': True,
|
||||
'monitoring': u'\n ',
|
||||
'monitoring_state': u'enabled',
|
||||
'persistent': False,
|
||||
'platform': None,
|
||||
'private_dns_name': u'ip-10.136.187.180.ec2.internal',
|
||||
'private_ip_address': u'10.136.187.180',
|
||||
'product_codes': [],
|
||||
'public_dns_name': u'ec2-54.214.135.84.compute-1.amazonaws.com',
|
||||
'ramdisk': None,
|
||||
'reason': '',
|
||||
'region': RegionInfo:eu-west-1,
|
||||
'requester_id': None,
|
||||
'root_device_name': None,
|
||||
'root_device_type': None,
|
||||
'sourceDestCheck': u'true',
|
||||
'spot_instance_request_id': None,
|
||||
'state_reason': None,
|
||||
'subnet_id': None,
|
||||
'tags': {},
|
||||
'virtualization_type': u'paravirtual',
|
||||
'vpc_id': None}
|
112
docs/_build/html/_sources/getting_started.rst.txt
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
=========================
|
||||
Getting Started with Moto
|
||||
=========================
|
||||
|
||||
Installing Moto
|
||||
---------------
|
||||
|
||||
You can use ``pip`` to install the latest released version of ``moto``::
|
||||
|
||||
pip install moto
|
||||
|
||||
If you want to install ``moto`` from source::
|
||||
|
||||
git clone git://github.com/spulec/moto.git
|
||||
cd moto
|
||||
python setup.py install
|
||||
|
||||
Moto usage
|
||||
----------
|
||||
|
||||
For example we have the following code we want to test:
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
import boto
|
||||
from boto.s3.key import Key
|
||||
|
||||
class MyModel(object):
|
||||
def __init__(self, name, value):
|
||||
self.name = name
|
||||
self.value = value
|
||||
|
||||
def save(self):
|
||||
conn = boto.connect_s3()
|
||||
bucket = conn.get_bucket('mybucket')
|
||||
k = Key(bucket)
|
||||
k.key = self.name
|
||||
k.set_contents_from_string(self.value)
|
||||
|
||||
There are several method to do this, just keep in mind Moto creates a full blank environment.
|
||||
|
||||
Decorator
|
||||
~~~~~~~~~
|
||||
|
||||
With a decorator wrapping all the calls to S3 are automatically mocked out.
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
import boto
|
||||
from moto import mock_s3
|
||||
from mymodule import MyModel
|
||||
|
||||
@mock_s3
|
||||
def test_my_model_save():
|
||||
conn = boto.connect_s3()
|
||||
# We need to create the bucket since this is all in Moto's 'virtual' AWS account
|
||||
conn.create_bucket('mybucket')
|
||||
|
||||
model_instance = MyModel('steve', 'is awesome')
|
||||
model_instance.save()
|
||||
|
||||
assert conn.get_bucket('mybucket').get_key('steve').get_contents_as_string() == 'is awesome'
|
||||
|
||||
Context manager
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Same as decorator, every call inside ``with`` statement are mocked out.
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
def test_my_model_save():
|
||||
with mock_s3():
|
||||
conn = boto.connect_s3()
|
||||
conn.create_bucket('mybucket')
|
||||
|
||||
model_instance = MyModel('steve', 'is awesome')
|
||||
model_instance.save()
|
||||
|
||||
assert conn.get_bucket('mybucket').get_key('steve').get_contents_as_string() == 'is awesome'
|
||||
|
||||
Raw
|
||||
~~~
|
||||
|
||||
You can also start and stop manually the mocking.
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
def test_my_model_save():
|
||||
mock = mock_s3()
|
||||
mock.start()
|
||||
|
||||
conn = boto.connect_s3()
|
||||
conn.create_bucket('mybucket')
|
||||
|
||||
model_instance = MyModel('steve', 'is awesome')
|
||||
model_instance.save()
|
||||
|
||||
assert conn.get_bucket('mybucket').get_key('steve').get_contents_as_string() == 'is awesome'
|
||||
|
||||
mock.stop()
|
||||
|
||||
Stand-alone server mode
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Moto comes with a stand-alone server allowing you to mock out an AWS HTTP endpoint. It is very useful to test even if you don't use Python.
|
||||
|
||||
.. sourcecode:: bash
|
||||
|
||||
$ moto_server ec2 -p3000
|
||||
* Running on http://127.0.0.1:3000/
|
||||
|
||||
This method isn't encouraged if you're using ``boto``, best is to use decorator method.
|
91
docs/_build/html/_sources/index.rst.txt
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
.. _index:
|
||||
|
||||
=============================
|
||||
Moto: A Mock library for boto
|
||||
=============================
|
||||
|
||||
A library that allows you to easily mock out tests based on
|
||||
_`AWS infrastructure`.
|
||||
|
||||
.. _AWS infrastructure: http://aws.amazon.com/
|
||||
|
||||
Getting Started
|
||||
---------------
|
||||
|
||||
If you've never used ``moto`` before, you should read the
|
||||
:doc:`Getting Started with Moto <getting_started>` guide to get familiar
|
||||
with ``moto`` & its usage.
|
||||
|
||||
Currently implemented Services
|
||||
------------------------------
|
||||
|
||||
* **Compute**
|
||||
|
||||
* :doc:`Elastic Compute Cloud <ec2_tut>`
|
||||
* AMI
|
||||
* EBS
|
||||
* Instances
|
||||
* Security groups
|
||||
* Tags
|
||||
* Auto Scaling
|
||||
|
||||
* **Storage and content delivery**
|
||||
|
||||
* S3
|
||||
* Glacier
|
||||
|
||||
* **Database**
|
||||
|
||||
* RDS
|
||||
* DynamoDB
|
||||
* Redshift
|
||||
|
||||
* **Networking**
|
||||
|
||||
* Route53
|
||||
|
||||
* **Administration and security**
|
||||
|
||||
* Identity & access management
|
||||
* CloudWatch
|
||||
|
||||
* **Deployment and management**
|
||||
|
||||
* CloudFormation
|
||||
|
||||
* **Analytics**
|
||||
|
||||
* Kinesis
|
||||
* EMR
|
||||
|
||||
* **Application service**
|
||||
|
||||
* SQS
|
||||
* SES
|
||||
|
||||
* **Mobile services**
|
||||
|
||||
* SNS
|
||||
|
||||
Additional Resources
|
||||
--------------------
|
||||
|
||||
* `Moto Source Repository`_
|
||||
* `Moto Issue Tracker`_
|
||||
|
||||
.. _Moto Issue Tracker: https://github.com/spulec/moto/issues
|
||||
.. _Moto Source Repository: https://github.com/spulec/moto
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:hidden:
|
||||
:glob:
|
||||
|
||||
getting_started
|
176
docs/_build/html/_static/alabaster.css
vendored
@ -15,6 +15,41 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@import url("basic.css");
|
||||
|
||||
/* -- page layout ----------------------------------------------------------- */
|
||||
@ -22,12 +57,13 @@
|
||||
body {
|
||||
font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif;
|
||||
font-size: 17px;
|
||||
background-color: white;
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
div.document {
|
||||
width: 940px;
|
||||
margin: 30px auto 0 auto;
|
||||
@ -44,6 +80,8 @@ div.bodywrapper {
|
||||
|
||||
div.sphinxsidebar {
|
||||
width: 220px;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
hr {
|
||||
@ -51,11 +89,15 @@ hr {
|
||||
}
|
||||
|
||||
div.body {
|
||||
background-color: #ffffff;
|
||||
background-color: #fff;
|
||||
color: #3E4349;
|
||||
padding: 0 30px 0 30px;
|
||||
}
|
||||
|
||||
div.body > .section {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.footer {
|
||||
width: 940px;
|
||||
margin: 20px auto 30px auto;
|
||||
@ -68,6 +110,11 @@ div.footer a {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
p.caption {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
|
||||
div.relations {
|
||||
display: none;
|
||||
@ -84,11 +131,6 @@ div.sphinxsidebar a:hover {
|
||||
border-bottom: 1px solid #999;
|
||||
}
|
||||
|
||||
div.sphinxsidebar {
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
div.sphinxsidebarwrapper {
|
||||
padding: 18px 10px;
|
||||
}
|
||||
@ -168,8 +210,8 @@ div.sphinxsidebar input {
|
||||
div.sphinxsidebar hr {
|
||||
border: none;
|
||||
height: 1px;
|
||||
color: #999;
|
||||
background: #999;
|
||||
color: #AAA;
|
||||
background: #AAA;
|
||||
|
||||
text-align: left;
|
||||
margin-left: 0;
|
||||
@ -225,19 +267,15 @@ div.body p, div.body dd, div.body li {
|
||||
div.admonition {
|
||||
margin: 20px 0px;
|
||||
padding: 10px 30px;
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.admonition tt.xref, div.admonition a tt {
|
||||
div.admonition tt.xref, div.admonition code.xref, div.admonition a tt {
|
||||
background-color: #FBFBFB;
|
||||
border-bottom: 1px solid #fafafa;
|
||||
}
|
||||
|
||||
dd div.admonition {
|
||||
margin-left: -60px;
|
||||
padding-left: 60px;
|
||||
}
|
||||
|
||||
div.admonition p.admonition-title {
|
||||
font-family: 'Garamond', 'Georgia', serif;
|
||||
font-weight: normal;
|
||||
@ -252,25 +290,71 @@ div.admonition p.last {
|
||||
}
|
||||
|
||||
div.highlight {
|
||||
background-color: white;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
dt:target, .highlight {
|
||||
background: #FAF3E8;
|
||||
}
|
||||
|
||||
div.warning {
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
}
|
||||
|
||||
div.danger {
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
-moz-box-shadow: 2px 2px 4px #D52C2C;
|
||||
-webkit-box-shadow: 2px 2px 4px #D52C2C;
|
||||
box-shadow: 2px 2px 4px #D52C2C;
|
||||
}
|
||||
|
||||
div.error {
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
-moz-box-shadow: 2px 2px 4px #D52C2C;
|
||||
-webkit-box-shadow: 2px 2px 4px #D52C2C;
|
||||
box-shadow: 2px 2px 4px #D52C2C;
|
||||
}
|
||||
|
||||
div.caution {
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
}
|
||||
|
||||
div.attention {
|
||||
background-color: #FCC;
|
||||
border: 1px solid #FAA;
|
||||
}
|
||||
|
||||
div.important {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.note {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.tip {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.hint {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.seealso {
|
||||
background-color: #EEE;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
div.topic {
|
||||
background-color: #eee;
|
||||
background-color: #EEE;
|
||||
}
|
||||
|
||||
p.admonition-title {
|
||||
@ -305,16 +389,16 @@ tt.descname, code.descname {
|
||||
}
|
||||
|
||||
img.screenshot {
|
||||
-moz-box-shadow: 2px 2px 4px #eee;
|
||||
-webkit-box-shadow: 2px 2px 4px #eee;
|
||||
box-shadow: 2px 2px 4px #eee;
|
||||
-moz-box-shadow: 2px 2px 4px #EEE;
|
||||
-webkit-box-shadow: 2px 2px 4px #EEE;
|
||||
box-shadow: 2px 2px 4px #EEE;
|
||||
}
|
||||
|
||||
table.docutils {
|
||||
border: 1px solid #888;
|
||||
-moz-box-shadow: 2px 2px 4px #eee;
|
||||
-webkit-box-shadow: 2px 2px 4px #eee;
|
||||
box-shadow: 2px 2px 4px #eee;
|
||||
-moz-box-shadow: 2px 2px 4px #EEE;
|
||||
-webkit-box-shadow: 2px 2px 4px #EEE;
|
||||
box-shadow: 2px 2px 4px #EEE;
|
||||
}
|
||||
|
||||
table.docutils td, table.docutils th {
|
||||
@ -350,8 +434,22 @@ table.field-list td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.field-list p {
|
||||
margin-bottom: 0.8em;
|
||||
}
|
||||
|
||||
/* Cloned from
|
||||
* https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68
|
||||
*/
|
||||
.field-name {
|
||||
-moz-hyphens: manual;
|
||||
-ms-hyphens: manual;
|
||||
-webkit-hyphens: manual;
|
||||
hyphens: manual;
|
||||
}
|
||||
|
||||
table.footnote td.label {
|
||||
width: 0px;
|
||||
width: .1px;
|
||||
padding: 0.3em 0 0.3em 0.5em;
|
||||
}
|
||||
|
||||
@ -374,6 +472,7 @@ blockquote {
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
/* Matches the 30px from the narrow-screen "li > ul" selector below */
|
||||
margin: 10px 0 10px 30px;
|
||||
padding: 0;
|
||||
}
|
||||
@ -385,16 +484,15 @@ pre {
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
div.viewcode-block:target {
|
||||
background: #ffd;
|
||||
}
|
||||
|
||||
dl pre, blockquote pre, li pre {
|
||||
margin-left: 0;
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
dl dl pre {
|
||||
margin-left: -90px;
|
||||
padding-left: 90px;
|
||||
}
|
||||
|
||||
tt, code {
|
||||
background-color: #ecf0f3;
|
||||
color: #222;
|
||||
@ -403,7 +501,7 @@ tt, code {
|
||||
|
||||
tt.xref, code.xref, a tt {
|
||||
background-color: #FBFBFB;
|
||||
border-bottom: 1px solid white;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
|
||||
a.reference {
|
||||
@ -411,6 +509,11 @@ a.reference {
|
||||
border-bottom: 1px dotted #004B6B;
|
||||
}
|
||||
|
||||
/* Don't put an underline on images */
|
||||
a.image-reference, a.image-reference:hover {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
a.reference:hover {
|
||||
border-bottom: 1px solid #6D4100;
|
||||
}
|
||||
@ -460,6 +563,11 @@ a:hover tt, a:hover code {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
li > ul {
|
||||
/* Matches the 30px from the "ul, ol" selector above */
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.document {
|
||||
width: auto;
|
||||
}
|
||||
@ -495,7 +603,7 @@ a:hover tt, a:hover code {
|
||||
|
||||
div.documentwrapper {
|
||||
float: none;
|
||||
background: white;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
div.sphinxsidebar {
|
||||
@ -510,7 +618,7 @@ a:hover tt, a:hover code {
|
||||
|
||||
div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,
|
||||
div.sphinxsidebar h3 a {
|
||||
color: white;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
div.sphinxsidebar a {
|
||||
|
79
docs/_build/html/_static/basic.css
vendored
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Sphinx stylesheet -- basic theme.
|
||||
*
|
||||
* :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
|
||||
* :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
@ -52,6 +52,8 @@ div.sphinxsidebar {
|
||||
width: 230px;
|
||||
margin-left: -100%;
|
||||
font-size: 90%;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap : break-word;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul {
|
||||
@ -83,10 +85,6 @@ div.sphinxsidebar #searchbox input[type="text"] {
|
||||
width: 170px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox input[type="submit"] {
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
max-width: 100%;
|
||||
@ -124,6 +122,8 @@ ul.keywordmatches li.goodmatch a {
|
||||
|
||||
table.contentstable {
|
||||
width: 90%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.contentstable p.biglink {
|
||||
@ -151,9 +151,14 @@ table.indextable td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.indextable dl, table.indextable dd {
|
||||
table.indextable ul {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
table.indextable > tbody > tr > td > ul {
|
||||
padding-left: 0em;
|
||||
}
|
||||
|
||||
table.indextable tr.pcap {
|
||||
@ -185,8 +190,22 @@ div.genindex-jumpbox {
|
||||
padding: 0.4em;
|
||||
}
|
||||
|
||||
/* -- domain module index --------------------------------------------------- */
|
||||
|
||||
table.modindextable td {
|
||||
padding: 2px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
/* -- general body styles --------------------------------------------------- */
|
||||
|
||||
div.body p, div.body dd, div.body li, div.body blockquote {
|
||||
-moz-hyphens: auto;
|
||||
-ms-hyphens: auto;
|
||||
-webkit-hyphens: auto;
|
||||
hyphens: auto;
|
||||
}
|
||||
|
||||
a.headerlink {
|
||||
visibility: hidden;
|
||||
}
|
||||
@ -212,10 +231,6 @@ div.body td {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.field-list ul {
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
.first {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
@ -332,10 +347,6 @@ table.docutils td, table.docutils th {
|
||||
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;
|
||||
}
|
||||
@ -372,6 +383,20 @@ div.figure p.caption span.caption-number {
|
||||
div.figure p.caption span.caption-text {
|
||||
}
|
||||
|
||||
/* -- field list styles ----------------------------------------------------- */
|
||||
|
||||
table.field-list td, table.field-list th {
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
.field-list ul {
|
||||
margin: 0;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
.field-list p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* -- other body styles ----------------------------------------------------- */
|
||||
|
||||
@ -422,15 +447,6 @@ dl.glossary dt {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.field-list ul {
|
||||
margin: 0;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
.field-list p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.optional {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
@ -489,6 +505,13 @@ pre {
|
||||
overflow-y: hidden; /* fixes display issues on Chrome browsers */
|
||||
}
|
||||
|
||||
span.pre {
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
-webkit-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
td.linenos pre {
|
||||
padding: 5px 0px;
|
||||
border: 0;
|
||||
@ -580,6 +603,16 @@ span.eqno {
|
||||
float: right;
|
||||
}
|
||||
|
||||
span.eqno a.headerlink {
|
||||
position: relative;
|
||||
left: 0px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
div.math:hover a.headerlink {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* -- printout stylesheet --------------------------------------------------- */
|
||||
|
||||
@media print {
|
||||
|
BIN
docs/_build/html/_static/comment-bright.png
vendored
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 756 B |
BIN
docs/_build/html/_static/comment-close.png
vendored
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 829 B |
BIN
docs/_build/html/_static/comment.png
vendored
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 641 B |
1
docs/_build/html/_static/custom.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
/* This file intentionally left blank. */
|
28
docs/_build/html/_static/doctools.js
vendored
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Sphinx JavaScript utilities for all documentation.
|
||||
*
|
||||
* :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
|
||||
* :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
@ -124,6 +124,7 @@ var Documentation = {
|
||||
this.fixFirefoxAnchorBug();
|
||||
this.highlightSearchWords();
|
||||
this.initIndexTable();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@ -252,6 +253,29 @@ var Documentation = {
|
||||
});
|
||||
var url = parts.join('/');
|
||||
return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
|
||||
},
|
||||
|
||||
initOnKeyListeners: function() {
|
||||
$(document).keyup(function(event) {
|
||||
var activeElementType = document.activeElement.tagName;
|
||||
// don't navigate when in search box or textarea
|
||||
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
|
||||
switch (event.keyCode) {
|
||||
case 37: // left
|
||||
var prevHref = $('link[rel="prev"]').prop('href');
|
||||
if (prevHref) {
|
||||
window.location.href = prevHref;
|
||||
return false;
|
||||
}
|
||||
case 39: // right
|
||||
var nextHref = $('link[rel="next"]').prop('href');
|
||||
if (nextHref) {
|
||||
window.location.href = nextHref;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@ -260,4 +284,4 @@ _ = Documentation.gettext;
|
||||
|
||||
$(document).ready(function() {
|
||||
Documentation.init();
|
||||
});
|
||||
});
|
BIN
docs/_build/html/_static/down-pressed.png
vendored
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 222 B |
BIN
docs/_build/html/_static/down.png
vendored
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 202 B |
BIN
docs/_build/html/_static/file.png
vendored
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 286 B |
10074
docs/_build/html/_static/jquery-3.1.0.js
vendored
Normal file
8
docs/_build/html/_static/jquery.js
vendored
BIN
docs/_build/html/_static/minus.png
vendored
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 90 B |
BIN
docs/_build/html/_static/plus.png
vendored
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 90 B |
6
docs/_build/html/_static/pygments.css
vendored
@ -4,8 +4,10 @@
|
||||
.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 */
|
||||
@ -45,8 +47,10 @@
|
||||
.highlight .mh { color: #208050 } /* Literal.Number.Hex */
|
||||
.highlight .mi { color: #208050 } /* Literal.Number.Integer */
|
||||
.highlight .mo { color: #208050 } /* Literal.Number.Oct */
|
||||
.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
|
||||
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
|
||||
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
|
||||
.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
|
||||
.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 */
|
||||
@ -57,7 +61,9 @@
|
||||
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
|
||||
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
|
||||
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
|
||||
.highlight .fm { color: #06287e } /* Name.Function.Magic */
|
||||
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
|
||||
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
|
||||
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
|
||||
.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
|
||||
.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
|
166
docs/_build/html/_static/searchtools.js
vendored
@ -2,14 +2,15 @@
|
||||
* searchtools.js_t
|
||||
* ~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* Sphinx JavaScript utilties for the full-text search.
|
||||
* Sphinx JavaScript utilities for the full-text search.
|
||||
*
|
||||
* :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
|
||||
* :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
|
||||
*/
|
||||
@ -225,6 +226,106 @@ var Scorer = {
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var splitChars = (function() {
|
||||
var result = {};
|
||||
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
|
||||
1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
|
||||
2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
|
||||
2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
|
||||
3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
|
||||
3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
|
||||
4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
|
||||
8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
|
||||
11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
|
||||
43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
|
||||
var i, j, start, end;
|
||||
for (i = 0; i < singles.length; i++) {
|
||||
result[singles[i]] = true;
|
||||
}
|
||||
var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
|
||||
[722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
|
||||
[1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
|
||||
[1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
|
||||
[1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
|
||||
[2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
|
||||
[2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
|
||||
[2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
|
||||
[2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
|
||||
[2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
|
||||
[2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
|
||||
[2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
|
||||
[3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
|
||||
[3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
|
||||
[3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
|
||||
[3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
|
||||
[3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
|
||||
[3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
|
||||
[4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
|
||||
[4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
|
||||
[4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
|
||||
[4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
|
||||
[5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
|
||||
[6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
|
||||
[6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
|
||||
[6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
|
||||
[6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
|
||||
[7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
|
||||
[7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
|
||||
[8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
|
||||
[8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
|
||||
[8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
|
||||
[10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
|
||||
[11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
|
||||
[12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
|
||||
[12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
|
||||
[12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
|
||||
[19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
|
||||
[42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
|
||||
[42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
|
||||
[43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
|
||||
[43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
|
||||
[43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
|
||||
[43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
|
||||
[44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
|
||||
[57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
|
||||
[64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
|
||||
[65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
|
||||
[65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
|
||||
for (i = 0; i < ranges.length; i++) {
|
||||
start = ranges[i][0];
|
||||
end = ranges[i][1];
|
||||
for (j = start; j <= end; j++) {
|
||||
result[j] = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
|
||||
function splitQuery(query) {
|
||||
var result = [];
|
||||
var start = -1;
|
||||
for (var i = 0; i < query.length; i++) {
|
||||
if (splitChars[query.charCodeAt(i)]) {
|
||||
if (start !== -1) {
|
||||
result.push(query.slice(start, i));
|
||||
start = -1;
|
||||
}
|
||||
} else if (start === -1) {
|
||||
start = i;
|
||||
}
|
||||
}
|
||||
if (start !== -1) {
|
||||
result.push(query.slice(start));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Search Module
|
||||
*/
|
||||
@ -323,7 +424,7 @@ var Search = {
|
||||
var searchterms = [];
|
||||
var excluded = [];
|
||||
var hlterms = [];
|
||||
var tmp = query.split(/\s+/);
|
||||
var tmp = splitQuery(query);
|
||||
var objectterms = [];
|
||||
for (i = 0; i < tmp.length; i++) {
|
||||
if (tmp[i] !== "") {
|
||||
@ -337,6 +438,10 @@ var Search = {
|
||||
}
|
||||
// stem the word
|
||||
var word = stemmer.stemWord(tmp[i].toLowerCase());
|
||||
// prevent stemmer from cutting word smaller than two chars
|
||||
if(word.length < 3 && tmp[i].length >= 3) {
|
||||
word = tmp[i];
|
||||
}
|
||||
var toAppend;
|
||||
// select the correct list
|
||||
if (word[0] == '-') {
|
||||
@ -373,8 +478,7 @@ var Search = {
|
||||
}
|
||||
|
||||
// lookup as search terms in fulltext
|
||||
results = results.concat(this.performTermsSearch(searchterms, excluded, terms, Scorer.term))
|
||||
.concat(this.performTermsSearch(searchterms, excluded, titleterms, Scorer.title));
|
||||
results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
|
||||
|
||||
// let the scorer override scores with a custom scoring function
|
||||
if (Scorer.score) {
|
||||
@ -435,7 +539,8 @@ var Search = {
|
||||
displayNextItem();
|
||||
});
|
||||
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
|
||||
$.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[0] + '.txt',
|
||||
var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX;
|
||||
$.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].slice(-suffix.length) === suffix ? '' : suffix),
|
||||
dataType: "text",
|
||||
complete: function(jqxhr, textstatus) {
|
||||
var data = jqxhr.responseText;
|
||||
@ -474,6 +579,7 @@ var Search = {
|
||||
*/
|
||||
performObjectSearch : function(object, otherterms) {
|
||||
var filenames = this._index.filenames;
|
||||
var docnames = this._index.docnames;
|
||||
var objects = this._index.objects;
|
||||
var objnames = this._index.objnames;
|
||||
var titles = this._index.titles;
|
||||
@ -527,7 +633,7 @@ var Search = {
|
||||
} else {
|
||||
score += Scorer.objPrioDefault;
|
||||
}
|
||||
results.push([filenames[match[0]], fullname, '#'+anchor, descr, score]);
|
||||
results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -538,23 +644,48 @@ var Search = {
|
||||
/**
|
||||
* search for full-text terms in the index
|
||||
*/
|
||||
performTermsSearch : function(searchterms, excluded, terms, score) {
|
||||
performTermsSearch : function(searchterms, excluded, terms, titleterms) {
|
||||
var docnames = this._index.docnames;
|
||||
var filenames = this._index.filenames;
|
||||
var titles = this._index.titles;
|
||||
|
||||
var i, j, file, files;
|
||||
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 ((files = terms[word]) === undefined)
|
||||
if ($u.every(_o, function(o){return o.files === undefined;})) {
|
||||
break;
|
||||
if (files.length === undefined) {
|
||||
files = [files];
|
||||
}
|
||||
// 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];
|
||||
@ -576,7 +707,9 @@ var Search = {
|
||||
// ensure that none of the excluded terms is in the search result
|
||||
for (i = 0; i < excluded.length; i++) {
|
||||
if (terms[excluded[i]] == file ||
|
||||
$u.contains(terms[excluded[i]] || [], file)) {
|
||||
titleterms[excluded[i]] == file ||
|
||||
$u.contains(terms[excluded[i]] || [], file) ||
|
||||
$u.contains(titleterms[excluded[i]] || [], file)) {
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
@ -584,7 +717,10 @@ var Search = {
|
||||
|
||||
// if we have still a valid result we can add it to the result list
|
||||
if (valid) {
|
||||
results.push([filenames[file], titles[file], '', null, score]);
|
||||
// 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([docnames[file], titles[file], '', null, score, filenames[file]]);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
@ -594,7 +730,7 @@ var Search = {
|
||||
* 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
|
||||
* words. the first one is used to find the occurrence, the
|
||||
* latter for highlighting it.
|
||||
*/
|
||||
makeSearchSummary : function(text, keywords, hlwords) {
|
||||
|
BIN
docs/_build/html/_static/up-pressed.png
vendored
Before Width: | Height: | Size: 345 B After Width: | Height: | Size: 214 B |
BIN
docs/_build/html/_static/up.png
vendored
Before Width: | Height: | Size: 345 B After Width: | Height: | Size: 203 B |
4
docs/_build/html/_static/websupport.js
vendored
@ -2,9 +2,9 @@
|
||||
* websupport.js
|
||||
* ~~~~~~~~~~~~~
|
||||
*
|
||||
* sphinx.websupport utilties for all documentation.
|
||||
* sphinx.websupport utilities for all documentation.
|
||||
*
|
||||
* :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
|
||||
* :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
38
docs/_build/html/ec2_tut.html
vendored
@ -6,7 +6,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Use Moto as EC2 backend — Moto 0.4.10 documentation</title>
|
||||
<title>Use Moto as EC2 backend — Moto 0.4.10 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -17,19 +17,24 @@
|
||||
VERSION: '0.4.10',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</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>
|
||||
<link rel="top" title="Moto 0.4.10 documentation" href="index.html" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head>
|
||||
<body role="document">
|
||||
<body role="document">
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
@ -41,22 +46,22 @@
|
||||
<p>This tutorial explains <code class="docutils literal"><span class="pre">moto.ec2</span></code>‘s features and how to use it. This
|
||||
tutorial assumes that you have already downloaded and installed boto and moto.
|
||||
Before all code examples the following snippet is launched:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">boto.ec2</span><span class="o">,</span> <span class="nn">moto</span>
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">boto.ec2</span><span class="o">,</span> <span class="nn">moto</span>
|
||||
<span class="gp">>>> </span><span class="n">mock_ec2</span> <span class="o">=</span> <span class="n">moto</span><span class="o">.</span><span class="n">mock_ec2</span><span class="p">()</span>
|
||||
<span class="gp">>>> </span><span class="n">mock_ec2</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
|
||||
<span class="gp">>>> </span><span class="n">conn</span> <span class="o">=</span> <span class="n">boto</span><span class="o">.</span><span class="n">ec2</span><span class="o">.</span><span class="n">connect_to_region</span><span class="p">(</span><span class="s">"eu-west-1"</span><span class="p">)</span>
|
||||
<span class="gp">>>> </span><span class="n">conn</span> <span class="o">=</span> <span class="n">boto</span><span class="o">.</span><span class="n">ec2</span><span class="o">.</span><span class="n">connect_to_region</span><span class="p">(</span><span class="s2">"eu-west-1"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="section" id="launching-instances">
|
||||
<h2>Launching instances<a class="headerlink" href="#launching-instances" title="Permalink to this headline">¶</a></h2>
|
||||
<p>After mock is started, the behavior is the same than previously:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">reservation</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">run_instances</span><span class="p">(</span><span class="s">'ami-f00ba4'</span><span class="p">)</span>
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">reservation</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">run_instances</span><span class="p">(</span><span class="s1">'ami-f00ba4'</span><span class="p">)</span>
|
||||
<span class="gp">>>> </span><span class="n">reservation</span><span class="o">.</span><span class="n">instances</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="go">Instance:i-91dd2f32</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Moto set static or generate random object’s attributes:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="nb">vars</span><span class="p">(</span><span class="n">reservation</span><span class="o">.</span><span class="n">instances</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="nb">vars</span><span class="p">(</span><span class="n">reservation</span><span class="o">.</span><span class="n">instances</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="go">{'_in_monitoring_element': False,</span>
|
||||
<span class="go"> '_placement': None,</span>
|
||||
<span class="go"> '_previous_state': None,</span>
|
||||
@ -132,21 +137,18 @@ Before all code examples the following snippet is launched:</p>
|
||||
<div role="note" aria-label="source link">
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="_sources/ec2_tut.txt"
|
||||
<li><a href="_sources/ec2_tut.rst.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" />
|
||||
<div><input type="text" name="q" /></div>
|
||||
<div><input type="submit" value="Go" /></div>
|
||||
<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>
|
||||
@ -157,11 +159,11 @@ Before all code examples the following snippet is launched:</p>
|
||||
©2015, Steve Pulec.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.5.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
||||
|
||||
|
|
||||
<a href="_sources/ec2_tut.txt"
|
||||
<a href="_sources/ec2_tut.rst.txt"
|
||||
rel="nofollow">Page source</a>
|
||||
</div>
|
||||
|
||||
|
26
docs/_build/html/genindex.html
vendored
@ -7,7 +7,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Index — Moto 0.4.10 documentation</title>
|
||||
<title>Index — Moto 0.4.10 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -18,19 +18,24 @@
|
||||
VERSION: '0.4.10',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</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>
|
||||
<link rel="top" title="Moto 0.4.10 documentation" href="index.html" />
|
||||
<link rel="index" title="Index" href="#" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head>
|
||||
<body role="document">
|
||||
<body role="document">
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
@ -62,14 +67,11 @@
|
||||
<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" />
|
||||
<div><input type="text" name="q" /></div>
|
||||
<div><input type="submit" value="Go" /></div>
|
||||
<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>
|
||||
@ -80,8 +82,8 @@
|
||||
©2015, Steve Pulec.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.5.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
74
docs/_build/html/getting_started.html
vendored
@ -6,7 +6,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Getting Started with Moto — Moto 0.4.10 documentation</title>
|
||||
<title>Getting Started with Moto — Moto 0.4.10 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -17,20 +17,25 @@
|
||||
VERSION: '0.4.10',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</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>
|
||||
<link rel="top" title="Moto 0.4.10 documentation" href="index.html" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="prev" title="Moto: A Mock library for boto" href="index.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head>
|
||||
<body role="document">
|
||||
<body role="document">
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
@ -42,30 +47,30 @@
|
||||
<div class="section" id="installing-moto">
|
||||
<h2>Installing Moto<a class="headerlink" href="#installing-moto" title="Permalink to this headline">¶</a></h2>
|
||||
<p>You can use <code class="docutils literal"><span class="pre">pip</span></code> to install the latest released version of <code class="docutils literal"><span class="pre">moto</span></code>:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>pip install moto
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">moto</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>If you want to install <code class="docutils literal"><span class="pre">moto</span></code> from source:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>git clone git://github.com/spulec/moto.git
|
||||
cd moto
|
||||
python setup.py install
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">git</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">spulec</span><span class="o">/</span><span class="n">moto</span><span class="o">.</span><span class="n">git</span>
|
||||
<span class="n">cd</span> <span class="n">moto</span>
|
||||
<span class="n">python</span> <span class="n">setup</span><span class="o">.</span><span class="n">py</span> <span class="n">install</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="moto-usage">
|
||||
<h2>Moto usage<a class="headerlink" href="#moto-usage" title="Permalink to this headline">¶</a></h2>
|
||||
<p>For example we have the following code we want to test:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">boto</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">boto</span>
|
||||
<span class="kn">from</span> <span class="nn">boto.s3.key</span> <span class="kn">import</span> <span class="n">Key</span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">MyModel</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">name</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</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="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="n">conn</span> <span class="o">=</span> <span class="n">boto</span><span class="o">.</span><span class="n">connect_s3</span><span class="p">()</span>
|
||||
<span class="n">bucket</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">get_bucket</span><span class="p">(</span><span class="s">'mybucket'</span><span class="p">)</span>
|
||||
<span class="n">bucket</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">get_bucket</span><span class="p">(</span><span class="s1">'mybucket'</span><span class="p">)</span>
|
||||
<span class="n">k</span> <span class="o">=</span> <span class="n">Key</span><span class="p">(</span><span class="n">bucket</span><span class="p">)</span>
|
||||
<span class="n">k</span><span class="o">.</span><span class="n">key</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span>
|
||||
<span class="n">k</span><span class="o">.</span><span class="n">set_contents_from_string</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
|
||||
@ -75,52 +80,52 @@ python setup.py install
|
||||
<div class="section" id="decorator">
|
||||
<h3>Decorator<a class="headerlink" href="#decorator" title="Permalink to this headline">¶</a></h3>
|
||||
<p>With a decorator wrapping all the calls to S3 are automatically mocked out.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">boto</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">boto</span>
|
||||
<span class="kn">from</span> <span class="nn">moto</span> <span class="kn">import</span> <span class="n">mock_s3</span>
|
||||
<span class="kn">from</span> <span class="nn">mymodule</span> <span class="kn">import</span> <span class="n">MyModel</span>
|
||||
|
||||
<span class="nd">@mock_s3</span>
|
||||
<span class="k">def</span> <span class="nf">test_my_model_save</span><span class="p">():</span>
|
||||
<span class="n">conn</span> <span class="o">=</span> <span class="n">boto</span><span class="o">.</span><span class="n">connect_s3</span><span class="p">()</span>
|
||||
<span class="c"># We need to create the bucket since this is all in Moto's 'virtual' AWS account</span>
|
||||
<span class="n">conn</span><span class="o">.</span><span class="n">create_bucket</span><span class="p">(</span><span class="s">'mybucket'</span><span class="p">)</span>
|
||||
<span class="c1"># We need to create the bucket since this is all in Moto's 'virtual' AWS account</span>
|
||||
<span class="n">conn</span><span class="o">.</span><span class="n">create_bucket</span><span class="p">(</span><span class="s1">'mybucket'</span><span class="p">)</span>
|
||||
|
||||
<span class="n">model_instance</span> <span class="o">=</span> <span class="n">MyModel</span><span class="p">(</span><span class="s">'steve'</span><span class="p">,</span> <span class="s">'is awesome'</span><span class="p">)</span>
|
||||
<span class="n">model_instance</span> <span class="o">=</span> <span class="n">MyModel</span><span class="p">(</span><span class="s1">'steve'</span><span class="p">,</span> <span class="s1">'is awesome'</span><span class="p">)</span>
|
||||
<span class="n">model_instance</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
|
||||
|
||||
<span class="k">assert</span> <span class="n">conn</span><span class="o">.</span><span class="n">get_bucket</span><span class="p">(</span><span class="s">'mybucket'</span><span class="p">)</span><span class="o">.</span><span class="n">get_key</span><span class="p">(</span><span class="s">'steve'</span><span class="p">)</span><span class="o">.</span><span class="n">get_contents_as_string</span><span class="p">()</span> <span class="o">==</span> <span class="s">'is awesome'</span>
|
||||
<span class="k">assert</span> <span class="n">conn</span><span class="o">.</span><span class="n">get_bucket</span><span class="p">(</span><span class="s1">'mybucket'</span><span class="p">)</span><span class="o">.</span><span class="n">get_key</span><span class="p">(</span><span class="s1">'steve'</span><span class="p">)</span><span class="o">.</span><span class="n">get_contents_as_string</span><span class="p">()</span> <span class="o">==</span> <span class="s1">'is awesome'</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="context-manager">
|
||||
<h3>Context manager<a class="headerlink" href="#context-manager" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Same as decorator, every call inside <code class="docutils literal"><span class="pre">with</span></code> statement are mocked out.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">test_my_model_save</span><span class="p">():</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">test_my_model_save</span><span class="p">():</span>
|
||||
<span class="k">with</span> <span class="n">mock_s3</span><span class="p">():</span>
|
||||
<span class="n">conn</span> <span class="o">=</span> <span class="n">boto</span><span class="o">.</span><span class="n">connect_s3</span><span class="p">()</span>
|
||||
<span class="n">conn</span><span class="o">.</span><span class="n">create_bucket</span><span class="p">(</span><span class="s">'mybucket'</span><span class="p">)</span>
|
||||
<span class="n">conn</span><span class="o">.</span><span class="n">create_bucket</span><span class="p">(</span><span class="s1">'mybucket'</span><span class="p">)</span>
|
||||
|
||||
<span class="n">model_instance</span> <span class="o">=</span> <span class="n">MyModel</span><span class="p">(</span><span class="s">'steve'</span><span class="p">,</span> <span class="s">'is awesome'</span><span class="p">)</span>
|
||||
<span class="n">model_instance</span> <span class="o">=</span> <span class="n">MyModel</span><span class="p">(</span><span class="s1">'steve'</span><span class="p">,</span> <span class="s1">'is awesome'</span><span class="p">)</span>
|
||||
<span class="n">model_instance</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
|
||||
|
||||
<span class="k">assert</span> <span class="n">conn</span><span class="o">.</span><span class="n">get_bucket</span><span class="p">(</span><span class="s">'mybucket'</span><span class="p">)</span><span class="o">.</span><span class="n">get_key</span><span class="p">(</span><span class="s">'steve'</span><span class="p">)</span><span class="o">.</span><span class="n">get_contents_as_string</span><span class="p">()</span> <span class="o">==</span> <span class="s">'is awesome'</span>
|
||||
<span class="k">assert</span> <span class="n">conn</span><span class="o">.</span><span class="n">get_bucket</span><span class="p">(</span><span class="s1">'mybucket'</span><span class="p">)</span><span class="o">.</span><span class="n">get_key</span><span class="p">(</span><span class="s1">'steve'</span><span class="p">)</span><span class="o">.</span><span class="n">get_contents_as_string</span><span class="p">()</span> <span class="o">==</span> <span class="s1">'is awesome'</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="raw">
|
||||
<h3>Raw<a class="headerlink" href="#raw" title="Permalink to this headline">¶</a></h3>
|
||||
<p>You can also start and stop manually the mocking.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">test_my_model_save</span><span class="p">():</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">test_my_model_save</span><span class="p">():</span>
|
||||
<span class="n">mock</span> <span class="o">=</span> <span class="n">mock_s3</span><span class="p">()</span>
|
||||
<span class="n">mock</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
|
||||
|
||||
<span class="n">conn</span> <span class="o">=</span> <span class="n">boto</span><span class="o">.</span><span class="n">connect_s3</span><span class="p">()</span>
|
||||
<span class="n">conn</span><span class="o">.</span><span class="n">create_bucket</span><span class="p">(</span><span class="s">'mybucket'</span><span class="p">)</span>
|
||||
<span class="n">conn</span><span class="o">.</span><span class="n">create_bucket</span><span class="p">(</span><span class="s1">'mybucket'</span><span class="p">)</span>
|
||||
|
||||
<span class="n">model_instance</span> <span class="o">=</span> <span class="n">MyModel</span><span class="p">(</span><span class="s">'steve'</span><span class="p">,</span> <span class="s">'is awesome'</span><span class="p">)</span>
|
||||
<span class="n">model_instance</span> <span class="o">=</span> <span class="n">MyModel</span><span class="p">(</span><span class="s1">'steve'</span><span class="p">,</span> <span class="s1">'is awesome'</span><span class="p">)</span>
|
||||
<span class="n">model_instance</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
|
||||
|
||||
<span class="k">assert</span> <span class="n">conn</span><span class="o">.</span><span class="n">get_bucket</span><span class="p">(</span><span class="s">'mybucket'</span><span class="p">)</span><span class="o">.</span><span class="n">get_key</span><span class="p">(</span><span class="s">'steve'</span><span class="p">)</span><span class="o">.</span><span class="n">get_contents_as_string</span><span class="p">()</span> <span class="o">==</span> <span class="s">'is awesome'</span>
|
||||
<span class="k">assert</span> <span class="n">conn</span><span class="o">.</span><span class="n">get_bucket</span><span class="p">(</span><span class="s1">'mybucket'</span><span class="p">)</span><span class="o">.</span><span class="n">get_key</span><span class="p">(</span><span class="s1">'steve'</span><span class="p">)</span><span class="o">.</span><span class="n">get_contents_as_string</span><span class="p">()</span> <span class="o">==</span> <span class="s1">'is awesome'</span>
|
||||
|
||||
<span class="n">mock</span><span class="o">.</span><span class="n">stop</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
@ -129,8 +134,8 @@ python setup.py install
|
||||
<div class="section" id="stand-alone-server-mode">
|
||||
<h3>Stand-alone server mode<a class="headerlink" href="#stand-alone-server-mode" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Moto comes with a stand-alone server allowing you to mock out an AWS HTTP endpoint. It is very useful to test even if you don’t use Python.</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>moto_server ec2 -p3000
|
||||
* Running on http://0.0.0.0:3000/
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ moto_server ec2 -p3000
|
||||
* Running on http://127.0.0.1:3000/
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This method isn’t encouraged if you’re using <code class="docutils literal"><span class="pre">boto</span></code>, best is to use decorator method.</p>
|
||||
@ -169,21 +174,18 @@ python setup.py install
|
||||
<div role="note" aria-label="source link">
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="_sources/getting_started.txt"
|
||||
<li><a href="_sources/getting_started.rst.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" />
|
||||
<div><input type="text" name="q" /></div>
|
||||
<div><input type="submit" value="Go" /></div>
|
||||
<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>
|
||||
@ -194,11 +196,11 @@ python setup.py install
|
||||
©2015, Steve Pulec.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.5.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
||||
|
||||
|
|
||||
<a href="_sources/getting_started.txt"
|
||||
<a href="_sources/getting_started.rst.txt"
|
||||
rel="nofollow">Page source</a>
|
||||
</div>
|
||||
|
||||
|
40
docs/_build/html/index.html
vendored
@ -6,7 +6,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Moto: A Mock library for boto — Moto 0.4.10 documentation</title>
|
||||
<title>Moto: A Mock library for boto — Moto 0.4.10 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -17,20 +17,25 @@
|
||||
VERSION: '0.4.10',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</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>
|
||||
<link rel="top" title="Moto 0.4.10 documentation" href="#" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="Getting Started with Moto" href="getting_started.html" />
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
</head>
|
||||
<body role="document">
|
||||
<body role="document">
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
@ -44,14 +49,14 @@
|
||||
<div class="section" id="getting-started">
|
||||
<h2>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h2>
|
||||
<p>If you’ve never used <code class="docutils literal"><span class="pre">moto</span></code> before, you should read the
|
||||
<a class="reference internal" href="getting_started.html"><em>Getting Started with Moto</em></a> guide to get familiar
|
||||
<a class="reference internal" href="getting_started.html"><span class="doc">Getting Started with Moto</span></a> guide to get familiar
|
||||
with <code class="docutils literal"><span class="pre">moto</span></code> & its usage.</p>
|
||||
</div>
|
||||
<div class="section" id="currently-implemented-services">
|
||||
<h2>Currently implemented Services<a class="headerlink" href="#currently-implemented-services" title="Permalink to this headline">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><strong>Compute</strong><ul>
|
||||
<li><a class="reference internal" href="ec2_tut.html"><em>Elastic Compute Cloud</em></a></li>
|
||||
<li><a class="reference internal" href="ec2_tut.html"><span class="doc">Elastic Compute Cloud</span></a></li>
|
||||
<li>AMI</li>
|
||||
<li>EBS</li>
|
||||
<li>Instances</li>
|
||||
@ -109,9 +114,9 @@ with <code class="docutils literal"><span class="pre">moto</span></code> & i
|
||||
<div class="section" id="indices-and-tables">
|
||||
<h3>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h3>
|
||||
<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>
|
||||
<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
|
||||
<li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
|
||||
<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
|
||||
</ul>
|
||||
<div class="toctree-wrapper compound">
|
||||
</div>
|
||||
@ -148,21 +153,18 @@ with <code class="docutils literal"><span class="pre">moto</span></code> & i
|
||||
<div role="note" aria-label="source link">
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="_sources/index.txt"
|
||||
<li><a href="_sources/index.rst.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" />
|
||||
<div><input type="text" name="q" /></div>
|
||||
<div><input type="submit" value="Go" /></div>
|
||||
<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>
|
||||
@ -173,11 +175,11 @@ with <code class="docutils literal"><span class="pre">moto</span></code> & i
|
||||
©2015, Steve Pulec.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.5.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
||||
|
||||
|
|
||||
<a href="_sources/index.txt"
|
||||
<a href="_sources/index.rst.txt"
|
||||
rel="nofollow">Page source</a>
|
||||
</div>
|
||||
|
||||
|
7
docs/_build/html/objects.inv
vendored
@ -2,7 +2,6 @@
|
||||
# Project: Moto
|
||||
# Version: 0.4.10
|
||||
# The remainder of this file is compressed using zlib.
|
||||
xÚm<EFBFBD>Í
|
||||
Â0„ïyнF°ÇÞD<x(âYò³¶¥i#I
|
||||
öíMM
|
||||
zÚÝ™ogHÏ0ø K#$ð#(‰‡&ôf>O¨l°—s)TGƒf5
í 鳎XÔ”<C394>ë¼³
îÚÿâKœâTL+<2B>p^ÖAFƒõVo¼'¾¹«²z4”+= §šõKÒ2}OÀMÔľŽ,\
|
||||
x<EFBFBD>…<EFBFBD>Kֲ0„ןz`<60>½‰ˆx„ג¹ה±¶¥i"ֹם¿·5} xJ2;<3B>לE”RMאHֶׂ·€^<5E>הT)¸:„³!ֱּag¢D-<03>p<EFBFBD>qTKrױ>ֲ־ס+!C]h‰ֿyִ תם§מ<C2A7>:‰
|
||||
<EFBFBD>¥<EFBFBD>˜%”׃®‹‘§<E28098>^„₪ק?
|
||||
ֺ<EFBFBD>‚qaֿOvu†vם)JP·ּ6p3ר<><D7A8>T<1D>ױת]ש%א<>„ֳ`¨ k…¯2+ע9ב5oN<6F><4E>ֲ2^ ׳<C2A0>¨
|
19
docs/_build/html/search.html
vendored
@ -6,7 +6,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Search — Moto 0.4.10 documentation</title>
|
||||
<title>Search — Moto 0.4.10 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -17,14 +17,16 @@
|
||||
VERSION: '0.4.10',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</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="_static/searchtools.js"></script>
|
||||
<link rel="top" title="Moto 0.4.10 documentation" href="index.html" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="#" />
|
||||
<script type="text/javascript">
|
||||
jQuery(function() { Search.loadIndex("searchindex.js"); });
|
||||
</script>
|
||||
@ -32,12 +34,15 @@
|
||||
<script type="text/javascript" id="searchindexloader"></script>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||||
|
||||
|
||||
</head>
|
||||
<body role="document">
|
||||
<body role="document">
|
||||
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
@ -87,8 +92,8 @@
|
||||
©2015, Steve Pulec.
|
||||
|
||||
|
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.6</a>
|
||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.5.3</a>
|
||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
2
docs/_build/html/searchindex.js
vendored
@ -1 +1 @@
|
||||
Search.setIndex({envversion:47,filenames:["ec2_tut","getting_started","index"],objects:{},objnames:{},objtypes:{},terms:{"27t05":0,"57z":0,"91dd2f32":0,"__init__":1,"_in_monitoring_el":0,"_placement":0,"_previous_st":0,"_state":0,"class":1,"import":[0,1],"static":0,"true":0,"var":0,access:2,account:1,administr:2,after:0,all:[0,1],allow:[1,2],alreadi:0,also:1,amazonaw:0,ami:[0,2],ami_launch_index:0,analyt:2,applic:2,architectur:0,assert:1,assum:0,attribut:0,auto:2,automat:1,awesom:1,base:2,befor:[0,2],behavior:0,best:1,blank:1,block_device_map:0,bucket:1,call:1,can:1,client_token:0,clone:1,cloud:2,cloudform:2,cloudwatch:2,code:[0,1],com:[0,1],come:1,comput:[0,2],conn:[0,1],connect:0,connect_s3:1,connect_to_region:0,content:2,creat:1,create_bucket:1,databas:2,def:1,deliveri:2,deploy:2,dns_name:0,don:1,download:0,dynamodb:2,easili:2,ebs_optim:0,ec2:[],ec2connect:0,ed65f870:0,elast:2,emr:2,enabl:0,encourag:1,endpoint:1,eni:0,environ:1,even:1,eventsset:0,everi:1,exampl:[0,1],explain:0,f00ba4:0,fals:0,familiar:2,featur:0,follow:[0,1],from:1,full:1,gener:0,get_bucket:1,get_contents_as_str:1,get_kei:1,git:1,github:1,glacier:2,group:[0,2],group_nam:0,guid:2,have:[0,1],how:0,http:1,hypervisor:0,ident:2,image_id:0,index:2,infrastructur:2,insid:1,instanc:[],instance_profil:0,instance_typ:0,interfac:0,intern:0,ip_address:0,isn:1,issu:2,item:0,just:1,keep:1,kei:1,kernel:0,key_nam:0,kinesi:2,latest:1,launch_tim:0,manag:[],manual:1,method:1,mind:1,mobil:2,mock_ec2:0,mock_s3:1,model_inst:1,modul:2,monitor:0,monitoring_st:0,moto_serv:1,mybucket:1,mymodel:1,mymodul:1,name:1,need:1,network:2,networkinterfac:0,never:2,none:0,object:[0,1],out:[1,2],p3000:1,page:2,paravirtu:0,pend:0,persist:0,pip:1,platform:0,previous:0,private_dns_nam:0,private_ip_address:0,product_cod:0,public_dns_nam:0,python:1,ramdisk:0,random:0,read:2,reason:0,redshift:2,region:0,regioninfo:0,releas:1,repositori:2,requester_id:0,reserv:0,root_device_nam:0,root_device_typ:0,route53:2,run:1,run_inst:0,same:[0,1],save:1,scale:2,search:2,secur:2,self:1,set:0,set_contents_from_str:1,setup:1,sever:1,should:2,sinc:1,small:0,snippet:0,sourc:[1,2],sourcedestcheck:0,spot_instance_request_id:0,spulec:1,state_reason:0,statement:1,steve:1,stop:1,storag:2,subnet_id:0,tag:[0,2],test:[1,2],test_my_model_sav:1,than:0,thi:[0,1],tracker:2,tutori:0,usag:[],valu:1,veri:1,version:1,virtual:1,virtualization_typ:0,vpc_id:0,want:1,west:0,wrap:1,x86_64:0,xen:0,you:[0,1,2]},titles:["Use Moto as EC2 backend","Getting Started with Moto","Moto: A Mock library for boto"],titleterms:{addit:2,alon:1,backend:0,boto:2,context:1,current:2,decor:1,ec2:0,get:[1,2],implement:2,indic:2,instal:1,instanc:0,launch:0,librari:2,manag:1,mock:2,mode:1,moto:[0,1,2],raw:1,resourc:2,server:1,servic:2,stand:1,start:[1,2],tabl:2,usag:1}})
|
||||
Search.setIndex({docnames:["ec2_tut","getting_started","index"],envversion:50,filenames:["ec2_tut.rst","getting_started.rst","index.rst"],objects:{},objnames:{},objtypes:{},terms:{"27t05":0,"57z":0,"91dd2f32":0,"class":1,"import":[0,1],"static":0,"true":0,"var":0,AWS:[1,2],EBS:2,For:1,RDS:2,SES:2,SNS:2,SQS:2,There:1,With:1,__init__:1,_in_monitoring_el:0,_placement:0,_previous_st:0,_state:0,access:2,account:1,administr:2,after:0,all:[0,1],allow:[1,2],alreadi:0,also:1,amazonaw:0,ami:[0,2],ami_launch_index:0,analyt:2,applic:2,architectur:0,assert:1,assum:0,attribut:0,auto:2,automat:1,awesom:1,base:2,befor:[0,2],behavior:0,best:1,blank:1,block_device_map:0,boto:[0,1],bucket:1,call:1,can:1,client_token:0,clone:1,cloud:2,cloudform:2,cloudwatch:2,code:[0,1],com:[0,1],come:1,comput:[0,2],conn:[0,1],connect:0,connect_s3:1,connect_to_region:0,content:2,creat:1,create_bucket:1,databas:2,def:1,deliveri:2,deploy:2,dns_name:0,don:1,download:0,dynamodb:2,easili:2,ebs_optim:0,ec2:1,ec2connect:0,ed65f870:0,elast:2,emr:2,enabl:0,encourag:1,endpoint:1,eni:0,environ:1,even:1,eventsset:0,everi:1,exampl:[0,1],explain:0,f00ba4:0,fals:0,familiar:2,featur:0,follow:[0,1],from:1,full:1,gener:0,get_bucket:1,get_contents_as_str:1,get_kei:1,git:1,github:1,glacier:2,group:[0,2],group_nam:0,guid:2,have:[0,1],how:0,http:1,hypervisor:0,ident:2,image_id:0,index:2,infrastructur:2,insid:1,instal:0,instanc:2,instance_profil:0,instance_typ:0,interfac:0,intern:0,ip_address:0,isn:1,issu:2,item:0,its:2,just:1,keep:1,kei:1,kernel:0,key_nam:0,kinesi:2,latest:1,launch_tim:0,manag:2,manual:1,method:1,mind:1,mobil:2,mock:[0,1],mock_ec2:0,mock_s3:1,model_inst:1,modul:2,monitor:0,monitoring_st:0,moto_serv:1,mybucket:1,mymodel:1,mymodul:1,name:1,need:1,network:2,networkinterfac:0,never:2,none:0,object:[0,1],out:[1,2],p3000:1,page:2,paravirtu:0,pend:0,persist:0,pip:1,platform:0,previous:0,private_dns_nam:0,private_ip_address:0,product_cod:0,public_dns_nam:0,python:1,ramdisk:0,random:0,read:2,reason:0,redshift:2,region:0,regioninfo:0,releas:1,repositori:2,requester_id:0,reserv:0,root_device_nam:0,root_device_typ:0,route53:2,run:1,run_inst:0,same:[0,1],save:1,scale:2,search:2,secur:2,self:1,set:0,set_contents_from_str:1,setup:1,sever:1,should:2,sinc:1,small:0,snippet:0,sourc:[1,2],sourcedestcheck:0,spot_instance_request_id:0,spulec:1,start:0,state_reason:0,statement:1,steve:1,stop:1,storag:2,subnet_id:0,tag:[0,2],test:[1,2],test_my_model_sav:1,than:0,thi:[0,1],tracker:2,tutori:0,usag:2,use:[0,1],used:2,useful:1,using:1,valu:1,veri:1,version:1,virtual:1,virtualization_typ:0,vpc_id:0,want:1,west:0,wrap:1,x86_64:0,xen:0,you:[0,1,2]},titles:["Use Moto as EC2 backend","Getting Started with Moto","Moto: A Mock library for boto"],titleterms:{Use:0,addit:2,alon:1,backend:0,boto:2,context:1,current:2,decor:1,ec2:0,get:[1,2],implement:2,indic:2,instal:1,instanc:0,launch:0,librari:2,manag:1,mock:2,mode:1,moto:[0,1,2],raw:1,resourc:2,server:1,servic:2,stand:1,start:[1,2],tabl:2,usag:1}})
|