sphinx build 2011-11-19 01:36:39+02:00

This commit is contained in:
Petr Viktorin 2011-11-19 01:36:39 +02:00
commit dcf525dcd2
28 changed files with 14197 additions and 0 deletions

4
.buildinfo Normal file
View file

@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 20fbb3c1f25faf227aa89dc7ec78651b
tags: fbb0d17656682115ca4d033fb2f83ba1

0
.nojekyll Normal file
View file

25
_sources/index.txt Normal file
View file

@ -0,0 +1,25 @@
.. pokedex documentation master file, created by
sphinx-quickstart on Tue Apr 12 17:43:05 2011.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
The pokedex documentation
=========================
Jump right in!
Contents:
.. toctree::
:maxdepth: 2
installing
usage
schema
Indices and tables
==================
* :ref:`genindex`
* :ref:`search`

157
_sources/installing.txt Normal file
View file

@ -0,0 +1,157 @@
Installing the pokedex library
==============================
Quick startup with Ubuntu/Debian-like systems
---------------------------------------------
Run the following from an empty directory::
$ sudo apt-get install git python python-pip python-sqlalchemy
$ git clone git://git.veekun.com/pokedex.git
$ pip install -E env -e pokedex
$ source env/bin/activate
(env)$ pokedex setup -v
(env)$ pokedex lookup eevee
If it all goes smoothly, you can now use ``env/bin/pokedex``, the command-line
tool, and ``env/bin/python``, a Python interpreter configured to use the
pokedex library.
That is all you need. Feel free to skip the rest of this chapter if you're not
interested in the details.
Prerequisites
-------------
Linux
^^^^^
Ubuntu/Debian users should run the following::
$ sudo apt-get install git python python-pip
With other Linuxes, install the packages for git, python (2.6 or 2.7,
*not* 3.x), and python-pip.
If you succeeded, skip the Detailed instructions.
Detailed instructions
^^^^^^^^^^^^^^^^^^^^^
You should know what a command line is and how to work with it.
The here we assume you're using Linux [#]_, if that's not the case, make
sure you have enough computer knowledge to translate the instructions to your
operating system.
Pokedex is distributed via Git_. So, get Git.
You will also need Python_ 2; the language pokedex is written in. Be sure to get
version **2.6** or **2.7**. Pokedex does not work with Python 3.x yet, and it
most likely won't work with 2.5 or earlier.
Next, get pip_, a tool to install Python packages. Experts can use another
tool, of course.
Make sure git and pip are on your path.
Optionally you can install SQLAlchemy_, `Python markdown`_, Whoosh_,
or construct_. If you don't, pip will atuomatically download and install a copy
for you, but some are pretty big so you might want to install it system-wide.
(Unfortunately, many distros have outdated versions of these libraries, so pip
will install pokedex's own copy anyway.)
Getting and installing pokedex
------------------------------
Run the following from an empty directory::
$ git clone git://git.veekun.com/pokedex.git
$ pip install -E env -e pokedex
This will give you two directories: pokedex (containing the source code and
data), and env (a virtualenv_).
In env/bin, there are three interesting files:
* pokedex: The pokedex program
* python: A copy of Python that knows about pokedex and its prerequisites.
Using the system python won't work.
* activate: Typing ``source env/bin/activate`` in a shell will put
pokedex and our bin/python on the $PATH, and generally set things up to work
with them. Your prompt will change to let you know of this. You can end such
a session by typing ``deactivate``.
This documentation will assume that you've activated the virtualenv, so
``pokedex`` means ``env/bin/pokedex``.
Advanced
^^^^^^^^
You can of course install into an existing virtualenv, by either using its pip
and leaving out the ``-E env``, or running the setup script directly::
(anotherenv)$ cd pokedex
(anotherenv)pokedex$ python setup.py develop
It is also possible to install pokedex system-wide. There are problems with
that. Don't do it. The only time you need ``sudo`` is for getting the
prerequisites.
Loading the database
--------------------
Before you can do anything useful with pokedex, you need to load the database::
$ pokedex setup -v
This will load the data into a default SQLite database and create a default
Whoosh index.
Advanced
^^^^^^^^
If you want to use another database, make sure you have the corresponding
`SQLAlchemy engine`_ for it and either use the ``-e`` switch, (e.g.
``-e postgresql://@/pokedex``), or set the ``POKEDEX_DB_ENGINE`` environment
variable.
To use another lookup index directory, specify it with ``-i`` or the
``POKEDEX_INDEX_DIR`` variable.
Make sure you always use the same options whenever you use pokedex.
If you're confused about what pokedex thinks its settings are, check
``pokedex status``.
See ``pokedex help`` for even more options.
All done
--------
To verify that all went smoothly, check that the pokedex tool finds your
favorite pokémon::
$ pokedex lookup eevee
Yes, that was a bit anti-climatic. The command-line tool doesn't do much,
currently.
.. _Git: http://git-scm.com/
.. _Python: http://www.python.org/
.. _pip: http://pypi.python.org/pypi/pip
.. _SQLAlchemy: www.sqlalchemy.org/
.. _`Python markdown`: http://www.freewisdom.org/projects/python-markdown/
.. _Whoosh: http://whoosh.ca/
.. _construct: pypi.python.org/pypi/construct
.. _virtualenv: http://www.virtualenv.org/en/latest/
.. _`SQLAlchemy engine`: http://www.sqlalchemy.org/docs/core/engines.html
.. rubric:: Footnotes
.. [#] If you write instructions for another OS, well be happy to include them
here. The reason your OS is not listed here is because the author doesn't
use it, so naturally he can't write instructions for it.

172
_sources/main-tables.txt Normal file
View file

@ -0,0 +1,172 @@
The pokédex tables
==================
.. module:: pokedex.db.tables
All the tables listed here are classes defined with SQLAlchemy's
:mod:`~sqlalchemy.ext.declarative` extension.
.. data:: metadata
The SQLAlchemy :class:`~sqlalchemy.schema.MetaData` containing all the
tables.
.. data:: mapped_classes
A list of all the classes you see below.
Each of these classes has a ``translation_classes`` attribute: a potentially
empty list of translation classes. See :mod:`pokedex.db.multilang` for how
these work.
Many tables have these columns:
- **id**: An integer primary key. Sometimes it's semantically meaningful, most
often it isn't.
- **identifier**: A string identifier of the class, and the preferred way to
access individual items.
- **name**: A name (uses the multilang functionality)
Pokémon
-------
.. dex-table:: PokemonSpecies
.. dex-table:: Pokemon
.. dex-table:: PokemonForm
.. dex-table:: EvolutionChain
.. dex-table:: PokemonEvolution
Moves
-----
.. dex-table:: Move
.. dex-table:: MoveEffect
.. dex-table:: MoveMeta
.. dex-table:: MoveVersion
Items
-----
.. dex-table:: Item
.. dex-table:: Berry
Types
-----
.. dex-table:: Type
Abilities
---------
.. dex-table:: Ability
Language
--------
.. dex-table:: Language
Version stuff
-------------
.. dex-table:: Generation
.. dex-table:: VersionGroup
.. dex-table:: Version
.. dex-table:: Pokedex
.. dex-table:: Region
Encounters
----------
.. dex-table:: Location
.. dex-table:: LocationArea
.. dex-table:: LocationAreaEncounterRate
.. dex-table:: Encounter
.. dex-table:: EncounterCondition
.. dex-table:: EncounterConditionValue
.. dex-table:: EncounterMethod
.. dex-table:: EncounterSlot
Contests
--------
.. dex-table:: ContestCombo
.. dex-table:: ContestEffect
.. dex-table:: SuperContestCombo
.. dex-table:: SuperContestEffect
Enum tables
-----------
.. dex-table:: BerryFirmness
.. dex-table:: ContestType
.. dex-table:: EggGroup
.. dex-table:: EvolutionTrigger
.. dex-table:: GrowthRate
.. dex-table:: ItemCategory
.. dex-table:: ItemFlag
.. dex-table:: ItemFlingEffect
.. dex-table:: ItemPocket
.. dex-table:: MoveBattleStyle
.. dex-table:: MoveDamageClass
.. dex-table:: MoveMetaAilment
.. dex-table:: MoveMetaCategory
.. dex-table:: MoveTarget
.. dex-table:: Nature
.. dex-table:: PokemonColor
.. dex-table:: PokemonMoveMethod
.. dex-table:: PokemonShape
.. dex-table:: Stat
Changelogs
----------
.. dex-table:: AbilityChangelog
.. dex-table:: MoveEffectChangelog
Flavor text
-----------
.. dex-table:: ItemFlavorText
.. dex-table:: AbilityFlavorText
.. dex-table:: MoveFlavorText
.. dex-table:: PokemonSpeciesFlavorText
Association tables
------------------
.. dex-table:: BerryFlavor
.. dex-table:: EncounterConditionValueMap
.. dex-table:: ItemFlagMap
.. dex-table:: Machine
.. dex-table:: MoveFlag
.. dex-table:: MoveFlagMap
.. dex-table:: MoveMetaStatChange
.. dex-table:: NatureBattleStylePreference
.. dex-table:: NaturePokeathlonStat
.. dex-table:: PokeathlonStat
.. dex-table:: PokemonAbility
.. dex-table:: PokemonEggGroup
.. dex-table:: PokemonFormPokeathlonStat
.. dex-table:: PokemonHabitat
.. dex-table:: PokemonMove
.. dex-table:: PokemonStat
.. dex-table:: PokemonItem
.. dex-table:: PokemonType
.. dex-table:: TypeEfficacy
.. dex-table:: VersionGroupRegion
Index maps
----------
.. dex-table:: ItemGameIndex
.. dex-table:: LocationGameIndex
.. dex-table:: PokemonDexNumber
.. dex-table:: PokemonGameIndex
Mics tables
-----------
.. dex-table:: Experience
.. dex-table:: StatHint

8
_sources/schema.txt Normal file
View file

@ -0,0 +1,8 @@
The database schema
===================
.. toctree::
main-tables
enumerations
associations

275
_sources/usage.txt Normal file
View file

@ -0,0 +1,275 @@
Using pokedex
=============
The pokédex is, first and foremost, a Python library. To get the most of it,
you'll need to learn `Python`_ and `SQLAlchemy`_.
Here is a small example of using pokedex:
.. testcode::
from pokedex.db import connect, tables, util
session = connect()
pokemon = util.get(session, tables.PokemonSpecies, 'bulbasaur')
print u'{0.name}, the {0.genus} Pokemon'.format(pokemon)
Running this will give you some Bulbasaur info:
.. testoutput::
Bulbasaur, the Seed Pokemon
Connecting
----------
To get information out of the Pokédex, you will need to create a
:class:`Session <pokedex.db.multilang.MultilangSession>`. To do that, use
:func:`pokedex.db.connect`. For simple uses, you don't need to give it any
arguments: it the database that ``pokedex load`` fills up by default. If you
need to select another database, give its URI as the first argument.
The object :func:`~pokedex.db.connect` gives you is actually a
:class:`SQLAlchemy session <sqlalchemy.orm.session.Session>`, giving you the
full power of SQLAlchemy for working with the data. We'll cover some basics
here, but if you intend to do some serious work, do read SQLAlchemy's docs.
XXX: write the rest of this
..::
Pokédex tables
--------------
Data in the pokédex is organized in tables, defined in
:mod:`pokedex.db.tables`.
There is quite a few or them. To get you started, here are a few common ones:
* :class:`~pokedex.db.tables.Pokemon` (includes some alternate forms)
* :class:`~pokedex.db.tables.Move`
* :class:`~pokedex.db.tables.Item`
* :class:`~pokedex.db.tables.Type`
Getting things
--------------
If you know what you want from the pokédex, you can use the
:func:`pokedex.db.util.get` function. It looks up a thing in a table, based on
its identifier, name, or ID, and returns it.
.. testcode::
def print_pokemon(pokemon):
print u'{0.name}, the {0.genus} Pokemon'.format(pokemon)
print_pokemon(util.get(session, tables.PokemonSpecies, identifier='eevee'))
print_pokemon(util.get(session, tables.PokemonSpecies, name=u'Ho-Oh'))
print_pokemon(util.get(session, tables.PokemonSpecies, id=50))
def print_item(item):
print u'{0.name}: ${0.cost}'.format(item)
print_item(util.get(session, tables.Item, identifier='great-ball'))
print_item(util.get(session, tables.Item, name='Potion'))
print_item(util.get(session, tables.Item, id=30))
.. testoutput::
Eevee, the Evolution Pokemon
Ho-Oh, the Rainbow Pokemon
Diglett, the Mole Pokemon
Great Ball: $600
Potion: $300
Fresh Water: $200
.. :
Simple lists
------------
.. note::
These functions are only included for convenience in experiments and simple
scripts.
If you want to do something specific, please query the pokédex as explained
in the following sections.
If you want to get a simple list of pokémon without needing to worry about
things like the different forms and sorting the list, you can use the
:func:`pokedex.util.simple.pokemon` function.
.. testcode::
from pokedex.util import simple
for pokemon in simple.pokemon(session):
print u'{0.name}, the {0.species} Pokemon'.format(pokemon)
.. testoutput::
Bulbasaur, the Seed Pokemon
Ivysaur, the Seed Pokemon
...
Meloetta, the Melody Pokemon
Genesect, the Paleozoic Pokemon
Similar functions exist for :func:`~pokedex.util.simple.moves`,
:func:`~pokedex.util.simple.items` and :func:`~pokedex.util.simple.types`.
All of these give you quick simple lists, basically something a pokédex would
show you. They filter out things you probably won't need (such as Shadow moves
or duplicate Pokémon moves), and sort the results in some sane way, but they
can't guess your needs exactly, and their guesses might change in future
versions.
If you want to do some serious work with the pokédex, read on.
Querying
--------
So, how do you get data from the session? You use the session's
:meth:`~sqlalchemy.orm.session.Session.query` method, and give it a pokédex
Table as an argument. This will give you a :class:`SQLAlchemy query
<sqlalchemy.orm.query.Query>`.
To get you started, we'll cover some common query operations below. If you
need to do more, consult the `SQLAlchemy documentation`_.
Ordering
^^^^^^^^
As always with SQL, you should not rely on query results being in some
particular order unless you have ordered the query first. This means that
you'll likely want to sort every query you will make.
For example, you can get a list of all pokémon, sorted by their
:attr:`~pokedex.db.tables.Pokemon.order`, like so:
.. testcode::
for pokemon in session.query(tables.Pokemon).order_by(tables.Pokemon.order):
print pokemon.name
.. testoutput::
Bulbasaur
Ivysaur
Venusaur
Charmander
Charmeleon
...
Pichu
Pikachu
Raichu
...
Keldeo
Aria Meloetta
Pirouette Meloetta
Genesect
Ordering by name
****************
Since the pokédex can be used in other languages than English, working with
texts such as names is sometimes tricky.
The “name” attribute is actually a relation that uses the connection's
default language to select an appropriate translation. It usually works the
same way as a normal attribute, but ordering is an exception to this:
.. testcode::
for pokemon in session.query(tables.Pokemon).order_by(tables.Pokemon.name):
print pokemon.name
.. testoutput::
Traceback (most recent call last):
...
ArgumentError: SQL expression object or string expected.
This means that to order by name, you either have to explicitly join the
translation table and sort by that, or use
:func:`pokedex.db.util.order_by_name`:
.. testcode::
from pokedex.db import util
for pokemon in util.order_by_name(session.query(tables.Pokemon), tables.Pokemon):
print pokemon.name
.. testoutput::
Abomasnow
...
Zweilous
Filtering
^^^^^^^^^
Another major operation on queries is filtering, using the query's
:meth:`~sqlalchemy.orm.query.Query.filter` or
:meth:`~sqlalchemy.orm.query.Query.filter_by` methods:
.. testcode::
for move in session.query(tables.Move).filter(tables.Move.power > 200):
print move.name
.. testoutput::
Explosion
Joining
^^^^^^^
The final operation we'll cover here is joining other tables to the query,
using the query's :meth:`~sqlalchemy.orm.query.Query.join`.
You will usually want to join on a relationship, such as in the following
example:
.. testcode::
query = session.query(tables.Move)
query = query.join(tables.Move.type)
query = query.filter(tables.Type.identifier == 'grass')
query = query.filter(tables.Move.power >= 100)
query = query.order_by(tables.Move.power)
query = util.order_by_name(query, tables.Move)
print 'The most powerful Grass moves:'
for move in query:
print u'{0.name} ({0.power})'.format(move)
.. testoutput::
The most powerful Grass moves:
Petal Dance (120)
Power Whip (120)
Seed Flare (120)
SolarBeam (120)
Wood Hammer (120)
Leaf Storm (140)
Frenzy Plant (150)
API documentation
-----------------
.. autofunction:: pokedex.db.connect
See :class:`sqlalchemy.orm.session.Session` for more documentation on the
returned object.
.. autofunction:: pokedex.db.util.get
.. autofunction:: pokedex.db.util.order_by_name
Simple lists
^^^^^^^^^^^^
.. autofunction:: pokedex.util.simple.pokemon
.. autofunction:: pokedex.util.simple.moves
.. autofunction:: pokedex.util.simple.items
.. autofunction:: pokedex.util.simple.types
.. _Python: http://www.python.org
.. _SQLAlchemy: http://www.sqlalchemy.org
.. _`SQLAlchemy documentation`: http://www.sqlalchemy.org/docs/orm/tutorial.html

509
_static/basic.css Normal file
View file

@ -0,0 +1,509 @@
/*
* basic.css
* ~~~~~~~~~
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/* -- main layout ----------------------------------------------------------- */
div.clearer {
clear: both;
}
/* -- relbar ---------------------------------------------------------------- */
div.related {
width: 100%;
font-size: 90%;
}
div.related h3 {
display: none;
}
div.related ul {
margin: 0;
padding: 0 0 0 10px;
list-style: none;
}
div.related li {
display: inline;
}
div.related li.right {
float: right;
margin-right: 5px;
}
/* -- sidebar --------------------------------------------------------------- */
div.sphinxsidebarwrapper {
padding: 10px 5px 0 10px;
}
div.sphinxsidebar {
float: left;
width: 230px;
margin-left: -100%;
font-size: 90%;
}
div.sphinxsidebar ul {
list-style: none;
}
div.sphinxsidebar ul ul,
div.sphinxsidebar ul.want-points {
margin-left: 20px;
list-style: square;
}
div.sphinxsidebar ul ul {
margin-top: 0;
margin-bottom: 0;
}
div.sphinxsidebar form {
margin-top: 10px;
}
div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}
img {
border: 0;
}
/* -- search page ----------------------------------------------------------- */
ul.search {
margin: 10px 0 0 20px;
padding: 0;
}
ul.search li {
padding: 5px 0 5px 20px;
background-image: url(file.png);
background-repeat: no-repeat;
background-position: 0 7px;
}
ul.search li a {
font-weight: bold;
}
ul.search li div.context {
color: #888;
margin: 2px 0 0 30px;
text-align: left;
}
ul.keywordmatches li.goodmatch a {
font-weight: bold;
}
/* -- index page ------------------------------------------------------------ */
table.contentstable {
width: 90%;
}
table.contentstable p.biglink {
line-height: 150%;
}
a.biglink {
font-size: 1.3em;
}
span.linkdescr {
font-style: italic;
padding-top: 5px;
font-size: 90%;
}
/* -- general index --------------------------------------------------------- */
table.indextable {
width: 100%;
}
table.indextable td {
text-align: left;
vertical-align: top;
}
table.indextable dl, table.indextable dd {
margin-top: 0;
margin-bottom: 0;
}
table.indextable tr.pcap {
height: 10px;
}
table.indextable tr.cap {
margin-top: 10px;
background-color: #f2f2f2;
}
img.toggler {
margin-right: 3px;
margin-top: 3px;
cursor: pointer;
}
div.modindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}
div.genindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}
/* -- general body styles --------------------------------------------------- */
a.headerlink {
visibility: hidden;
}
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink {
visibility: visible;
}
div.body p.caption {
text-align: inherit;
}
div.body td {
text-align: left;
}
.field-list ul {
padding-left: 1em;
}
.first {
margin-top: 0 !important;
}
p.rubric {
margin-top: 30px;
font-weight: bold;
}
.align-left {
text-align: left;
}
.align-center {
clear: both;
text-align: center;
}
.align-right {
text-align: right;
}
/* -- sidebars -------------------------------------------------------------- */
div.sidebar {
margin: 0 0 0.5em 1em;
border: 1px solid #ddb;
padding: 7px 7px 0 7px;
background-color: #ffe;
width: 40%;
float: right;
}
p.sidebar-title {
font-weight: bold;
}
/* -- topics ---------------------------------------------------------------- */
div.topic {
border: 1px solid #ccc;
padding: 7px 7px 0 7px;
margin: 10px 0 10px 0;
}
p.topic-title {
font-size: 1.1em;
font-weight: bold;
margin-top: 10px;
}
/* -- admonitions ----------------------------------------------------------- */
div.admonition {
margin-top: 10px;
margin-bottom: 10px;
padding: 7px;
}
div.admonition dt {
font-weight: bold;
}
div.admonition dl {
margin-bottom: 0;
}
p.admonition-title {
margin: 0px 10px 5px 0px;
font-weight: bold;
}
div.body p.centered {
text-align: center;
margin-top: 25px;
}
/* -- tables ---------------------------------------------------------------- */
table.docutils {
border: 0;
border-collapse: collapse;
}
table.docutils td, table.docutils th {
padding: 1px 8px 1px 5px;
border-top: 0;
border-left: 0;
border-right: 0;
border-bottom: 1px solid #aaa;
}
table.field-list td, table.field-list th {
border: 0 !important;
}
table.footnote td, table.footnote th {
border: 0 !important;
}
th {
text-align: left;
padding-right: 5px;
}
table.citation {
border-left: solid 1px gray;
margin-left: 1px;
}
table.citation td {
border-bottom: none;
}
/* -- other body styles ----------------------------------------------------- */
ol.arabic {
list-style: decimal;
}
ol.loweralpha {
list-style: lower-alpha;
}
ol.upperalpha {
list-style: upper-alpha;
}
ol.lowerroman {
list-style: lower-roman;
}
ol.upperroman {
list-style: upper-roman;
}
dl {
margin-bottom: 15px;
}
dd p {
margin-top: 0px;
}
dd ul, dd table {
margin-bottom: 10px;
}
dd {
margin-top: 3px;
margin-bottom: 10px;
margin-left: 30px;
}
dt:target, .highlighted {
background-color: #fbe54e;
}
dl.glossary dt {
font-weight: bold;
font-size: 1.1em;
}
.field-list ul {
margin: 0;
padding-left: 1em;
}
.field-list p {
margin: 0;
}
.refcount {
color: #060;
}
.optional {
font-size: 1.3em;
}
.versionmodified {
font-style: italic;
}
.system-message {
background-color: #fda;
padding: 5px;
border: 3px solid red;
}
.footnote:target {
background-color: #ffa
}
.line-block {
display: block;
margin-top: 1em;
margin-bottom: 1em;
}
.line-block .line-block {
margin-top: 0;
margin-bottom: 0;
margin-left: 1.5em;
}
.guilabel, .menuselection {
font-family: sans-serif;
}
.accelerator {
text-decoration: underline;
}
.classifier {
font-style: oblique;
}
/* -- code displays --------------------------------------------------------- */
pre {
overflow: auto;
}
td.linenos pre {
padding: 5px 0px;
border: 0;
background-color: transparent;
color: #aaa;
}
table.highlighttable {
margin-left: 0.5em;
}
table.highlighttable td {
padding: 0 0.5em 0 0.5em;
}
tt.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
tt.descclassname {
background-color: transparent;
}
tt.xref, a tt {
background-color: transparent;
font-weight: bold;
}
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
background-color: transparent;
}
.viewcode-link {
float: right;
}
.viewcode-back {
float: right;
font-family: sans-serif;
}
div.viewcode-block:target {
margin: -1px -10px;
padding: 0 10px;
}
/* -- math display ---------------------------------------------------------- */
img.math {
vertical-align: middle;
}
div.body div.math p {
text-align: center;
}
span.eqno {
float: right;
}
/* -- printout stylesheet --------------------------------------------------- */
@media print {
div.document,
div.documentwrapper,
div.bodywrapper {
margin: 0 !important;
width: 100%;
}
div.sphinxsidebar,
div.related,
div.footer,
#top-link {
display: none;
}
}

255
_static/default.css Normal file
View file

@ -0,0 +1,255 @@
/*
* default.css_t
* ~~~~~~~~~~~~~
*
* Sphinx stylesheet -- default theme.
*
* :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: sans-serif;
font-size: 100%;
background-color: #11303d;
color: #000;
margin: 0;
padding: 0;
}
div.document {
background-color: #1c4e63;
}
div.documentwrapper {
float: left;
width: 100%;
}
div.bodywrapper {
margin: 0 0 0 230px;
}
div.body {
background-color: #ffffff;
color: #000000;
padding: 0 20px 30px 20px;
}
div.footer {
color: #ffffff;
width: 100%;
padding: 9px 0 9px 0;
text-align: center;
font-size: 75%;
}
div.footer a {
color: #ffffff;
text-decoration: underline;
}
div.related {
background-color: #133f52;
line-height: 30px;
color: #ffffff;
}
div.related a {
color: #ffffff;
}
div.sphinxsidebar {
}
div.sphinxsidebar h3 {
font-family: 'Trebuchet MS', sans-serif;
color: #ffffff;
font-size: 1.4em;
font-weight: normal;
margin: 0;
padding: 0;
}
div.sphinxsidebar h3 a {
color: #ffffff;
}
div.sphinxsidebar h4 {
font-family: 'Trebuchet MS', sans-serif;
color: #ffffff;
font-size: 1.3em;
font-weight: normal;
margin: 5px 0 0 0;
padding: 0;
}
div.sphinxsidebar p {
color: #ffffff;
}
div.sphinxsidebar p.topless {
margin: 5px 10px 10px 10px;
}
div.sphinxsidebar ul {
margin: 10px;
padding: 0;
color: #ffffff;
}
div.sphinxsidebar a {
color: #98dbcc;
}
div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}
/* -- hyperlink styles ------------------------------------------------------ */
a {
color: #355f7c;
text-decoration: none;
}
a:visited {
color: #355f7c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* -- body styles ----------------------------------------------------------- */
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: 'Trebuchet MS', sans-serif;
background-color: #f2f2f2;
font-weight: normal;
color: #20435c;
border-bottom: 1px solid #ccc;
margin: 20px -20px 10px -20px;
padding: 3px 0 3px 10px;
}
div.body h1 { margin-top: 0; font-size: 200%; }
div.body h2 { font-size: 160%; }
div.body h3 { font-size: 140%; }
div.body h4 { font-size: 120%; }
div.body h5 { font-size: 110%; }
div.body h6 { font-size: 100%; }
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
div.body p, div.body dd, div.body li {
text-align: justify;
line-height: 130%;
}
div.admonition p.admonition-title + p {
display: inline;
}
div.admonition p {
margin-bottom: 5px;
}
div.admonition pre {
margin-bottom: 5px;
}
div.admonition ul, div.admonition ol {
margin-bottom: 5px;
}
div.note {
background-color: #eee;
border: 1px solid #ccc;
}
div.seealso {
background-color: #ffc;
border: 1px solid #ff6;
}
div.topic {
background-color: #eee;
}
div.warning {
background-color: #ffe4e4;
border: 1px solid #f66;
}
p.admonition-title {
display: inline;
}
p.admonition-title:after {
content: ":";
}
pre {
padding: 5px;
background-color: #eeffcc;
color: #333333;
line-height: 120%;
border: 1px solid #ac9;
border-left: none;
border-right: none;
}
tt {
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 0.95em;
}
th {
background-color: #ede;
}
.warning tt {
background: #efc2c2;
}
.note tt {
background: #d6d6d6;
}
.viewcode-back {
font-family: sans-serif;
}
div.viewcode-block:target {
background-color: #f4debf;
border-top: 1px solid #ac9;
border-bottom: 1px solid #ac9;
}

247
_static/doctools.js Normal file
View file

@ -0,0 +1,247 @@
/*
* doctools.js
* ~~~~~~~~~~~
*
* Sphinx JavaScript utilties for all documentation.
*
* :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/**
* select a different prefix for underscore
*/
$u = _.noConflict();
/**
* make the code below compatible with browsers without
* an installed firebug like debugger
if (!window.console || !console.firebug) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
"dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
"profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {};
}
*/
/**
* small helper function to urldecode strings
*/
jQuery.urldecode = function(x) {
return decodeURIComponent(x).replace(/\+/g, ' ');
}
/**
* small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;
/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s == 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};
/**
* small function to check if an array contains
* a given item.
*/
jQuery.contains = function(arr, item) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == item)
return true;
}
return false;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
*/
jQuery.fn.highlightText = function(text, className) {
function highlight(node) {
if (node.nodeType == 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
var span = document.createElement("span");
span.className = className;
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling));
node.nodeValue = val.substr(0, pos);
}
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this);
});
}
}
return this.each(function() {
highlight(this);
});
};
/**
* Small JavaScript module for the documentation.
*/
var Documentation = {
init : function() {
this.fixFirefoxAnchorBug();
this.highlightSearchWords();
this.initIndexTable();
},
/**
* i18n support
*/
TRANSLATIONS : {},
PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
LOCALE : 'unknown',
// gettext and ngettext don't access this so that the functions
// can safely bound to a different name (_ = Documentation.gettext)
gettext : function(string) {
var translated = Documentation.TRANSLATIONS[string];
if (typeof translated == 'undefined')
return string;
return (typeof translated == 'string') ? translated : translated[0];
},
ngettext : function(singular, plural, n) {
var translated = Documentation.TRANSLATIONS[singular];
if (typeof translated == 'undefined')
return (n == 1) ? singular : plural;
return translated[Documentation.PLURALEXPR(n)];
},
addTranslations : function(catalog) {
for (var key in catalog.messages)
this.TRANSLATIONS[key] = catalog.messages[key];
this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
this.LOCALE = catalog.locale;
},
/**
* add context elements like header anchor links
*/
addContextElements : function() {
$('div[id] > :header:first').each(function() {
$('<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
*/
fixFirefoxAnchorBug : function() {
if (document.location.hash && $.browser.mozilla)
window.setTimeout(function() {
document.location.href += '';
}, 10);
},
/**
* highlight the search words provided in the url in the text
*/
highlightSearchWords : function() {
var params = $.getQueryParameters();
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
if (terms.length) {
var body = $('div.body');
window.setTimeout(function() {
$.each(terms, function() {
body.highlightText(this.toLowerCase(), 'highlighted');
});
}, 10);
$('<li class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></li>')
.appendTo($('.sidebar .this-page-menu'));
}
},
/**
* init the domain index toggle buttons
*/
initIndexTable : function() {
var togglers = $('img.toggler').click(function() {
var src = $(this).attr('src');
var idnum = $(this).attr('id').substr(7);
$('tr.cg-' + idnum).toggle();
if (src.substr(-9) == 'minus.png')
$(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
else
$(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
}).css('display', '');
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
togglers.click();
}
},
/**
* helper function to hide the search marks again
*/
hideSearchWords : function() {
$('.sidebar .this-page-menu li.highlight-link').fadeOut(300);
$('span.highlighted').removeClass('highlighted');
},
/**
* make the url absolute
*/
makeURL : function(relativeURL) {
return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
},
/**
* get the current relative url
*/
getCurrentURL : function() {
var path = document.location.pathname;
var parts = path.split(/\//);
$.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
if (this == '..')
parts.pop();
});
var url = parts.join('/');
return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
}
};
// quick alias for translations
_ = Documentation.gettext;
$(document).ready(function() {
Documentation.init();
});

BIN
_static/file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

8176
_static/jquery.js vendored Normal file

File diff suppressed because it is too large Load diff

BIN
_static/minus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

BIN
_static/plus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

61
_static/pygments.css Normal file
View file

@ -0,0 +1,61 @@
.hll { background-color: #ffffcc }
.c { color: #408090; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #007020; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.cm { color: #408090; font-style: italic } /* Comment.Multiline */
.cp { color: #007020 } /* Comment.Preproc */
.c1 { color: #408090; font-style: italic } /* Comment.Single */
.cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
.gd { color: #A00000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #FF0000 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #00A000 } /* Generic.Inserted */
.go { color: #303030 } /* Generic.Output */
.gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #0040D0 } /* Generic.Traceback */
.kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.kp { color: #007020 } /* Keyword.Pseudo */
.kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.kt { color: #902000 } /* Keyword.Type */
.m { color: #208050 } /* Literal.Number */
.s { color: #4070a0 } /* Literal.String */
.na { color: #4070a0 } /* Name.Attribute */
.nb { color: #007020 } /* Name.Builtin */
.nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.no { color: #60add5 } /* Name.Constant */
.nd { color: #555555; font-weight: bold } /* Name.Decorator */
.ni { color: #d55537; font-weight: bold } /* Name.Entity */
.ne { color: #007020 } /* Name.Exception */
.nf { color: #06287e } /* Name.Function */
.nl { color: #002070; font-weight: bold } /* Name.Label */
.nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.nt { color: #062873; font-weight: bold } /* Name.Tag */
.nv { color: #bb60d5 } /* Name.Variable */
.ow { color: #007020; font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mf { color: #208050 } /* Literal.Number.Float */
.mh { color: #208050 } /* Literal.Number.Hex */
.mi { color: #208050 } /* Literal.Number.Integer */
.mo { color: #208050 } /* Literal.Number.Oct */
.sb { color: #4070a0 } /* Literal.String.Backtick */
.sc { color: #4070a0 } /* Literal.String.Char */
.sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.s2 { color: #4070a0 } /* Literal.String.Double */
.se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.sh { color: #4070a0 } /* Literal.String.Heredoc */
.si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.sx { color: #c65d09 } /* Literal.String.Other */
.sr { color: #235388 } /* Literal.String.Regex */
.s1 { color: #4070a0 } /* Literal.String.Single */
.ss { color: #517918 } /* Literal.String.Symbol */
.bp { color: #007020 } /* Name.Builtin.Pseudo */
.vc { color: #bb60d5 } /* Name.Variable.Class */
.vg { color: #bb60d5 } /* Name.Variable.Global */
.vi { color: #bb60d5 } /* Name.Variable.Instance */
.il { color: #208050 } /* Literal.Number.Integer.Long */

518
_static/searchtools.js Normal file
View file

@ -0,0 +1,518 @@
/*
* searchtools.js
* ~~~~~~~~~~~~~~
*
* Sphinx JavaScript utilties for the full-text search.
*
* :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/**
* helper function to return a node containing the
* search summary for a given text. keywords is a list
* of stemmed words, hlwords is the list of normal, unstemmed
* words. the first one is used to find the occurance, the
* latter for highlighting it.
*/
jQuery.makeSearchSummary = function(text, keywords, hlwords) {
var textLower = text.toLowerCase();
var start = 0;
$.each(keywords, function() {
var i = textLower.indexOf(this.toLowerCase());
if (i > -1)
start = i;
});
start = Math.max(start - 120, 0);
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
var rv = $('<div class="context"></div>').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});
return rv;
}
/**
* Porter Stemmer
*/
var PorterStemmer = function() {
var step2list = {
ational: 'ate',
tional: 'tion',
enci: 'ence',
anci: 'ance',
izer: 'ize',
bli: 'ble',
alli: 'al',
entli: 'ent',
eli: 'e',
ousli: 'ous',
ization: 'ize',
ation: 'ate',
ator: 'ate',
alism: 'al',
iveness: 'ive',
fulness: 'ful',
ousness: 'ous',
aliti: 'al',
iviti: 'ive',
biliti: 'ble',
logi: 'log'
};
var step3list = {
icate: 'ic',
ative: '',
alize: 'al',
iciti: 'ic',
ical: 'ic',
ful: '',
ness: ''
};
var c = "[^aeiou]"; // consonant
var v = "[aeiouy]"; // vowel
var C = c + "[^aeiouy]*"; // consonant sequence
var V = v + "[aeiou]*"; // vowel sequence
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
var s_v = "^(" + C + ")?" + v; // vowel in stem
this.stemWord = function (w) {
var stem;
var suffix;
var firstch;
var origword = w;
if (w.length < 3)
return w;
var re;
var re2;
var re3;
var re4;
firstch = w.substr(0,1);
if (firstch == "y")
w = firstch.toUpperCase() + w.substr(1);
// Step 1a
re = /^(.+?)(ss|i)es$/;
re2 = /^(.+?)([^s])s$/;
if (re.test(w))
w = w.replace(re,"$1$2");
else if (re2.test(w))
w = w.replace(re2,"$1$2");
// Step 1b
re = /^(.+?)eed$/;
re2 = /^(.+?)(ed|ing)$/;
if (re.test(w)) {
var fp = re.exec(w);
re = new RegExp(mgr0);
if (re.test(fp[1])) {
re = /.$/;
w = w.replace(re,"");
}
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1];
re2 = new RegExp(s_v);
if (re2.test(stem)) {
w = stem;
re2 = /(at|bl|iz)$/;
re3 = new RegExp("([^aeiouylsz])\\1$");
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re2.test(w))
w = w + "e";
else if (re3.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
else if (re4.test(w))
w = w + "e";
}
}
// Step 1c
re = /^(.+?)y$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(s_v);
if (re.test(stem))
w = stem + "i";
}
// Step 2
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step2list[suffix];
}
// Step 3
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step3list[suffix];
}
// Step 4
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
re2 = /^(.+?)(s|t)(ion)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
if (re.test(stem))
w = stem;
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1] + fp[2];
re2 = new RegExp(mgr1);
if (re2.test(stem))
w = stem;
}
// Step 5
re = /^(.+?)e$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
re2 = new RegExp(meq1);
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
w = stem;
}
re = /ll$/;
re2 = new RegExp(mgr1);
if (re.test(w) && re2.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
// and turn initial Y back to y
if (firstch == "y")
w = firstch.toLowerCase() + w.substr(1);
return w;
}
}
/**
* Search Module
*/
var Search = {
_index : null,
_queued_query : null,
_pulse_status : -1,
init : function() {
var params = $.getQueryParameters();
if (params.q) {
var query = params.q[0];
$('input[name="q"]')[0].value = query;
this.performSearch(query);
}
},
loadIndex : function(url) {
$.ajax({type: "GET", url: url, data: null, success: null,
dataType: "script", cache: true});
},
setIndex : function(index) {
var q;
this._index = index;
if ((q = this._queued_query) !== null) {
this._queued_query = null;
Search.query(q);
}
},
hasIndex : function() {
return this._index !== null;
},
deferQuery : function(query) {
this._queued_query = query;
},
stopPulse : function() {
this._pulse_status = 0;
},
startPulse : function() {
if (this._pulse_status >= 0)
return;
function pulse() {
Search._pulse_status = (Search._pulse_status + 1) % 4;
var dotString = '';
for (var i = 0; i < Search._pulse_status; i++)
dotString += '.';
Search.dots.text(dotString);
if (Search._pulse_status > -1)
window.setTimeout(pulse, 500);
};
pulse();
},
/**
* perform a search for something
*/
performSearch : function(query) {
// create the required interface elements
this.out = $('#search-results');
this.title = $('<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);
},
query : function(query) {
var stopwords = ['and', 'then', 'into', 'it', 'as', 'are', 'in',
'if', 'for', 'no', 'there', 'their', 'was', 'is',
'be', 'to', 'that', 'but', 'they', 'not', 'such',
'with', 'by', 'a', 'on', 'these', 'of', 'will',
'this', 'near', 'the', 'or', 'at'];
// stem the searchterms and add them to the correct list
var stemmer = new PorterStemmer();
var searchterms = [];
var excluded = [];
var hlterms = [];
var tmp = query.split(/\s+/);
var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null;
for (var i = 0; i < tmp.length; i++) {
if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] == "") {
// skip this "word"
continue;
}
// stem the word
var word = stemmer.stemWord(tmp[i]).toLowerCase();
// select the correct list
if (word[0] == '-') {
var toAppend = excluded;
word = word.substr(1);
}
else {
var toAppend = searchterms;
hlterms.push(tmp[i].toLowerCase());
}
// only add if not already in the list
if (!$.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 filenames = this._index.filenames;
var titles = this._index.titles;
var terms = this._index.terms;
var objects = this._index.objects;
var objtypes = this._index.objtypes;
var objnames = this._index.objnames;
var fileMap = {};
var files = null;
// different result priorities
var importantResults = [];
var objectResults = [];
var regularResults = [];
var unimportantResults = [];
$('#search-progress').empty();
// lookup as object
if (object != null) {
for (var prefix in objects) {
for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
match = objects[prefix][name];
descr = objnames[match[1]] + _(', in ') + titles[match[0]];
// XXX the generated anchors are not generally correct
// XXX there may be custom prefixes
result = [filenames[match[0]], fullname, '#'+fullname, descr];
switch (match[2]) {
case 1: objectResults.push(result); break;
case 0: importantResults.push(result); break;
case 2: unimportantResults.push(result); break;
}
}
}
}
}
// sort results descending
objectResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
importantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
unimportantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
// perform the search on the required terms
for (var i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
// no match but word was a required one
if ((files = terms[word]) == null)
break;
if (files.length == undefined) {
files = [files];
}
// create the mapping
for (var j = 0; j < files.length; j++) {
var 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 (var 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 (var i = 0; i < excluded.length; i++) {
if (terms[excluded[i]] == file ||
$.contains(terms[excluded[i]] || [], file)) {
valid = false;
break;
}
}
// if we have still a valid result we can add it
// to the result list
if (valid)
regularResults.push([filenames[file], titles[file], '', null]);
}
// delete unused variables in order to not waste
// memory until list is retrieved completely
delete filenames, titles, terms;
// now sort the regular results descending by title
regularResults.sort(function(a, b) {
var left = a[1].toLowerCase();
var right = b[1].toLowerCase();
return (left > right) ? -1 : ((left < right) ? 1 : 0);
});
// combine all results
var results = unimportantResults.concat(regularResults)
.concat(objectResults).concat(importantResults);
// 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) {
$.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' +
item[0] + '.txt', function(data) {
if (data != '') {
listItem.append($.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();
}
}
$(document).ready(function() {
Search.init();
});

147
_static/sidebar.js Normal file
View file

@ -0,0 +1,147 @@
/*
* 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-2010 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');
// 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>&laquo;</span></div>'
);
var sidebarbutton = $('#sidebarbutton');
// 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];
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();
});

16
_static/underscore.js Normal file
View file

@ -0,0 +1,16 @@
(function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d,
a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c);
var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c,
d);var e=true;b.each(a,function(f,g,h){(e=e&&c.call(d,f,g,h))||b.breakLoop()});return e};b.any=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.some))return a.some(c,d);var e=false;b.each(a,function(f,g,h){if(e=c.call(d,f,g,h))b.breakLoop()});return e};b.include=function(a,c){if(b.isArray(a))return b.indexOf(a,c)!=-1;var d=false;b.each(a,function(e){if(d=e===c)b.breakLoop()});return d};b.invoke=function(a,c){var d=b.rest(arguments,2);return b.map(a,function(e){return(c?e[c]:e).apply(e,d)})};b.pluck=
function(a,c){return b.map(a,function(d){return d[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g>=e.computed&&(e={value:f,computed:g})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g<e.computed&&(e={value:f,computed:g})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a,
function(e,f,g){return{value:e,criteria:c.call(d,e,f,g)}}).sort(function(e,f){e=e.criteria;f=f.criteria;return e<f?-1:e>f?1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?(e=g+1):(f=g)}return e};b.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return a;if(b.isArguments(a))return k.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=function(a,c,d){return c&&!d?k.call(a,
0,c):a[0]};b.rest=function(a,c,d){return k.call(a,b.isUndefined(c)||d?1:c)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.select(a,function(c){return!!c})};b.flatten=function(a){return b.reduce(a,[],function(c,d){if(b.isArray(d))return c.concat(b.flatten(d));c.push(d);return c})};b.without=function(a){var c=b.rest(arguments);return b.select(a,function(d){return!b.include(c,d)})};b.uniq=function(a,c){return b.reduce(a,[],function(d,e,f){if(0==f||(c===true?b.last(d)!=e:!b.include(d,
e)))d.push(e);return d})};b.intersect=function(a){var c=b.rest(arguments);return b.select(b.uniq(a),function(d){return b.all(c,function(e){return b.indexOf(e,d)>=0})})};b.zip=function(){for(var a=b.toArray(arguments),c=b.max(b.pluck(a,"length")),d=new Array(c),e=0;e<c;e++)d[e]=b.pluck(a,String(e));return d};b.indexOf=function(a,c){if(a.indexOf)return a.indexOf(c);for(var d=0,e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,c){if(a.lastIndexOf)return a.lastIndexOf(c);for(var d=
a.length;d--;)if(a[d]===c)return d;return-1};b.range=function(a,c,d){var e=b.toArray(arguments),f=e.length<=1;a=f?0:e[0];c=f?e[0]:e[1];d=e[2]||1;e=Math.ceil((c-a)/d);if(e<=0)return[];e=new Array(e);f=a;for(var g=0;1;f+=d){if((d>0?f-c:c-f)>=0)return e;e[g++]=f}};b.bind=function(a,c){var d=b.rest(arguments,2);return function(){return a.apply(c||j,d.concat(b.toArray(arguments)))}};b.bindAll=function(a){var c=b.rest(arguments);if(c.length==0)c=b.functions(a);b.each(c,function(d){a[d]=b.bind(a[d],a)});
return a};b.delay=function(a,c){var d=b.rest(arguments,2);return setTimeout(function(){return a.apply(a,d)},c)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(b.rest(arguments)))};b.wrap=function(a,c){return function(){var d=[a].concat(b.toArray(arguments));return c.apply(c,d)}};b.compose=function(){var a=b.toArray(arguments);return function(){for(var c=b.toArray(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}};b.keys=function(a){if(b.isArray(a))return b.range(0,a.length);
var c=[];for(var d in a)q.call(a,d)&&c.push(d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=function(a){return b.select(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a,c){for(var d in c)a[d]=c[d];return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.tap=function(a,c){c(a);return a};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a;if(d!=typeof c)return false;if(a==c)return true;if(!a&&c||a&&!c)return false;
if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return true;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return false;if(a.length&&a.length!==c.length)return false;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return false;for(var f in a)if(!b.isEqual(a[f],c[f]))return false;return true};b.isEmpty=function(a){return b.keys(a).length==
0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=function(a){return!!(a&&a.concat&&a.unshift)};b.isArguments=function(a){return a&&b.isNumber(a.length)&&!b.isArray(a)&&!r.call(a,"length")};b.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return p.call(a)==="[object Number]"};b.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};b.isRegExp=function(a){return!!(a&&
a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};b.isNaN=function(a){return b.isNumber(a)&&isNaN(a)};b.isNull=function(a){return a===null};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){j._=n;return this};b.identity=function(a){return a};b.breakLoop=function(){throw m;};var s=0;b.uniqueId=function(a){var c=s++;return a?a+c:c};b.template=function(a,c){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g,
" ").replace(/'(?=[^%]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');");return c?a(c):a};b.forEach=b.each;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.any;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var l=function(a,c){return c?b(a).chain():a};b.each(b.functions(b),function(a){var c=b[a];i.prototype[a]=function(){var d=b.toArray(arguments);
o.call(d,this._wrapped);return l(c.apply(b,d),this._chain)}});b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){c.apply(this._wrapped,arguments);return l(this._wrapped,this._chain)}});b.each(["concat","join","slice"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){return l(c.apply(this._wrapped,arguments),this._chain)}});i.prototype.chain=function(){this._chain=true;return this};i.prototype.value=function(){return this._wrapped}})();

290
genindex.html Normal file
View file

@ -0,0 +1,290 @@
<!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 &mdash; pokedex v0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.1',
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>
<link rel="top" title="pokedex v0.1 documentation" href="index.html" />
</head>
<body>
<div class="related">
<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><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<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="#G"><strong>G</strong></a> | <a href="#I"><strong>I</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="#P"><strong>P</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> | <a href="#T"><strong>T</strong></a> | <a href="#V"><strong>V</strong></a>
</div>
<h2 id="A">A</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Ability">Ability (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.AbilityChangelog">AbilityChangelog (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.AbilityFlavorText">AbilityFlavorText (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="B">B</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Berry">Berry (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.BerryFirmness">BerryFirmness (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.BerryFlavor">BerryFlavor (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="C">C</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.ContestCombo">ContestCombo (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.ContestEffect">ContestEffect (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.ContestType">ContestType (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="E">E</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.EggGroup">EggGroup (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.Encounter">Encounter (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.EncounterCondition">EncounterCondition (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.EncounterConditionValue">EncounterConditionValue (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.EncounterConditionValueMap">EncounterConditionValueMap (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.EncounterMethod">EncounterMethod (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.EncounterSlot">EncounterSlot (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.EvolutionChain">EvolutionChain (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.EvolutionTrigger">EvolutionTrigger (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.Experience">Experience (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="G">G</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Generation">Generation (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.GrowthRate">GrowthRate (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="I">I</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Item">Item (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.ItemCategory">ItemCategory (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.ItemFlag">ItemFlag (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.ItemFlagMap">ItemFlagMap (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.ItemFlavorText">ItemFlavorText (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.ItemFlingEffect">ItemFlingEffect (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.ItemGameIndex">ItemGameIndex (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.ItemPocket">ItemPocket (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="L">L</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Language">Language (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.Location">Location (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.LocationArea">LocationArea (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.LocationAreaEncounterRate">LocationAreaEncounterRate (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.LocationGameIndex">LocationGameIndex (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="M">M</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Machine">Machine (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.mapped_classes">mapped_classes (in module pokedex.db.tables)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.metadata">metadata (in module pokedex.db.tables)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.Move">Move (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveBattleStyle">MoveBattleStyle (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveDamageClass">MoveDamageClass (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveEffect">MoveEffect (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveEffectChangelog">MoveEffectChangelog (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveFlag">MoveFlag (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.MoveFlagMap">MoveFlagMap (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveFlavorText">MoveFlavorText (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveMeta">MoveMeta (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveMetaAilment">MoveMetaAilment (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveMetaCategory">MoveMetaCategory (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveMetaStatChange">MoveMetaStatChange (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveTarget">MoveTarget (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.MoveVersion">MoveVersion (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="N">N</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Nature">Nature (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.NatureBattleStylePreference">NatureBattleStylePreference (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.NaturePokeathlonStat">NaturePokeathlonStat (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="P">P</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.PokeathlonStat">PokeathlonStat (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.Pokedex">Pokedex (mapped class)</a></dt>
<dt><a href="main-tables.html#module-pokedex.db.tables">pokedex.db.tables (module)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.Pokemon">Pokemon (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonAbility">PokemonAbility (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonColor">PokemonColor (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonDexNumber">PokemonDexNumber (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonEggGroup">PokemonEggGroup (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonEvolution">PokemonEvolution (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonForm">PokemonForm (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonFormPokeathlonStat">PokemonFormPokeathlonStat (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonGameIndex">PokemonGameIndex (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonHabitat">PokemonHabitat (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonItem">PokemonItem (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonMove">PokemonMove (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonMoveMethod">PokemonMoveMethod (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonShape">PokemonShape (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonSpecies">PokemonSpecies (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonSpeciesFlavorText">PokemonSpeciesFlavorText (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonStat">PokemonStat (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.PokemonType">PokemonType (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="R">R</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Region">Region (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="S">S</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Stat">Stat (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.StatHint">StatHint (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.SuperContestCombo">SuperContestCombo (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.SuperContestEffect">SuperContestEffect (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="T">T</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Type">Type (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.TypeEfficacy">TypeEfficacy (mapped class)</a></dt>
</dl></td>
</tr></table>
<h2 id="V">V</h2>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.Version">Version (mapped class)</a></dt>
<dt><a href="main-tables.html#pokedex.db.tables.VersionGroup">VersionGroup (mapped class)</a></dt>
</dl></td>
<td width="33%" valign="top"><dl>
<dt><a href="main-tables.html#pokedex.db.tables.VersionGroupRegion">VersionGroupRegion (mapped class)</a></dt>
</dl></td>
</tr></table>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<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">
<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><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
</body>
</html>

141
index.html Normal file
View file

@ -0,0 +1,141 @@
<!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>The pokedex documentation &mdash; pokedex v0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.1',
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>
<link rel="top" title="pokedex v0.1 documentation" href="#" />
<link rel="next" title="Installing the pokedex library" href="installing.html" />
</head>
<body>
<div class="related">
<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="installing.html" title="Installing the pokedex library"
accesskey="N">next</a> |</li>
<li><a href="#">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="the-pokedex-documentation">
<h1>The pokedex documentation<a class="headerlink" href="#the-pokedex-documentation" title="Permalink to this headline"></a></h1>
<p>Jump right in!</p>
<p>Contents:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="installing.html">Installing the pokedex library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="installing.html#quick-startup-with-ubuntu-debian-like-systems">Quick startup with Ubuntu/Debian-like systems</a></li>
<li class="toctree-l2"><a class="reference internal" href="installing.html#prerequisites">Prerequisites</a></li>
<li class="toctree-l2"><a class="reference internal" href="installing.html#getting-and-installing-pokedex">Getting and installing pokedex</a></li>
<li class="toctree-l2"><a class="reference internal" href="installing.html#loading-the-database">Loading the database</a></li>
<li class="toctree-l2"><a class="reference internal" href="installing.html#all-done">All done</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="usage.html">Using pokedex</a><ul>
<li class="toctree-l2"><a class="reference internal" href="usage.html#connecting">Connecting</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="schema.html">The database schema</a><ul>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html">The pokédex tables</a></li>
</ul>
</li>
</ul>
</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"><em>Index</em></a></li>
<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">The pokedex documentation</a><ul>
</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="installing.html"
title="next chapter">Installing the pokedex library</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<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">
<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="installing.html" title="Installing the pokedex library"
>next</a> |</li>
<li><a href="#">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
</body>
</html>

254
installing.html Normal file
View file

@ -0,0 +1,254 @@
<!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>Installing the pokedex library &mdash; pokedex v0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.1',
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>
<link rel="top" title="pokedex v0.1 documentation" href="index.html" />
<link rel="next" title="Using pokedex" href="usage.html" />
<link rel="prev" title="The pokedex documentation" href="index.html" />
</head>
<body>
<div class="related">
<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="usage.html" title="Using pokedex"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="The pokedex documentation"
accesskey="P">previous</a> |</li>
<li><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="installing-the-pokedex-library">
<h1>Installing the pokedex library<a class="headerlink" href="#installing-the-pokedex-library" title="Permalink to this headline"></a></h1>
<div class="section" id="quick-startup-with-ubuntu-debian-like-systems">
<h2>Quick startup with Ubuntu/Debian-like systems<a class="headerlink" href="#quick-startup-with-ubuntu-debian-like-systems" title="Permalink to this headline"></a></h2>
<p>Run the following from an empty directory:</p>
<div class="highlight-python"><pre>$ sudo apt-get install git python python-pip python-sqlalchemy
$ git clone git://git.veekun.com/pokedex.git
$ pip install -E env -e pokedex
$ source env/bin/activate
(env)$ pokedex setup -v
(env)$ pokedex lookup eevee</pre>
</div>
<p>If it all goes smoothly, you can now use <tt class="docutils literal"><span class="pre">env/bin/pokedex</span></tt>, the command-line
tool, and <tt class="docutils literal"><span class="pre">env/bin/python</span></tt>, a Python interpreter configured to use the
pokedex library.</p>
<p>That is all you need. Feel free to skip the rest of this chapter if you&#8217;re not
interested in the details.</p>
</div>
<div class="section" id="prerequisites">
<h2>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline"></a></h2>
<div class="section" id="linux">
<h3>Linux<a class="headerlink" href="#linux" title="Permalink to this headline"></a></h3>
<p>Ubuntu/Debian users should run the following:</p>
<div class="highlight-python"><pre>$ sudo apt-get install git python python-pip</pre>
</div>
<p>With other Linuxes, install the packages for git, python (2.6 or 2.7,
<em>not</em> 3.x), and python-pip.</p>
<p>If you succeeded, skip the Detailed instructions.</p>
</div>
<div class="section" id="detailed-instructions">
<h3>Detailed instructions<a class="headerlink" href="#detailed-instructions" title="Permalink to this headline"></a></h3>
<p>You should know what a command line is and how to work with it.
The here we assume you&#8217;re using Linux <a class="footnote-reference" href="#id3" id="id1">[1]</a>, if that&#8217;s not the case, make
sure you have enough computer knowledge to translate the instructions to your
operating system.</p>
<p>Pokedex is distributed via <a class="reference external" href="http://git-scm.com/">Git</a>. So, get Git.</p>
<p>You will also need <a class="reference external" href="http://www.python.org/">Python</a> 2; the language pokedex is written in. Be sure to get
version <strong>2.6</strong> or <strong>2.7</strong>. Pokedex does not work with Python 3.x yet, and it
most likely won&#8217;t work with 2.5 or earlier.</p>
<p>Next, get <a class="reference external" href="http://pypi.python.org/pypi/pip">pip</a>, a tool to install Python packages. Experts can use another
tool, of course.</p>
<p>Make sure git and pip are on your path.</p>
<p>Optionally you can install <a class="reference external" href="www.sqlalchemy.org/">SQLAlchemy</a>, <a class="reference external" href="http://www.freewisdom.org/projects/python-markdown/">Python markdown</a>, <a class="reference external" href="http://whoosh.ca/">Whoosh</a>,
or <a class="reference external" href="pypi.python.org/pypi/construct">construct</a>. If you don&#8217;t, pip will atuomatically download and install a copy
for you, but some are pretty big so you might want to install it system-wide.
(Unfortunately, many distros have outdated versions of these libraries, so pip
will install pokedex&#8217;s own copy anyway.)</p>
</div>
</div>
<div class="section" id="getting-and-installing-pokedex">
<h2>Getting and installing pokedex<a class="headerlink" href="#getting-and-installing-pokedex" title="Permalink to this headline"></a></h2>
<p>Run the following from an empty directory:</p>
<div class="highlight-python"><pre>$ git clone git://git.veekun.com/pokedex.git
$ pip install -E env -e pokedex</pre>
</div>
<p>This will give you two directories: pokedex (containing the source code and
data), and env (a <a class="reference external" href="http://www.virtualenv.org/en/latest/">virtualenv</a>).</p>
<p>In env/bin, there are three interesting files:</p>
<ul class="simple">
<li>pokedex: The pokedex program</li>
<li>python: A copy of Python that knows about pokedex and its prerequisites.
Using the system python won&#8217;t work.</li>
<li>activate: Typing <tt class="docutils literal"><span class="pre">source</span> <span class="pre">env/bin/activate</span></tt> in a shell will put
pokedex and our bin/python on the $PATH, and generally set things up to work
with them. Your prompt will change to let you know of this. You can end such
a session by typing <tt class="docutils literal"><span class="pre">deactivate</span></tt>.</li>
</ul>
<p>This documentation will assume that you&#8217;ve activated the virtualenv, so
<tt class="docutils literal"><span class="pre">pokedex</span></tt> means <tt class="docutils literal"><span class="pre">env/bin/pokedex</span></tt>.</p>
<div class="section" id="advanced">
<h3>Advanced<a class="headerlink" href="#advanced" title="Permalink to this headline"></a></h3>
<p>You can of course install into an existing virtualenv, by either using its pip
and leaving out the <tt class="docutils literal"><span class="pre">-E</span> <span class="pre">env</span></tt>, or running the setup script directly:</p>
<div class="highlight-python"><pre>(anotherenv)$ cd pokedex
(anotherenv)pokedex$ python setup.py develop</pre>
</div>
<p>It is also possible to install pokedex system-wide. There are problems with
that. Don&#8217;t do it. The only time you need <tt class="docutils literal"><span class="pre">sudo</span></tt> is for getting the
prerequisites.</p>
</div>
</div>
<div class="section" id="loading-the-database">
<h2>Loading the database<a class="headerlink" href="#loading-the-database" title="Permalink to this headline"></a></h2>
<p>Before you can do anything useful with pokedex, you need to load the database:</p>
<div class="highlight-python"><pre>$ pokedex setup -v</pre>
</div>
<p>This will load the data into a default SQLite database and create a default
Whoosh index.</p>
<div class="section" id="id2">
<h3>Advanced<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3>
<p>If you want to use another database, make sure you have the corresponding
<a class="reference external" href="http://www.sqlalchemy.org/docs/core/engines.html">SQLAlchemy engine</a> for it and either use the <tt class="docutils literal"><span class="pre">-e</span></tt> switch, (e.g.
<tt class="docutils literal"><span class="pre">-e</span> <span class="pre">postgresql://&#64;/pokedex</span></tt>), or set the <tt class="docutils literal"><span class="pre">POKEDEX_DB_ENGINE</span></tt> environment
variable.</p>
<p>To use another lookup index directory, specify it with <tt class="docutils literal"><span class="pre">-i</span></tt> or the
<tt class="docutils literal"><span class="pre">POKEDEX_INDEX_DIR</span></tt> variable.</p>
<p>Make sure you always use the same options whenever you use pokedex.</p>
<p>If you&#8217;re confused about what pokedex thinks its settings are, check
<tt class="docutils literal"><span class="pre">pokedex</span> <span class="pre">status</span></tt>.</p>
<p>See <tt class="docutils literal"><span class="pre">pokedex</span> <span class="pre">help</span></tt> for even more options.</p>
</div>
</div>
<div class="section" id="all-done">
<h2>All done<a class="headerlink" href="#all-done" title="Permalink to this headline"></a></h2>
<p>To verify that all went smoothly, check that the pokedex tool finds your
favorite pokémon:</p>
<div class="highlight-python"><pre>$ pokedex lookup eevee</pre>
</div>
<p>Yes, that was a bit anti-climatic. The command-line tool doesn&#8217;t do much,
currently.</p>
<p class="rubric">Footnotes</p>
<table class="docutils footnote" frame="void" id="id3" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>If you write instructions for another OS, well be happy to include them
here. The reason your OS is not listed here is because the author doesn&#8217;t
use it, so naturally he can&#8217;t write instructions for it.</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Installing the pokedex library</a><ul>
<li><a class="reference internal" href="#quick-startup-with-ubuntu-debian-like-systems">Quick startup with Ubuntu/Debian-like systems</a></li>
<li><a class="reference internal" href="#prerequisites">Prerequisites</a><ul>
<li><a class="reference internal" href="#linux">Linux</a></li>
<li><a class="reference internal" href="#detailed-instructions">Detailed instructions</a></li>
</ul>
</li>
<li><a class="reference internal" href="#getting-and-installing-pokedex">Getting and installing pokedex</a><ul>
<li><a class="reference internal" href="#advanced">Advanced</a></li>
</ul>
</li>
<li><a class="reference internal" href="#loading-the-database">Loading the database</a><ul>
<li><a class="reference internal" href="#id2">Advanced</a></li>
</ul>
</li>
<li><a class="reference internal" href="#all-done">All done</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">The pokedex documentation</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="usage.html"
title="next chapter">Using pokedex</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/installing.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<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">
<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="usage.html" title="Using pokedex"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="The pokedex documentation"
>previous</a> |</li>
<li><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>
</html>

2094
main-tables.html Normal file

File diff suppressed because it is too large Load diff

BIN
objects.inv Normal file

Binary file not shown.

112
py-modindex.html Normal file
View file

@ -0,0 +1,112 @@
<!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 &mdash; pokedex v0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.1',
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>
<link rel="top" title="pokedex v0.1 documentation" href="index.html" />
</head>
<body>
<div class="related">
<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><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<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>&nbsp;</td><td></td></tr>
<tr class="cap"><td></td><td><a name="cap-p">
<strong>p</strong></a></td><td></td></tr>
<tr>
<td><img src="_static/minus.png" id="toggle-1"
class="toggler" style="display: none" alt="-" /></td>
<td>
<tt class="xref">pokedex</tt></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&nbsp;&nbsp;&nbsp;
<a href="main-tables.html#module-pokedex.db.tables"><tt class="xref">pokedex.db.tables</tt></a></td><td>
<em></em></td></tr>
</table>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<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">
<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><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
</body>
</html>

248
schema.html Normal file
View file

@ -0,0 +1,248 @@
<!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>The database schema &mdash; pokedex v0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.1',
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>
<link rel="top" title="pokedex v0.1 documentation" href="index.html" />
<link rel="next" title="The pokédex tables" href="main-tables.html" />
<link rel="prev" title="Using pokedex" href="usage.html" />
</head>
<body>
<div class="related">
<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="main-tables.html" title="The pokédex tables"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="usage.html" title="Using pokedex"
accesskey="P">previous</a> |</li>
<li><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="the-database-schema">
<h1>The database schema<a class="headerlink" href="#the-database-schema" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="main-tables.html">The pokédex tables</a><ul>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#pokemon">Pokémon</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonspecies">PokemonSpecies</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemon">Pokemon</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonform">PokemonForm</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-evolutionchain">EvolutionChain</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonevolution">PokemonEvolution</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#moves">Moves</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-move">Move</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-moveeffect">MoveEffect</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-movemeta">MoveMeta</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-moveversion">MoveVersion</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#items">Items</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-item">Item</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-berry">Berry</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#types">Types</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-type">Type</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#abilities">Abilities</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-ability">Ability</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#language">Language</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-language">Language</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#version-stuff">Version stuff</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-generation">Generation</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-versiongroup">VersionGroup</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-version">Version</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokedex">Pokedex</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-region">Region</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#encounters">Encounters</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-location">Location</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-locationarea">LocationArea</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-locationareaencounterrate">LocationAreaEncounterRate</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-encounter">Encounter</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-encountercondition">EncounterCondition</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-encounterconditionvalue">EncounterConditionValue</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-encountermethod">EncounterMethod</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-encounterslot">EncounterSlot</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#contests">Contests</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-contestcombo">ContestCombo</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-contesteffect">ContestEffect</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-supercontestcombo">SuperContestCombo</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-supercontesteffect">SuperContestEffect</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#enum-tables">Enum tables</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-berryfirmness">BerryFirmness</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-contesttype">ContestType</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-egggroup">EggGroup</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-evolutiontrigger">EvolutionTrigger</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-growthrate">GrowthRate</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-itemcategory">ItemCategory</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-itemflag">ItemFlag</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-itemflingeffect">ItemFlingEffect</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-itempocket">ItemPocket</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-movebattlestyle">MoveBattleStyle</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-movedamageclass">MoveDamageClass</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-movemetaailment">MoveMetaAilment</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-movemetacategory">MoveMetaCategory</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-movetarget">MoveTarget</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-nature">Nature</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemoncolor">PokemonColor</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonmovemethod">PokemonMoveMethod</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonshape">PokemonShape</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-stat">Stat</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#changelogs">Changelogs</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-abilitychangelog">AbilityChangelog</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-moveeffectchangelog">MoveEffectChangelog</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#flavor-text">Flavor text</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-itemflavortext">ItemFlavorText</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-abilityflavortext">AbilityFlavorText</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-moveflavortext">MoveFlavorText</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonspeciesflavortext">PokemonSpeciesFlavorText</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#association-tables">Association tables</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-berryflavor">BerryFlavor</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-encounterconditionvaluemap">EncounterConditionValueMap</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-itemflagmap">ItemFlagMap</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-machine">Machine</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-moveflag">MoveFlag</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-moveflagmap">MoveFlagMap</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-movemetastatchange">MoveMetaStatChange</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-naturebattlestylepreference">NatureBattleStylePreference</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-naturepokeathlonstat">NaturePokeathlonStat</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokeathlonstat">PokeathlonStat</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonability">PokemonAbility</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonegggroup">PokemonEggGroup</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonformpokeathlonstat">PokemonFormPokeathlonStat</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonhabitat">PokemonHabitat</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonmove">PokemonMove</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonstat">PokemonStat</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemonitem">PokemonItem</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemontype">PokemonType</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-typeefficacy">TypeEfficacy</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-versiongroupregion">VersionGroupRegion</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#index-maps">Index maps</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-itemgameindex">ItemGameIndex</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-locationgameindex">LocationGameIndex</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemondexnumber">PokemonDexNumber</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-pokemongameindex">PokemonGameIndex</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="main-tables.html#mics-tables">Mics tables</a><ul>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-experience">Experience</a></li>
<li class="toctree-l3"><a class="reference internal" href="main-tables.html#dex-table-stathint">StatHint</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="usage.html"
title="previous chapter">Using pokedex</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="main-tables.html"
title="next chapter">The pokédex tables</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/schema.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<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">
<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="main-tables.html" title="The pokédex tables"
>next</a> |</li>
<li class="right" >
<a href="usage.html" title="Using pokedex"
>previous</a> |</li>
<li><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
</body>
</html>

101
search.html Normal file
View file

@ -0,0 +1,101 @@
<!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 &mdash; pokedex v0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.1',
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="_static/searchtools.js"></script>
<link rel="top" title="pokedex v0.1 documentation" href="index.html" />
<script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); });
</script>
</head>
<body>
<div class="related">
<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><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<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">
<div class="sphinxsidebarwrapper">
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<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><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
</body>
</html>

1
searchindex.js Normal file

File diff suppressed because one or more lines are too long

386
usage.html Normal file
View file

@ -0,0 +1,386 @@
<!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>Using pokedex &mdash; pokedex v0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.1',
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>
<link rel="top" title="pokedex v0.1 documentation" href="index.html" />
<link rel="next" title="The database schema" href="schema.html" />
<link rel="prev" title="Installing the pokedex library" href="installing.html" />
</head>
<body>
<div class="related">
<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="schema.html" title="The database schema"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="installing.html" title="Installing the pokedex library"
accesskey="P">previous</a> |</li>
<li><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="using-pokedex">
<h1>Using pokedex<a class="headerlink" href="#using-pokedex" title="Permalink to this headline"></a></h1>
<p>The pokédex is, first and foremost, a Python library. To get the most of it,
you&#8217;ll need to learn <a href="#id1"><span class="problematic" id="id2">`Python`_</span></a> and <a href="#id3"><span class="problematic" id="id4">`SQLAlchemy`_</span></a>.</p>
<p>Here is a small example of using pokedex:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">pokedex.db</span> <span class="kn">import</span> <span class="n">connect</span><span class="p">,</span> <span class="n">tables</span><span class="p">,</span> <span class="n">util</span>
<span class="n">session</span> <span class="o">=</span> <span class="n">connect</span><span class="p">()</span>
<span class="n">pokemon</span> <span class="o">=</span> <span class="n">util</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="n">tables</span><span class="o">.</span><span class="n">PokemonSpecies</span><span class="p">,</span> <span class="s">&#39;bulbasaur&#39;</span><span class="p">)</span>
<span class="k">print</span> <span class="s">u&#39;{0.name}, the {0.genus} Pokemon&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">pokemon</span><span class="p">)</span>
</pre></div>
</div>
<p>Running this will give you some Bulbasaur info:</p>
<div class="highlight-none"><div class="highlight"><pre>Bulbasaur, the Seed Pokemon
</pre></div>
</div>
<div class="section" id="connecting">
<h2>Connecting<a class="headerlink" href="#connecting" title="Permalink to this headline"></a></h2>
<p>To get information out of the Pokédex, you will need to create a
<tt class="xref py py-class docutils literal"><span class="pre">Session</span></tt>. To do that, use
<tt class="xref py py-func docutils literal"><span class="pre">pokedex.db.connect()</span></tt>. For simple uses, you don&#8217;t need to give it any
arguments: it the database that <tt class="docutils literal"><span class="pre">pokedex</span> <span class="pre">load</span></tt> fills up by default. If you
need to select another database, give its URI as the first argument.</p>
<p>The object <tt class="xref py py-func docutils literal"><span class="pre">connect()</span></tt> gives you is actually a
<a class="reference external" href="http://www.sqlalchemy.org/docs/orm/session.html#sqlalchemy.orm.session.Session" title="(in SQLAlchemy v0.7)"><tt class="docutils literal"><span class="pre">sqlalchemy.orm.session.Session</span></tt></a>, giving you the
full power of SQLAlchemy for working with the data. We&#8217;ll cover some basics
here, but if you intend to do some serious work, do read SQLAlchemy&#8217;s docs.</p>
<p>XXX: write the rest of this</p>
<p>..:</p>
<div class="highlight-python"><pre>Pokédex tables
--------------
Data in the pokédex is organized in tables, defined in
:mod:`pokedex.db.tables`.
There is quite a few or them. To get you started, here are a few common ones:
* :class:`~pokedex.db.tables.Pokemon` (includes some alternate forms)
* :class:`~pokedex.db.tables.Move`
* :class:`~pokedex.db.tables.Item`
* :class:`~pokedex.db.tables.Type`
Getting things
--------------
If you know what you want from the pokédex, you can use the
:func:`pokedex.db.util.get` function. It looks up a thing in a table, based on
its identifier, name, or ID, and returns it.
.. testcode::
def print_pokemon(pokemon):
print u'{0.name}, the {0.genus} Pokemon'.format(pokemon)
print_pokemon(util.get(session, tables.PokemonSpecies, identifier='eevee'))
print_pokemon(util.get(session, tables.PokemonSpecies, name=u'Ho-Oh'))
print_pokemon(util.get(session, tables.PokemonSpecies, id=50))
def print_item(item):
print u'{0.name}: ${0.cost}'.format(item)
print_item(util.get(session, tables.Item, identifier='great-ball'))
print_item(util.get(session, tables.Item, name='Potion'))
print_item(util.get(session, tables.Item, id=30))
.. testoutput::
Eevee, the Evolution Pokemon
Ho-Oh, the Rainbow Pokemon
Diglett, the Mole Pokemon
Great Ball: $600
Potion: $300
Fresh Water: $200
.. :
Simple lists
------------
.. note::
These functions are only included for convenience in experiments and simple
scripts.
If you want to do something specific, please query the pokédex as explained
in the following sections.
If you want to get a simple list of pokémon without needing to worry about
things like the different forms and sorting the list, you can use the
:func:`pokedex.util.simple.pokemon` function.
.. testcode::
from pokedex.util import simple
for pokemon in simple.pokemon(session):
print u'{0.name}, the {0.species} Pokemon'.format(pokemon)
.. testoutput::
Bulbasaur, the Seed Pokemon
Ivysaur, the Seed Pokemon
...
Meloetta, the Melody Pokemon
Genesect, the Paleozoic Pokemon
Similar functions exist for :func:`~pokedex.util.simple.moves`,
:func:`~pokedex.util.simple.items` and :func:`~pokedex.util.simple.types`.
All of these give you quick simple lists, basically something a pokédex would
show you. They filter out things you probably won't need (such as Shadow moves
or duplicate Pokémon moves), and sort the results in some sane way, but they
can't guess your needs exactly, and their guesses might change in future
versions.
If you want to do some serious work with the pokédex, read on.
Querying
--------
So, how do you get data from the session? You use the session's
:meth:`~sqlalchemy.orm.session.Session.query` method, and give it a pokédex
Table as an argument. This will give you a :class:`SQLAlchemy query
&lt;sqlalchemy.orm.query.Query&gt;`.
To get you started, we'll cover some common query operations below. If you
need to do more, consult the `SQLAlchemy documentation`_.
Ordering
^^^^^^^^
As always with SQL, you should not rely on query results being in some
particular order unless you have ordered the query first. This means that
you'll likely want to sort every query you will make.
For example, you can get a list of all pokémon, sorted by their
:attr:`~pokedex.db.tables.Pokemon.order`, like so:
.. testcode::
for pokemon in session.query(tables.Pokemon).order_by(tables.Pokemon.order):
print pokemon.name
.. testoutput::
Bulbasaur
Ivysaur
Venusaur
Charmander
Charmeleon
...
Pichu
Pikachu
Raichu
...
Keldeo
Aria Meloetta
Pirouette Meloetta
Genesect
Ordering by name
****************
Since the pokédex can be used in other languages than English, working with
texts such as names is sometimes tricky.
The “name” attribute is actually a relation that uses the connection's
default language to select an appropriate translation. It usually works the
same way as a normal attribute, but ordering is an exception to this:
.. testcode::
for pokemon in session.query(tables.Pokemon).order_by(tables.Pokemon.name):
print pokemon.name
.. testoutput::
Traceback (most recent call last):
...
ArgumentError: SQL expression object or string expected.
This means that to order by name, you either have to explicitly join the
translation table and sort by that, or use
:func:`pokedex.db.util.order_by_name`:
.. testcode::
from pokedex.db import util
for pokemon in util.order_by_name(session.query(tables.Pokemon), tables.Pokemon):
print pokemon.name
.. testoutput::
Abomasnow
...
Zweilous
Filtering
^^^^^^^^^
Another major operation on queries is filtering, using the query's
:meth:`~sqlalchemy.orm.query.Query.filter` or
:meth:`~sqlalchemy.orm.query.Query.filter_by` methods:
.. testcode::
for move in session.query(tables.Move).filter(tables.Move.power &gt; 200):
print move.name
.. testoutput::
Explosion
Joining
^^^^^^^
The final operation we'll cover here is joining other tables to the query,
using the query's :meth:`~sqlalchemy.orm.query.Query.join`.
You will usually want to join on a relationship, such as in the following
example:
.. testcode::
query = session.query(tables.Move)
query = query.join(tables.Move.type)
query = query.filter(tables.Type.identifier == 'grass')
query = query.filter(tables.Move.power &gt;= 100)
query = query.order_by(tables.Move.power)
query = util.order_by_name(query, tables.Move)
print 'The most powerful Grass moves:'
for move in query:
print u'{0.name} ({0.power})'.format(move)
.. testoutput::
The most powerful Grass moves:
Petal Dance (120)
Power Whip (120)
Seed Flare (120)
SolarBeam (120)
Wood Hammer (120)
Leaf Storm (140)
Frenzy Plant (150)
API documentation
-----------------
.. autofunction:: pokedex.db.connect
See :class:`sqlalchemy.orm.session.Session` for more documentation on the
returned object.
.. autofunction:: pokedex.db.util.get
.. autofunction:: pokedex.db.util.order_by_name
Simple lists
^^^^^^^^^^^^
.. autofunction:: pokedex.util.simple.pokemon
.. autofunction:: pokedex.util.simple.moves
.. autofunction:: pokedex.util.simple.items
.. autofunction:: pokedex.util.simple.types
.. _Python: http://www.python.org
.. _SQLAlchemy: http://www.sqlalchemy.org
.. _`SQLAlchemy documentation`: http://www.sqlalchemy.org/docs/orm/tutorial.html</pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Using pokedex</a><ul>
<li><a class="reference internal" href="#connecting">Connecting</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="installing.html"
title="previous chapter">Installing the pokedex library</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="schema.html"
title="next chapter">The database schema</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/usage.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<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">
<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="schema.html" title="The database schema"
>next</a> |</li>
<li class="right" >
<a href="installing.html" title="Installing the pokedex library"
>previous</a> |</li>
<li><a href="index.html">pokedex v0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
</body>
</html>