diff --git a/.buildinfo b/.buildinfo new file mode 100644 index 0000000..29857e0 --- /dev/null +++ b/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 153e084ab45224784ab00e0403704869 +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.doctrees/comandos_bot.doctree b/.doctrees/comandos_bot.doctree new file mode 100644 index 0000000..077a509 Binary files /dev/null and b/.doctrees/comandos_bot.doctree differ diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle new file mode 100644 index 0000000..fc6a01a Binary files /dev/null and b/.doctrees/environment.pickle differ diff --git a/.doctrees/index.doctree b/.doctrees/index.doctree new file mode 100644 index 0000000..2d7b6df Binary files /dev/null and b/.doctrees/index.doctree differ diff --git a/.doctrees/instalacion_entorno.doctree b/.doctrees/instalacion_entorno.doctree new file mode 100644 index 0000000..0524e68 Binary files /dev/null and b/.doctrees/instalacion_entorno.doctree differ diff --git a/.doctrees/pycamp_bot.doctree b/.doctrees/pycamp_bot.doctree new file mode 100644 index 0000000..ca03475 Binary files /dev/null and b/.doctrees/pycamp_bot.doctree differ diff --git a/.doctrees/pycamp_bot/commands.doctree b/.doctrees/pycamp_bot/commands.doctree new file mode 100644 index 0000000..6e2509e Binary files /dev/null and b/.doctrees/pycamp_bot/commands.doctree differ diff --git a/.doctrees/pycamp_bot/commands/announcements.doctree b/.doctrees/pycamp_bot/commands/announcements.doctree new file mode 100644 index 0000000..b4f6fe7 Binary files /dev/null and b/.doctrees/pycamp_bot/commands/announcements.doctree differ diff --git a/.doctrees/pycamp_bot/commands/auth.doctree b/.doctrees/pycamp_bot/commands/auth.doctree new file mode 100644 index 0000000..fa98351 Binary files /dev/null and b/.doctrees/pycamp_bot/commands/auth.doctree differ diff --git a/.doctrees/pycamp_bot/commands/base.doctree b/.doctrees/pycamp_bot/commands/base.doctree new file mode 100644 index 0000000..3597375 Binary files /dev/null and b/.doctrees/pycamp_bot/commands/base.doctree differ diff --git a/.doctrees/pycamp_bot/commands/help_msg.doctree b/.doctrees/pycamp_bot/commands/help_msg.doctree new file mode 100644 index 0000000..103b9c4 Binary files /dev/null and b/.doctrees/pycamp_bot/commands/help_msg.doctree differ diff --git a/.doctrees/pycamp_bot/commands/manage_pycamp.doctree b/.doctrees/pycamp_bot/commands/manage_pycamp.doctree new file mode 100644 index 0000000..cf43d1d Binary files /dev/null and b/.doctrees/pycamp_bot/commands/manage_pycamp.doctree differ diff --git a/.doctrees/pycamp_bot/commands/projects.doctree b/.doctrees/pycamp_bot/commands/projects.doctree new file mode 100644 index 0000000..8115c60 Binary files /dev/null and b/.doctrees/pycamp_bot/commands/projects.doctree differ diff --git a/.doctrees/pycamp_bot/commands/raffle.doctree b/.doctrees/pycamp_bot/commands/raffle.doctree new file mode 100644 index 0000000..7b27def Binary files /dev/null and b/.doctrees/pycamp_bot/commands/raffle.doctree differ diff --git a/.doctrees/pycamp_bot/commands/schedule.doctree b/.doctrees/pycamp_bot/commands/schedule.doctree new file mode 100644 index 0000000..661ad63 Binary files /dev/null and b/.doctrees/pycamp_bot/commands/schedule.doctree differ diff --git a/.doctrees/pycamp_bot/commands/voting.doctree b/.doctrees/pycamp_bot/commands/voting.doctree new file mode 100644 index 0000000..8415cb4 Binary files /dev/null and b/.doctrees/pycamp_bot/commands/voting.doctree differ diff --git a/.doctrees/pycamp_bot/commands/wizard.doctree b/.doctrees/pycamp_bot/commands/wizard.doctree new file mode 100644 index 0000000..5108968 Binary files /dev/null and b/.doctrees/pycamp_bot/commands/wizard.doctree differ diff --git a/.doctrees/pycamp_bot/db_schemma.doctree b/.doctrees/pycamp_bot/db_schemma.doctree new file mode 100644 index 0000000..fd1c61d Binary files /dev/null and b/.doctrees/pycamp_bot/db_schemma.doctree differ diff --git a/.doctrees/pycamp_bot/models.doctree b/.doctrees/pycamp_bot/models.doctree new file mode 100644 index 0000000..f08d5c5 Binary files /dev/null and b/.doctrees/pycamp_bot/models.doctree differ diff --git a/.doctrees/pycamp_bot/scheduler.doctree b/.doctrees/pycamp_bot/scheduler.doctree new file mode 100644 index 0000000..1ecce0f Binary files /dev/null and b/.doctrees/pycamp_bot/scheduler.doctree differ diff --git a/.doctrees/pycamp_bot/scheduler/db_to_json.doctree b/.doctrees/pycamp_bot/scheduler/db_to_json.doctree new file mode 100644 index 0000000..993405f Binary files /dev/null and b/.doctrees/pycamp_bot/scheduler/db_to_json.doctree differ diff --git a/.doctrees/pycamp_bot/scheduler/schedule_calculator.doctree b/.doctrees/pycamp_bot/scheduler/schedule_calculator.doctree new file mode 100644 index 0000000..3a98a8c Binary files /dev/null and b/.doctrees/pycamp_bot/scheduler/schedule_calculator.doctree differ diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 61d9081..0000000 --- a/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length = 99 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 15e9f02..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Docs -on: [push, pull_request, workflow_dispatch] -permissions: - contents: write -jobs: - docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install '.[doc]' - - name: Sphinx build - run: | - sphinx-build -b html docs/source docs/build/html - - name: Deploy - uses: peaceiris/actions-gh-pages@v4 - # if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/testing' }} - with: - publish_branch: gh-pages - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/build/html - force_orphan: true diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml deleted file mode 100644 index c00f320..0000000 --- a/.github/workflows/pythonapp.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python application - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - TOKEN: foo - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install '.[dev]' - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0d3ebf6..0000000 --- a/.gitignore +++ /dev/null @@ -1,109 +0,0 @@ -# slots data -data.json -pycamp_projects.db -pycamp_projects.backup.db - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# dotenv -.env - -# virtualenv -.venv -venv/ -ENV/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - -# vscode -.vscode diff --git a/src/pycamp_bot/commands/__init__.py b/.nojekyll similarity index 100% rename from src/pycamp_bot/commands/__init__.py rename to .nojekyll diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index 011c23c..0000000 --- a/.pylintrc +++ /dev/null @@ -1,6 +0,0 @@ -[MESSAGES CONTROL] -disable= - C0103, # Doesn't conform to snake_case naming style - W0612, # Unused variable - W0621, # Redefined outer name - C0209 # Consider using f string diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index a6b7028..0000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,21 +0,0 @@ -version: 2 - -build: - os: ubuntu-22.04 - tools: - python: "3.10" - -python: - install: - - method: pip - path: . - extra_requirements: - - doc - system_packages: true - -sphinx: - configuration: docs/conf.py - -formats: - - epub - - pdf diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 9438710..0000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM python:3.10 - -USER root - -COPY . /pycamp/telegram_bot -WORKDIR /pycamp/telegram_bot -RUN pip3 install -U -e . - -CMD [ "python", "bin/run_bot.py" ] diff --git "a/Gu\303\255a ultra amigable para usar el bot.md" "b/Gu\303\255a ultra amigable para usar el bot.md" deleted file mode 100644 index 7ae270d..0000000 --- "a/Gu\303\255a ultra amigable para usar el bot.md" +++ /dev/null @@ -1,102 +0,0 @@ -# Guía ultra amigable para usar el bot del PyCamp - -Bienvenidx al PyCamp! 🎉 Si estás leyendo esto, seguramente querés aprovechar al máximo el bot de Telegram que nos ayuda a organizar todo. No te preocupes, es más fácil de lo que parece. Vamos paso a paso. - ---- - -## 🔍 Primeros pasos - -Antes que nada, asegurate de que el bot está funcionando: - -1. Hablale al bot en @PyCamp_bot. -2. Escribí `/start` la primera vez que le hablás para activarlo. -3. Dependiendo de tu rol (admin o pycampista), hay diferentes comandos que te pueden interesar. - ---- - -## 🤖 Para lxs admins: Poné en marcha el PyCamp - -Antes de empezar, necesitás configurar algunas cosas: - -1. Seteá estas variables de entorno: - - `TOKEN`: El token del bot (lo conseguís con BotFather en Telegram). - - `PYCAMP_BOT_MASTER_KEY`: Una clave secreta para los comandos de admin. - - `SENTRY_DATA_SOURCE_NAME`: El ID de Sentry para trackear errores. -2. Iniciá el bot con: `python bin/run_bot.py`. - -Listo, ahora podemos empezar con la magia. - -### 🌟 Inicialización del PyCamp - -- `/su ` ✨ Reclamá tus poderes de admin (reemplazá `` por la clave secreta). -- `/empezar_pycamp ` 🏢 Creá el PyCamp y definí su inicio y duración. -- `/activar_pycamp ` ⚡ Activalo (si hace falta). -- `/terminar_pycamp` 🌚 Cierra oficialmente el PyCamp. - -### 🤠 Organizando los proyectos - -- `/empezar_carga_proyectos` ✏️ Habilitá la carga de proyectos. -- `/terminar_carga_proyectos` ❌ Cerrá la carga de proyectos. -- `/empezar_votacion_proyectos` 🗳️ Arrancá la votación. -- `/terminar_votacion_proyectos` ❌ Cerrá la votación. -- `/contar_votos` 📊 Muestra cuánta gente votó. -- `/anunciar` 📢 Notifica a les interesades sobre el inicio de una actividad (solo admins y dueñxs del proyecto). - -### 🗓 Armando el cronograma - -- `/cronogramear` ⏳ Creá el cronograma con los días y slots que quieras. -- `/cambiar_slot ` ✏️ Mové un proyecto de horario. - -### 🎩 Agendando lxs magxs - -Los magos son personas geniales que ayudan durante el evento. Para organizarlos: - -- `/agendar_magx` 🌟 Asigna un mago por hora durante el PyCamp. -- Los magos se registran con `/ser_magx`. - -### 🔒 Administración del PyCamp - -- `/admins` 👤 Lista a todos los admins. -- `/agregar_pycamp ` ✅ Agrega un nuevo PyCamp. -- `/degradar ` ❌ Le saca los permisos de admin a un usuario. - ---- - -## 🥳 Para lxs Pycampistas: Cómo usar el bot - -Si no sos admin, igual podés usar el bot para participar activamente. - -### 💪 Participando en el PyCamp -- `/voy_al_pycamp ` 🌟 Avisá que vas al PyCamp. -- `/pycampistas` 👥 Mirá info sobre los pycampistas. -- `/pycamps` 📓 Lista todos los PyCamps. - -### 💡 Para los proyectos: -- `/cargar_proyecto` 📑 Cargá tu proyecto (si la carga está habilitada). -- `/proyectos` 📝 Muestra todos los proyectos y sus responsables. -- `/mis_proyectos` 📰 Muestra tus proyectos cargados. -- `/participantes ` 👥 Muestra la gente interesada en un proyecto. -- `/borrar_proyecto` ⛔️ Borra un proyecto. -- `/votar` 🗳️ Votá por los proyectos que te interesen. -- `/cronograma` 🗓 Mirá el cronograma de actividades. -- `/rifar` 🎯 Elegí un pycampista al azar. - -### 🤠 Para la magia del evento: -- `/ser_magx` 🎩 Registrate como mago. -- `/ver_magx` 🦄 Mirá quién es mago. -- `/evocar_magx` ✨ Llamá al mago de turno si necesitás ayuda. -- `/ver_agenda_magx` 🔍 Consultá la agenda de magos. - ---- - -### 🔧 Otros comandos - -- `/ayuda` ❓ Muestra esta ayuda. -- `/mostrar_version` 🔄 Muestra la versión del bot que está corriendo. - ---- - -Eso es todo! Si tenés dudas, preguntale a alguien del equipo o probá los comandos sin miedo. 😉 - -¡Que tengas un PyCamp genial! 🎉 - diff --git a/README.md b/README.md deleted file mode 100644 index 50c5c3c..0000000 --- a/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# Este es el bot del Pycamp - -## Documentación del módulo - -Puede encontrar una documentación mas detallada para programadores en [https://pyar.github.io/PyCamp_Bot](https://pyar.github.io/PyCamp_Bot) - -## Variables de entorno - -* TOKEN: Token del bot generado con BotFather. -* PYCAMP_BOT_MASTER_KEY: Password para agregar nuevos admins. -* SENTRY_DATA_SOURCE_NAME: ID de proyecto de Sentry para habilitar el monitoreo. - -## Development - -Si queres contribuir en este proyecto lo primero que vas a necesitar es crearte un bot para hacer -las pruebas. - -Esto lo podes hacer hablandole a @BotFather que es el "Bot padre de todos los bots" de telegram. -Él te a a guiar para que puedas hacer tu propio bot. - -Una vez creado el bot, deberías tener un TOKEN\_PERSONAL (BotFather te lo da en el mismo proceso de -creación). - -Despues instala el paquete en modo desarrollo en un virtual environment - -~~~bash -python3 -m venv venv -source venv/bin/activate -pip install -e '.[dev]' -~~~ - -y estas listo para trabajar. - -## Testeo - -Para correr el bot ejecutá (con el virtual environment activado): - -~~~bash -TOKEN='TOKEN_PERSONAL' PYCAMP_BOT_MASTER_KEY='KEY' python bin/run_bot.py -~~~ - -Y listo! Tu bot está corriendo en tu máquina, esperando que alguien le escriba por telegram. -Podés probarlo mandandole un `/start` - -## ¿Cómo usar el bot en un nuevo pycamp? - -Primero es necesario setear las siguientes variables de entorno: - -* `TOKEN`: token del bot que se usará durante el pycamp (gestionar desde telegram con BotFather) -* `PYCAMP_BOT_MASTER_KEY`: con alguna password secreta que se va a usar para acceder a comandos de superuser -* `SENTRY_DATA_SOURCE_NAME`: ID del proyecto de Sentry "telegrambot" de la cuenta de PyAr - -Una vez creadas las variables de entorno, correr el bot con el comando `python bin/run_bot.py` - -En este momento ya se puede hablar con el bot. ¿Qué le digo? - -* `/start` para chequear que esté andando bien - -### Flujo admin - -#### Inicialización (requerida al comienzo de cada PyCamp) - -* `/su ` para reclamar permisos de admin, reemplazando `` por la contraseña que hayamos elegido en la envvar `PYCAMP_BOT_MASTER_KEY` -* `/empezar_pycamp ` inicia el flujo de creación de un pycamp. Lo carga en la db, pide fecha de inicio y duración. Lo deja activo. - * `/activar_pycamp ` activa un pycamp, en caso que haga falta. - -#### Flujo de Proyectos - -* `/empezar_carga_proyectos` habilita la carga de los proyectos. En este punto los pycampistas pueden cargar sus proyectos, -enviandole al bot el comando `/cargar_proyecto` -* `/terminar_carga_proyectos` termina carga proyectos -* `/empezar_votacion_proyectos` activa la votacion (a partir de ahora los pycampistas pueden votar con `/votar`) -* `/terminar_votacion_proyectos` termina la votacion - -Para generar el schedule: - -* `/cronogramear` te va a preguntar cuantos dias queres cronogramear y cuantos slots por dia tenes y hacer el cronograma. -* `/cambiar_slot` toma un nombre de proyecto y un slot; y te cambia ese proyecto a ese slot. - -#### Flujo de magia - -Para agendar los magos todos los candidatos tienen que haberse registrado con `/ser_magx` - -* `/agendar_magx` Asigna un mago por hora durante todo el PyCamp. - * De 9 a 13 y de 14 a 19. - * El primer día arranca después del almuerzo (14hs). - * El último día termina al almuerzo (13hs). - -### Flujo pycampista - -* `/cargar_proyecto` carga un proyecto (si está habilitada la carga) -* `/votar` envia opciones para votar (si está habilitada la votacion) -* `/ver_cronograma` te muestra el cronograma! -* `/ser_magx` te registra como mago. -* `/ver_magx` Lista los magos registrados. -* `/evocar_magx` llama al mago de turno para pedirle ayuda. -* `/ver_agenda_magx completa` te muestra la agenda de magos del PyCamp. El parámetro `completa` es opcional, si se omite solo muestra los turnos pendientes. - diff --git a/docs/source/comandos_bot.rst b/_sources/comandos_bot.rst.txt similarity index 83% rename from docs/source/comandos_bot.rst rename to _sources/comandos_bot.rst.txt index a75c845..68994ca 100644 --- a/docs/source/comandos_bot.rst +++ b/_sources/comandos_bot.rst.txt @@ -9,12 +9,13 @@ Comandos de Administrador ------------------------- - ``/su ``: Reclama permisos de admin, la contraseña es la usada en la variable de entorno ``PYCAMP_BOT_MASTER_KEY``. +- ``/agregar_pycamp ``: Crea el PyCamp en la DB. - ``/activar_pycamp ``: Activa un Pycamp. - ``/empezar_pycamp``: Setea la fecha de inicio del pycamp activo. - ``/empezar_carga_proyectos``: Habilita la carga de los proyectos. En este punto los pycampistas pueden cargar sus proyectos, enviandole al bot el comando ``/cargar_proyecto``. - ``/terminar_carga_proyectos``: Termina carga proyectos. -- ``/empezar_votacion_proyectos``: Activa la votacion (a partir de ahora los pycampistas pueden votar con ``/votar``). -- ``/terminar_votacion_proyectos``: Termina la votacion. +- ``/empezar_votacion``: Activa la votacion (a partir de ahora los pycampistas pueden votar con ``/votar``). +- ``/terminar_votacion``: Termina la votacion. - ``/cronogramear``: Pregunta los dias y slot por día para poder crear el cronograma. - ``/cambiar_slot``: Toma un nombre de proyecto y un slot; y te cambia ese proyecto a ese slot. diff --git a/docs/source/index.rst b/_sources/index.rst.txt similarity index 100% rename from docs/source/index.rst rename to _sources/index.rst.txt diff --git a/docs/source/instalacion_entorno.rst b/_sources/instalacion_entorno.rst.txt similarity index 93% rename from docs/source/instalacion_entorno.rst rename to _sources/instalacion_entorno.rst.txt index ee5ab2a..4e852bb 100644 --- a/docs/source/instalacion_entorno.rst +++ b/_sources/instalacion_entorno.rst.txt @@ -58,18 +58,12 @@ Para ejecutar el bot primero contruya la imagen: docker build -t pycamp_bot:latest . -Ahora inicie el contenedor por primera vez: +Ahora inicie el contenedor: .. code-block:: bash docker run -e "TOKEN=TOKEN_PERSONAL" -e "PYCAMP_BOT_MASTER_KEY=KEY" -v ./:/pycamp/telegram_bot --name pycamp_telegram_bot pycamp_bot -Luego puede arrancar con: - -.. code-block:: bash - - docker start -ia pycamp_telegram_bot - Para ejecutar los test: .. code-block:: bash diff --git a/docs/source/pycamp_bot.rst b/_sources/pycamp_bot.rst.txt similarity index 85% rename from docs/source/pycamp_bot.rst rename to _sources/pycamp_bot.rst.txt index 03c87b5..84dc833 100644 --- a/docs/source/pycamp_bot.rst +++ b/_sources/pycamp_bot.rst.txt @@ -8,6 +8,7 @@ Archivos .. toctree:: :maxdepth: 2 + pycamp_bot/db_schemma pycamp_bot/models pycamp_bot/commands pycamp_bot/scheduler diff --git a/docs/source/pycamp_bot/commands.rst b/_sources/pycamp_bot/commands.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands.rst rename to _sources/pycamp_bot/commands.rst.txt diff --git a/docs/source/pycamp_bot/commands/announcements.rst b/_sources/pycamp_bot/commands/announcements.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands/announcements.rst rename to _sources/pycamp_bot/commands/announcements.rst.txt diff --git a/docs/source/pycamp_bot/commands/auth.rst b/_sources/pycamp_bot/commands/auth.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands/auth.rst rename to _sources/pycamp_bot/commands/auth.rst.txt diff --git a/docs/source/pycamp_bot/commands/base.rst b/_sources/pycamp_bot/commands/base.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands/base.rst rename to _sources/pycamp_bot/commands/base.rst.txt diff --git a/docs/source/pycamp_bot/commands/help_msg.rst b/_sources/pycamp_bot/commands/help_msg.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands/help_msg.rst rename to _sources/pycamp_bot/commands/help_msg.rst.txt diff --git a/docs/source/pycamp_bot/commands/manage_pycamp.rst b/_sources/pycamp_bot/commands/manage_pycamp.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands/manage_pycamp.rst rename to _sources/pycamp_bot/commands/manage_pycamp.rst.txt diff --git a/docs/source/pycamp_bot/commands/projects.rst b/_sources/pycamp_bot/commands/projects.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands/projects.rst rename to _sources/pycamp_bot/commands/projects.rst.txt diff --git a/docs/source/pycamp_bot/commands/raffle.rst b/_sources/pycamp_bot/commands/raffle.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands/raffle.rst rename to _sources/pycamp_bot/commands/raffle.rst.txt diff --git a/docs/source/pycamp_bot/commands/schedule.rst b/_sources/pycamp_bot/commands/schedule.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands/schedule.rst rename to _sources/pycamp_bot/commands/schedule.rst.txt diff --git a/docs/source/pycamp_bot/commands/voting.rst b/_sources/pycamp_bot/commands/voting.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands/voting.rst rename to _sources/pycamp_bot/commands/voting.rst.txt diff --git a/docs/source/pycamp_bot/commands/wizard.rst b/_sources/pycamp_bot/commands/wizard.rst.txt similarity index 100% rename from docs/source/pycamp_bot/commands/wizard.rst rename to _sources/pycamp_bot/commands/wizard.rst.txt diff --git a/_sources/pycamp_bot/db_schemma.rst.txt b/_sources/pycamp_bot/db_schemma.rst.txt new file mode 100644 index 0000000..be4add2 --- /dev/null +++ b/_sources/pycamp_bot/db_schemma.rst.txt @@ -0,0 +1,5 @@ +########## +db_schemma +########## + +.. automodule:: pycamp_bot.db_schemma diff --git a/docs/source/pycamp_bot/models.rst b/_sources/pycamp_bot/models.rst.txt similarity index 100% rename from docs/source/pycamp_bot/models.rst rename to _sources/pycamp_bot/models.rst.txt diff --git a/docs/source/pycamp_bot/scheduler.rst b/_sources/pycamp_bot/scheduler.rst.txt similarity index 100% rename from docs/source/pycamp_bot/scheduler.rst rename to _sources/pycamp_bot/scheduler.rst.txt diff --git a/docs/source/pycamp_bot/scheduler/db_to_json.rst b/_sources/pycamp_bot/scheduler/db_to_json.rst.txt similarity index 100% rename from docs/source/pycamp_bot/scheduler/db_to_json.rst rename to _sources/pycamp_bot/scheduler/db_to_json.rst.txt diff --git a/docs/source/pycamp_bot/scheduler/schedule_calculator.rst b/_sources/pycamp_bot/scheduler/schedule_calculator.rst.txt similarity index 100% rename from docs/source/pycamp_bot/scheduler/schedule_calculator.rst rename to _sources/pycamp_bot/scheduler/schedule_calculator.rst.txt diff --git a/_static/base-stemmer.js b/_static/base-stemmer.js new file mode 100644 index 0000000..ca6cca1 --- /dev/null +++ b/_static/base-stemmer.js @@ -0,0 +1,294 @@ +/**@constructor*/ +BaseStemmer = function() { + this.setCurrent = function(value) { + this.current = value; + this.cursor = 0; + this.limit = this.current.length; + this.limit_backward = 0; + this.bra = this.cursor; + this.ket = this.limit; + }; + + this.getCurrent = function() { + return this.current; + }; + + this.copy_from = function(other) { + this.current = other.current; + this.cursor = other.cursor; + this.limit = other.limit; + this.limit_backward = other.limit_backward; + this.bra = other.bra; + this.ket = other.ket; + }; + + this.in_grouping = function(s, min, max) { + if (this.cursor >= this.limit) return false; + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) return false; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false; + this.cursor++; + return true; + }; + + this.in_grouping_b = function(s, min, max) { + if (this.cursor <= this.limit_backward) return false; + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) return false; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false; + this.cursor--; + return true; + }; + + this.out_grouping = function(s, min, max) { + if (this.cursor >= this.limit) return false; + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) { + this.cursor++; + return true; + } + ch -= min; + if ((s[ch >>> 3] & (0X1 << (ch & 0x7))) == 0) { + this.cursor++; + return true; + } + return false; + }; + + this.out_grouping_b = function(s, min, max) { + if (this.cursor <= this.limit_backward) return false; + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) { + this.cursor--; + return true; + } + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) { + this.cursor--; + return true; + } + return false; + }; + + this.eq_s = function(s) + { + if (this.limit - this.cursor < s.length) return false; + if (this.current.slice(this.cursor, this.cursor + s.length) != s) + { + return false; + } + this.cursor += s.length; + return true; + }; + + this.eq_s_b = function(s) + { + if (this.cursor - this.limit_backward < s.length) return false; + if (this.current.slice(this.cursor - s.length, this.cursor) != s) + { + return false; + } + this.cursor -= s.length; + return true; + }; + + /** @return {number} */ this.find_among = function(v) + { + var i = 0; + var j = v.length; + + var c = this.cursor; + var l = this.limit; + + var common_i = 0; + var common_j = 0; + + var first_key_inspected = false; + + while (true) + { + var k = i + ((j - i) >>> 1); + var diff = 0; + var common = common_i < common_j ? common_i : common_j; // smaller + // w[0]: string, w[1]: substring_i, w[2]: result, w[3]: function (optional) + var w = v[k]; + var i2; + for (i2 = common; i2 < w[0].length; i2++) + { + if (c + common == l) + { + diff = -1; + break; + } + diff = this.current.charCodeAt(c + common) - w[0].charCodeAt(i2); + if (diff != 0) break; + common++; + } + if (diff < 0) + { + j = k; + common_j = common; + } + else + { + i = k; + common_i = common; + } + if (j - i <= 1) + { + if (i > 0) break; // v->s has been inspected + if (j == i) break; // only one item in v + + // - but now we need to go round once more to get + // v->s inspected. This looks messy, but is actually + // the optimal approach. + + if (first_key_inspected) break; + first_key_inspected = true; + } + } + do { + var w = v[i]; + if (common_i >= w[0].length) + { + this.cursor = c + w[0].length; + if (w.length < 4) return w[2]; + var res = w[3](this); + this.cursor = c + w[0].length; + if (res) return w[2]; + } + i = w[1]; + } while (i >= 0); + return 0; + }; + + // find_among_b is for backwards processing. Same comments apply + this.find_among_b = function(v) + { + var i = 0; + var j = v.length + + var c = this.cursor; + var lb = this.limit_backward; + + var common_i = 0; + var common_j = 0; + + var first_key_inspected = false; + + while (true) + { + var k = i + ((j - i) >> 1); + var diff = 0; + var common = common_i < common_j ? common_i : common_j; + var w = v[k]; + var i2; + for (i2 = w[0].length - 1 - common; i2 >= 0; i2--) + { + if (c - common == lb) + { + diff = -1; + break; + } + diff = this.current.charCodeAt(c - 1 - common) - w[0].charCodeAt(i2); + if (diff != 0) break; + common++; + } + if (diff < 0) + { + j = k; + common_j = common; + } + else + { + i = k; + common_i = common; + } + if (j - i <= 1) + { + if (i > 0) break; + if (j == i) break; + if (first_key_inspected) break; + first_key_inspected = true; + } + } + do { + var w = v[i]; + if (common_i >= w[0].length) + { + this.cursor = c - w[0].length; + if (w.length < 4) return w[2]; + var res = w[3](this); + this.cursor = c - w[0].length; + if (res) return w[2]; + } + i = w[1]; + } while (i >= 0); + return 0; + }; + + /* to replace chars between c_bra and c_ket in this.current by the + * chars in s. + */ + this.replace_s = function(c_bra, c_ket, s) + { + var adjustment = s.length - (c_ket - c_bra); + this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket); + this.limit += adjustment; + if (this.cursor >= c_ket) this.cursor += adjustment; + else if (this.cursor > c_bra) this.cursor = c_bra; + return adjustment; + }; + + this.slice_check = function() + { + if (this.bra < 0 || + this.bra > this.ket || + this.ket > this.limit || + this.limit > this.current.length) + { + return false; + } + return true; + }; + + this.slice_from = function(s) + { + var result = false; + if (this.slice_check()) + { + this.replace_s(this.bra, this.ket, s); + result = true; + } + return result; + }; + + this.slice_del = function() + { + return this.slice_from(""); + }; + + this.insert = function(c_bra, c_ket, s) + { + var adjustment = this.replace_s(c_bra, c_ket, s); + if (c_bra <= this.bra) this.bra += adjustment; + if (c_bra <= this.ket) this.ket += adjustment; + }; + + this.slice_to = function() + { + var result = ''; + if (this.slice_check()) + { + result = this.current.slice(this.bra, this.ket); + } + return result; + }; + + this.assign_to = function() + { + return this.current.slice(0, this.limit); + }; +}; diff --git a/_static/basic.css b/_static/basic.css new file mode 100644 index 0000000..7577acb --- /dev/null +++ b/_static/basic.css @@ -0,0 +1,903 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- 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%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.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%; + margin-left: auto; + margin-right: auto; +} + +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 ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +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; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 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; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- 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; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.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; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- 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; + } +} \ No newline at end of file diff --git a/_static/css/badge_only.css b/_static/css/badge_only.css new file mode 100644 index 0000000..c718cee --- /dev/null +++ b/_static/css/badge_only.css @@ -0,0 +1 @@ +.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} \ No newline at end of file diff --git a/_static/css/fonts/Roboto-Slab-Bold.woff b/_static/css/fonts/Roboto-Slab-Bold.woff new file mode 100644 index 0000000..6cb6000 Binary files /dev/null and b/_static/css/fonts/Roboto-Slab-Bold.woff differ diff --git a/_static/css/fonts/Roboto-Slab-Bold.woff2 b/_static/css/fonts/Roboto-Slab-Bold.woff2 new file mode 100644 index 0000000..7059e23 Binary files /dev/null and b/_static/css/fonts/Roboto-Slab-Bold.woff2 differ diff --git a/_static/css/fonts/Roboto-Slab-Regular.woff b/_static/css/fonts/Roboto-Slab-Regular.woff new file mode 100644 index 0000000..f815f63 Binary files /dev/null and b/_static/css/fonts/Roboto-Slab-Regular.woff differ diff --git a/_static/css/fonts/Roboto-Slab-Regular.woff2 b/_static/css/fonts/Roboto-Slab-Regular.woff2 new file mode 100644 index 0000000..f2c76e5 Binary files /dev/null and b/_static/css/fonts/Roboto-Slab-Regular.woff2 differ diff --git a/_static/css/fonts/fontawesome-webfont.eot b/_static/css/fonts/fontawesome-webfont.eot new file mode 100644 index 0000000..e9f60ca Binary files /dev/null and b/_static/css/fonts/fontawesome-webfont.eot differ diff --git a/_static/css/fonts/fontawesome-webfont.svg b/_static/css/fonts/fontawesome-webfont.svg new file mode 100644 index 0000000..855c845 --- /dev/null +++ b/_static/css/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_static/css/fonts/fontawesome-webfont.ttf b/_static/css/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..35acda2 Binary files /dev/null and b/_static/css/fonts/fontawesome-webfont.ttf differ diff --git a/_static/css/fonts/fontawesome-webfont.woff b/_static/css/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..400014a Binary files /dev/null and b/_static/css/fonts/fontawesome-webfont.woff differ diff --git a/_static/css/fonts/fontawesome-webfont.woff2 b/_static/css/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000..4d13fc6 Binary files /dev/null and b/_static/css/fonts/fontawesome-webfont.woff2 differ diff --git a/_static/css/fonts/lato-bold-italic.woff b/_static/css/fonts/lato-bold-italic.woff new file mode 100644 index 0000000..88ad05b Binary files /dev/null and b/_static/css/fonts/lato-bold-italic.woff differ diff --git a/_static/css/fonts/lato-bold-italic.woff2 b/_static/css/fonts/lato-bold-italic.woff2 new file mode 100644 index 0000000..c4e3d80 Binary files /dev/null and b/_static/css/fonts/lato-bold-italic.woff2 differ diff --git a/_static/css/fonts/lato-bold.woff b/_static/css/fonts/lato-bold.woff new file mode 100644 index 0000000..c6dff51 Binary files /dev/null and b/_static/css/fonts/lato-bold.woff differ diff --git a/_static/css/fonts/lato-bold.woff2 b/_static/css/fonts/lato-bold.woff2 new file mode 100644 index 0000000..bb19504 Binary files /dev/null and b/_static/css/fonts/lato-bold.woff2 differ diff --git a/_static/css/fonts/lato-normal-italic.woff b/_static/css/fonts/lato-normal-italic.woff new file mode 100644 index 0000000..76114bc Binary files /dev/null and b/_static/css/fonts/lato-normal-italic.woff differ diff --git a/_static/css/fonts/lato-normal-italic.woff2 b/_static/css/fonts/lato-normal-italic.woff2 new file mode 100644 index 0000000..3404f37 Binary files /dev/null and b/_static/css/fonts/lato-normal-italic.woff2 differ diff --git a/_static/css/fonts/lato-normal.woff b/_static/css/fonts/lato-normal.woff new file mode 100644 index 0000000..ae1307f Binary files /dev/null and b/_static/css/fonts/lato-normal.woff differ diff --git a/_static/css/fonts/lato-normal.woff2 b/_static/css/fonts/lato-normal.woff2 new file mode 100644 index 0000000..3bf9843 Binary files /dev/null and b/_static/css/fonts/lato-normal.woff2 differ diff --git a/_static/css/theme.css b/_static/css/theme.css new file mode 100644 index 0000000..c03c88f --- /dev/null +++ b/_static/css/theme.css @@ -0,0 +1,4 @@ +html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs>li{display:inline-block;padding-top:5px}.wy-breadcrumbs>li.wy-breadcrumbs-aside{float:right}.rst-content .wy-breadcrumbs>li code,.rst-content .wy-breadcrumbs>li tt,.wy-breadcrumbs>li .rst-content tt,.wy-breadcrumbs>li code{all:inherit;color:inherit}.breadcrumb-item:before{content:"/";color:#bbb;font-size:13px;padding:0 6px 0 3px}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search>a:hover{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content p a{overflow-wrap:anywhere}.rst-content .wy-table td p,.rst-content .wy-table td ul,.rst-content .wy-table th p,.rst-content .wy-table th ul,.rst-content table.docutils td p,.rst-content table.docutils td ul,.rst-content table.docutils th p,.rst-content table.docutils th ul,.rst-content table.field-list td p,.rst-content table.field-list td ul,.rst-content table.field-list th p,.rst-content table.field-list th ul{font-size:inherit}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .citation-reference>span.fn-bracket,.rst-content .footnote-reference>span.fn-bracket{display:none}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:auto minmax(80%,95%)}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{display:inline-grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{display:grid;grid-template-columns:auto auto minmax(.65rem,auto) minmax(40%,95%)}html.writer-html5 .rst-content aside.citation>span.label,html.writer-html5 .rst-content aside.footnote>span.label,html.writer-html5 .rst-content div.citation>span.label{grid-column-start:1;grid-column-end:2}html.writer-html5 .rst-content aside.citation>span.backrefs,html.writer-html5 .rst-content aside.footnote>span.backrefs,html.writer-html5 .rst-content div.citation>span.backrefs{grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:3}html.writer-html5 .rst-content aside.citation>p,html.writer-html5 .rst-content aside.footnote>p,html.writer-html5 .rst-content div.citation>p{grid-column-start:4;grid-column-end:5}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{margin-bottom:24px}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.citation>dt>span.brackets:before,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.citation>dt>span.brackets:after,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a{word-break:keep-all}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a:not(:first-child):before,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.citation>dd p,html.writer-html5 .rst-content dl.footnote>dd p{font-size:.9rem}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{padding-left:1rem;padding-right:1rem;font-size:.9rem;line-height:1.2rem}html.writer-html5 .rst-content aside.citation p,html.writer-html5 .rst-content aside.footnote p,html.writer-html5 .rst-content div.citation p{font-size:.9rem;line-height:1.2rem;margin-bottom:12px}html.writer-html5 .rst-content aside.citation span.backrefs,html.writer-html5 .rst-content aside.footnote span.backrefs,html.writer-html5 .rst-content div.citation span.backrefs{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content aside.citation span.backrefs>a,html.writer-html5 .rst-content aside.footnote span.backrefs>a,html.writer-html5 .rst-content div.citation span.backrefs>a{word-break:keep-all}html.writer-html5 .rst-content aside.citation span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content aside.footnote span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content div.citation span.backrefs>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content aside.citation span.label,html.writer-html5 .rst-content aside.footnote span.label,html.writer-html5 .rst-content div.citation span.label{line-height:1.2rem}html.writer-html5 .rst-content aside.citation-list,html.writer-html5 .rst-content aside.footnote-list,html.writer-html5 .rst-content div.citation-list{margin-bottom:24px}html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content aside.footnote-list aside.footnote,html.writer-html5 .rst-content div.citation-list>div.citation,html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content aside.footnote-list aside.footnote code,html.writer-html5 .rst-content aside.footnote-list aside.footnote tt,html.writer-html5 .rst-content aside.footnote code,html.writer-html5 .rst-content aside.footnote tt,html.writer-html5 .rst-content div.citation-list>div.citation code,html.writer-html5 .rst-content div.citation-list>div.citation tt,html.writer-html5 .rst-content dl.citation code,html.writer-html5 .rst-content dl.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040;overflow-wrap:normal}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl dd>ol:last-child,.rst-content dl dd>p:last-child,.rst-content dl dd>table:last-child,.rst-content dl dd>ul:last-child{margin-bottom:0}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel{border:1px solid #7fbbe3;background:#e7f2fa;font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>.kbd,.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>kbd{color:inherit;font-size:80%;background-color:#fff;border:1px solid #a6a6a6;border-radius:4px;box-shadow:0 2px grey;padding:2.4px 6px;margin:auto 0}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} \ No newline at end of file diff --git a/_static/doctools.js b/_static/doctools.js new file mode 100644 index 0000000..d06a71d --- /dev/null +++ b/_static/doctools.js @@ -0,0 +1,156 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Base JavaScript utilities for all Sphinx HTML documentation. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (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: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/_static/documentation_options.js b/_static/documentation_options.js new file mode 100644 index 0000000..98a494a --- /dev/null +++ b/_static/documentation_options.js @@ -0,0 +1,14 @@ +var DOCUMENTATION_OPTIONS = { + URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), + VERSION: '3.0.0', + LANGUAGE: 'es', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/_static/file.png b/_static/file.png new file mode 100644 index 0000000..a858a41 Binary files /dev/null and b/_static/file.png differ diff --git a/_static/js/badge_only.js b/_static/js/badge_only.js new file mode 100644 index 0000000..526d723 --- /dev/null +++ b/_static/js/badge_only.js @@ -0,0 +1 @@ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}}); \ No newline at end of file diff --git a/_static/js/html5shiv-printshiv.min.js b/_static/js/html5shiv-printshiv.min.js new file mode 100644 index 0000000..2b43bd0 --- /dev/null +++ b/_static/js/html5shiv-printshiv.min.js @@ -0,0 +1,4 @@ +/** +* @preserve HTML5 Shiv 3.7.3-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document); \ No newline at end of file diff --git a/_static/js/html5shiv.min.js b/_static/js/html5shiv.min.js new file mode 100644 index 0000000..cd1c674 --- /dev/null +++ b/_static/js/html5shiv.min.js @@ -0,0 +1,4 @@ +/** +* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); \ No newline at end of file diff --git a/_static/js/theme.js b/_static/js/theme.js new file mode 100644 index 0000000..1fddb6e --- /dev/null +++ b/_static/js/theme.js @@ -0,0 +1 @@ +!function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e="undefined"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on("hashchange",t.reset),n&&t.win.on("scroll",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on("resize",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",(function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")})).on("click",".wy-menu-vertical .current ul li a",(function(){var t=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(t),e.hashChange()})).on("click","[data-toggle='rst-current-version']",(function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")})),n("table.docutils:not(.field-list,.footnote,.citation)").wrap("
"),n("table.docutils.footnote").wrap("
"),n("table.docutils.citation").wrap("
"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n(''),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}if(t.length>0){$(".wy-menu-vertical .current").removeClass("current").attr("aria-expanded","false"),t.addClass("current").attr("aria-expanded","true"),t.closest("li.toctree-l1").parent().addClass("current").attr("aria-expanded","true");for(let n=1;n<=10;n++)t.closest("li.toctree-l"+n).addClass("current").attr("aria-expanded","true");t[0].scrollIntoView()}}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current").attr("aria-expanded","false"),e.siblings().find("li.current").removeClass("current").attr("aria-expanded","false");var t=e.find("> ul li");t.length&&(t.removeClass("current").attr("aria-expanded","false"),e.toggleClass("current").attr("aria-expanded",(function(n,e){return"true"==e?"false":"true"})))}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t=this.limit)return false;var s=this.current.charCodeAt(this.cursor);if(s>i||s>>3]&1<<(s&7))==0)return false;this.cursor++;return true};this.in_grouping_b=function(r,t,i){if(this.cursor<=this.limit_backward)return false;var s=this.current.charCodeAt(this.cursor-1);if(s>i||s>>3]&1<<(s&7))==0)return false;this.cursor--;return true};this.out_grouping=function(r,t,i){if(this.cursor>=this.limit)return false;var s=this.current.charCodeAt(this.cursor);if(s>i||s>>3]&1<<(s&7))==0){this.cursor++;return true}return false};this.out_grouping_b=function(r,t,i){if(this.cursor<=this.limit_backward)return false;var s=this.current.charCodeAt(this.cursor-1);if(s>i||s>>3]&1<<(s&7))==0){this.cursor--;return true}return false};this.eq_s=function(r){if(this.limit-this.cursor>>1);var a=0;var f=h0)break;if(i==t)break;if(n)break;n=true}}do{var l=r[t];if(h>=l[0].length){this.cursor=s+l[0].length;if(l.length<4)return l[2];var v=l[3](this);this.cursor=s+l[0].length;if(v)return l[2]}t=l[1]}while(t>=0);return 0};this.find_among_b=function(r){var t=0;var i=r.length;var s=this.cursor;var e=this.limit_backward;var h=0;var u=0;var n=false;while(true){var c=t+(i-t>>1);var a=0;var f=h=0;o--){if(s-f==e){a=-1;break}a=this.current.charCodeAt(s-1-f)-l[0].charCodeAt(o);if(a!=0)break;f++}if(a<0){i=c;u=f}else{t=c;h=f}if(i-t<=1){if(t>0)break;if(i==t)break;if(n)break;n=true}}do{var l=r[t];if(h>=l[0].length){this.cursor=s-l[0].length;if(l.length<4)return l[2];var v=l[3](this);this.cursor=s-l[0].length;if(v)return l[2]}t=l[1]}while(t>=0);return 0};this.replace_s=function(r,t,i){var s=i.length-(t-r);this.current=this.current.slice(0,r)+i+this.current.slice(t);this.limit+=s;if(this.cursor>=t)this.cursor+=s;else if(this.cursor>r)this.cursor=r;return s};this.slice_check=function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>this.current.length){return false}return true};this.slice_from=function(r){var t=false;if(this.slice_check()){this.replace_s(this.bra,this.ket,r);t=true}return t};this.slice_del=function(){return this.slice_from("")};this.insert=function(r,t,i){var s=this.replace_s(r,t,i);if(r<=this.bra)this.bra+=s;if(r<=this.ket)this.ket+=s};this.slice_to=function(){var r="";if(this.slice_check()){r=this.current.slice(this.bra,this.ket)}return r};this.assign_to=function(){return this.current.slice(0,this.limit)}}; +SpanishStemmer=function(){var r=new BaseStemmer;var e=[["",-1,6],["á",0,1],["é",0,2],["í",0,3],["ó",0,4],["ú",0,5]];var i=[["la",-1,-1],["sela",0,-1],["le",-1,-1],["me",-1,-1],["se",-1,-1],["lo",-1,-1],["selo",5,-1],["las",-1,-1],["selas",7,-1],["les",-1,-1],["los",-1,-1],["selos",10,-1],["nos",-1,-1]];var a=[["ando",-1,6],["iendo",-1,6],["yendo",-1,7],["ándo",-1,2],["iéndo",-1,1],["ar",-1,6],["er",-1,6],["ir",-1,6],["ár",-1,3],["ér",-1,4],["ír",-1,5]];var s=[["ic",-1,-1],["ad",-1,-1],["os",-1,-1],["iv",-1,1]];var u=[["able",-1,1],["ible",-1,1],["ante",-1,1]];var o=[["ic",-1,1],["abil",-1,1],["iv",-1,1]];var t=[["ica",-1,1],["ancia",-1,2],["encia",-1,5],["adora",-1,2],["osa",-1,1],["ista",-1,1],["iva",-1,9],["anza",-1,1],["logía",-1,3],["idad",-1,8],["able",-1,1],["ible",-1,1],["ante",-1,2],["mente",-1,7],["amente",13,6],["ación",-1,2],["ución",-1,4],["ico",-1,1],["ismo",-1,1],["oso",-1,1],["amiento",-1,1],["imiento",-1,1],["ivo",-1,9],["ador",-1,2],["icas",-1,1],["ancias",-1,2],["encias",-1,5],["adoras",-1,2],["osas",-1,1],["istas",-1,1],["ivas",-1,9],["anzas",-1,1],["logías",-1,3],["idades",-1,8],["ables",-1,1],["ibles",-1,1],["aciones",-1,2],["uciones",-1,4],["adores",-1,2],["antes",-1,2],["icos",-1,1],["ismos",-1,1],["osos",-1,1],["amientos",-1,1],["imientos",-1,1],["ivos",-1,9]];var c=[["ya",-1,1],["ye",-1,1],["yan",-1,1],["yen",-1,1],["yeron",-1,1],["yendo",-1,1],["yo",-1,1],["yas",-1,1],["yes",-1,1],["yais",-1,1],["yamos",-1,1],["yó",-1,1]];var l=[["aba",-1,2],["ada",-1,2],["ida",-1,2],["ara",-1,2],["iera",-1,2],["ía",-1,2],["aría",5,2],["ería",5,2],["iría",5,2],["ad",-1,2],["ed",-1,2],["id",-1,2],["ase",-1,2],["iese",-1,2],["aste",-1,2],["iste",-1,2],["an",-1,2],["aban",16,2],["aran",16,2],["ieran",16,2],["ían",16,2],["arían",20,2],["erían",20,2],["irían",20,2],["en",-1,1],["asen",24,2],["iesen",24,2],["aron",-1,2],["ieron",-1,2],["arán",-1,2],["erán",-1,2],["irán",-1,2],["ado",-1,2],["ido",-1,2],["ando",-1,2],["iendo",-1,2],["ar",-1,2],["er",-1,2],["ir",-1,2],["as",-1,2],["abas",39,2],["adas",39,2],["idas",39,2],["aras",39,2],["ieras",39,2],["ías",39,2],["arías",45,2],["erías",45,2],["irías",45,2],["es",-1,1],["ases",49,2],["ieses",49,2],["abais",-1,2],["arais",-1,2],["ierais",-1,2],["íais",-1,2],["aríais",55,2],["eríais",55,2],["iríais",55,2],["aseis",-1,2],["ieseis",-1,2],["asteis",-1,2],["isteis",-1,2],["áis",-1,2],["éis",-1,1],["aréis",64,2],["eréis",64,2],["iréis",64,2],["ados",-1,2],["idos",-1,2],["amos",-1,2],["ábamos",70,2],["áramos",70,2],["iéramos",70,2],["íamos",70,2],["aríamos",74,2],["eríamos",74,2],["iríamos",74,2],["emos",-1,1],["aremos",78,2],["eremos",78,2],["iremos",78,2],["ásemos",78,2],["iésemos",78,2],["imos",-1,2],["arás",-1,2],["erás",-1,2],["irás",-1,2],["ís",-1,2],["ará",-1,2],["erá",-1,2],["irá",-1,2],["aré",-1,2],["eré",-1,2],["iré",-1,2],["ió",-1,2]];var f=[["a",-1,1],["e",-1,2],["o",-1,1],["os",-1,1],["á",-1,1],["é",-1,2],["í",-1,1],["ó",-1,1]];var n=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,17,4,10];var b=0;var m=0;var k=0;function _(){k=r.limit;m=r.limit;b=r.limit;var e=r.cursor;r:{e:{var i=r.cursor;i:{if(!r.in_grouping(n,97,252)){break i}a:{var a=r.cursor;s:{if(!r.out_grouping(n,97,252)){break s}u:while(true){o:{if(!r.in_grouping(n,97,252)){break o}break u}if(r.cursor>=r.limit){break s}r.cursor++}break a}r.cursor=a;if(!r.in_grouping(n,97,252)){break i}s:while(true){u:{if(!r.out_grouping(n,97,252)){break u}break s}if(r.cursor>=r.limit){break i}r.cursor++}}break e}r.cursor=i;if(!r.out_grouping(n,97,252)){break r}i:{var s=r.cursor;a:{if(!r.out_grouping(n,97,252)){break a}s:while(true){u:{if(!r.in_grouping(n,97,252)){break u}break s}if(r.cursor>=r.limit){break a}r.cursor++}break i}r.cursor=s;if(!r.in_grouping(n,97,252)){break r}if(r.cursor>=r.limit){break r}r.cursor++}}k=r.cursor}r.cursor=e;var u=r.cursor;r:{e:while(true){i:{if(!r.in_grouping(n,97,252)){break i}break e}if(r.cursor>=r.limit){break r}r.cursor++}e:while(true){i:{if(!r.out_grouping(n,97,252)){break i}break e}if(r.cursor>=r.limit){break r}r.cursor++}m=r.cursor;e:while(true){i:{if(!r.in_grouping(n,97,252)){break i}break e}if(r.cursor>=r.limit){break r}r.cursor++}e:while(true){i:{if(!r.out_grouping(n,97,252)){break i}break e}if(r.cursor>=r.limit){break r}r.cursor++}b=r.cursor}r.cursor=u;return true}function d(){var i;while(true){var a=r.cursor;r:{r.bra=r.cursor;i=r.find_among(e);if(i==0){break r}r.ket=r.cursor;switch(i){case 1:if(!r.slice_from("a")){return false}break;case 2:if(!r.slice_from("e")){return false}break;case 3:if(!r.slice_from("i")){return false}break;case 4:if(!r.slice_from("o")){return false}break;case 5:if(!r.slice_from("u")){return false}break;case 6:if(r.cursor>=r.limit){break r}r.cursor++;break}continue}r.cursor=a;break}return true}function v(){if(!(k<=r.cursor)){return false}return true}function g(){if(!(m<=r.cursor)){return false}return true}function w(){if(!(b<=r.cursor)){return false}return true}function h(){var e;r.ket=r.cursor;if(r.find_among_b(i)==0){return false}r.bra=r.cursor;e=r.find_among_b(a);if(e==0){return false}if(!v()){return false}switch(e){case 1:r.bra=r.cursor;if(!r.slice_from("iendo")){return false}break;case 2:r.bra=r.cursor;if(!r.slice_from("ando")){return false}break;case 3:r.bra=r.cursor;if(!r.slice_from("ar")){return false}break;case 4:r.bra=r.cursor;if(!r.slice_from("er")){return false}break;case 5:r.bra=r.cursor;if(!r.slice_from("ir")){return false}break;case 6:if(!r.slice_del()){return false}break;case 7:if(!r.eq_s_b("u")){return false}if(!r.slice_del()){return false}break}return true}function p(){var e;r.ket=r.cursor;e=r.find_among_b(t);if(e==0){return false}r.bra=r.cursor;switch(e){case 1:if(!w()){return false}if(!r.slice_del()){return false}break;case 2:if(!w()){return false}if(!r.slice_del()){return false}var i=r.limit-r.cursor;r:{r.ket=r.cursor;if(!r.eq_s_b("ic")){r.cursor=r.limit-i;break r}r.bra=r.cursor;if(!w()){r.cursor=r.limit-i;break r}if(!r.slice_del()){return false}}break;case 3:if(!w()){return false}if(!r.slice_from("log")){return false}break;case 4:if(!w()){return false}if(!r.slice_from("u")){return false}break;case 5:if(!w()){return false}if(!r.slice_from("ente")){return false}break;case 6:if(!g()){return false}if(!r.slice_del()){return false}var a=r.limit-r.cursor;r:{r.ket=r.cursor;e=r.find_among_b(s);if(e==0){r.cursor=r.limit-a;break r}r.bra=r.cursor;if(!w()){r.cursor=r.limit-a;break r}if(!r.slice_del()){return false}switch(e){case 1:r.ket=r.cursor;if(!r.eq_s_b("at")){r.cursor=r.limit-a;break r}r.bra=r.cursor;if(!w()){r.cursor=r.limit-a;break r}if(!r.slice_del()){return false}break}}break;case 7:if(!w()){return false}if(!r.slice_del()){return false}var c=r.limit-r.cursor;r:{r.ket=r.cursor;if(r.find_among_b(u)==0){r.cursor=r.limit-c;break r}r.bra=r.cursor;if(!w()){r.cursor=r.limit-c;break r}if(!r.slice_del()){return false}}break;case 8:if(!w()){return false}if(!r.slice_del()){return false}var l=r.limit-r.cursor;r:{r.ket=r.cursor;if(r.find_among_b(o)==0){r.cursor=r.limit-l;break r}r.bra=r.cursor;if(!w()){r.cursor=r.limit-l;break r}if(!r.slice_del()){return false}}break;case 9:if(!w()){return false}if(!r.slice_del()){return false}var f=r.limit-r.cursor;r:{r.ket=r.cursor;if(!r.eq_s_b("at")){r.cursor=r.limit-f;break r}r.bra=r.cursor;if(!w()){r.cursor=r.limit-f;break r}if(!r.slice_del()){return false}}break}return true}function y(){if(r.cursor { + const [docname, title, anchor, descr, score, filename] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _displayItem = (item, searchTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + + const [docName, title, anchor, descr, score, _filename] = item; + + let listItem = document.createElement("li"); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = docUrlRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = docUrlRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = title; + if (descr) + listItem.appendChild(document.createElement("span")).innerHTML = + " (" + descr + ")"; + else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms) + ); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "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.innerText = _( + `Search finished, found ${resultCount} page(s) matching the search query.` + ); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms), + 5 + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter(term => term) // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString) => { + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent !== undefined) return docContent.textContent; + console.warn( + "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + /** + * execute search (requires search index to be loaded) + */ + query: (query) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords array is from language_data.js + if ( + stopwords.indexOf(queryTermLower) !== -1 || + queryTerm.match(/^\d+$/) + ) + return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + // array of [docname, title, anchor, descr, score, filename] + let results = []; + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + let score = Math.round(100 * queryLower.length / title.length) + results.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id] of foundEntries) { + let score = Math.round(100 * queryLower.length / entry.length) + results.push([ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // lookup as object + objectTerms.forEach((term) => + results.push(...Search.performObjectSearch(term, objectTerms)) + ); + + // lookup as search terms in fulltext + results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); + + // now sort the results by score (in opposite order of appearance, since the + // display function below uses pop() to retrieve items) and then + // alphabetically + results.sort((a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; + }); + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + results = results.reverse(); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4] + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => + objectSearchCallback(prefix, array) + ) + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + const arr = [ + { files: terms[word], score: Scorer.term }, + { files: titleTerms[word], score: Scorer.title }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord) && !terms[word]) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord) && !titleTerms[word]) + arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); + }); + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, {}); + scoreMap.get(file)[word] = record.score; + }); + }); + + // create the mapping + files.forEach((file) => { + if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); + else fileMap.set(file, [word]); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2 + ).length; + if ( + wordList.length !== searchTerms.size && + wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file || + titleTerms[term] === file || + (terms[term] || []).includes(file) || + (titleTerms[term] || []).includes(file) + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w])); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords) => { + const text = Search.htmlToText(htmlText); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/_static/spanish-stemmer.js b/_static/spanish-stemmer.js new file mode 100644 index 0000000..fffd616 --- /dev/null +++ b/_static/spanish-stemmer.js @@ -0,0 +1,990 @@ +// Generated by Snowball 2.1.0 - https://snowballstem.org/ + +/**@constructor*/ +SpanishStemmer = function() { + var base = new BaseStemmer(); + /** @const */ var a_0 = [ + ["", -1, 6], + ["\u00E1", 0, 1], + ["\u00E9", 0, 2], + ["\u00ED", 0, 3], + ["\u00F3", 0, 4], + ["\u00FA", 0, 5] + ]; + + /** @const */ var a_1 = [ + ["la", -1, -1], + ["sela", 0, -1], + ["le", -1, -1], + ["me", -1, -1], + ["se", -1, -1], + ["lo", -1, -1], + ["selo", 5, -1], + ["las", -1, -1], + ["selas", 7, -1], + ["les", -1, -1], + ["los", -1, -1], + ["selos", 10, -1], + ["nos", -1, -1] + ]; + + /** @const */ var a_2 = [ + ["ando", -1, 6], + ["iendo", -1, 6], + ["yendo", -1, 7], + ["\u00E1ndo", -1, 2], + ["i\u00E9ndo", -1, 1], + ["ar", -1, 6], + ["er", -1, 6], + ["ir", -1, 6], + ["\u00E1r", -1, 3], + ["\u00E9r", -1, 4], + ["\u00EDr", -1, 5] + ]; + + /** @const */ var a_3 = [ + ["ic", -1, -1], + ["ad", -1, -1], + ["os", -1, -1], + ["iv", -1, 1] + ]; + + /** @const */ var a_4 = [ + ["able", -1, 1], + ["ible", -1, 1], + ["ante", -1, 1] + ]; + + /** @const */ var a_5 = [ + ["ic", -1, 1], + ["abil", -1, 1], + ["iv", -1, 1] + ]; + + /** @const */ var a_6 = [ + ["ica", -1, 1], + ["ancia", -1, 2], + ["encia", -1, 5], + ["adora", -1, 2], + ["osa", -1, 1], + ["ista", -1, 1], + ["iva", -1, 9], + ["anza", -1, 1], + ["log\u00EDa", -1, 3], + ["idad", -1, 8], + ["able", -1, 1], + ["ible", -1, 1], + ["ante", -1, 2], + ["mente", -1, 7], + ["amente", 13, 6], + ["aci\u00F3n", -1, 2], + ["uci\u00F3n", -1, 4], + ["ico", -1, 1], + ["ismo", -1, 1], + ["oso", -1, 1], + ["amiento", -1, 1], + ["imiento", -1, 1], + ["ivo", -1, 9], + ["ador", -1, 2], + ["icas", -1, 1], + ["ancias", -1, 2], + ["encias", -1, 5], + ["adoras", -1, 2], + ["osas", -1, 1], + ["istas", -1, 1], + ["ivas", -1, 9], + ["anzas", -1, 1], + ["log\u00EDas", -1, 3], + ["idades", -1, 8], + ["ables", -1, 1], + ["ibles", -1, 1], + ["aciones", -1, 2], + ["uciones", -1, 4], + ["adores", -1, 2], + ["antes", -1, 2], + ["icos", -1, 1], + ["ismos", -1, 1], + ["osos", -1, 1], + ["amientos", -1, 1], + ["imientos", -1, 1], + ["ivos", -1, 9] + ]; + + /** @const */ var a_7 = [ + ["ya", -1, 1], + ["ye", -1, 1], + ["yan", -1, 1], + ["yen", -1, 1], + ["yeron", -1, 1], + ["yendo", -1, 1], + ["yo", -1, 1], + ["yas", -1, 1], + ["yes", -1, 1], + ["yais", -1, 1], + ["yamos", -1, 1], + ["y\u00F3", -1, 1] + ]; + + /** @const */ var a_8 = [ + ["aba", -1, 2], + ["ada", -1, 2], + ["ida", -1, 2], + ["ara", -1, 2], + ["iera", -1, 2], + ["\u00EDa", -1, 2], + ["ar\u00EDa", 5, 2], + ["er\u00EDa", 5, 2], + ["ir\u00EDa", 5, 2], + ["ad", -1, 2], + ["ed", -1, 2], + ["id", -1, 2], + ["ase", -1, 2], + ["iese", -1, 2], + ["aste", -1, 2], + ["iste", -1, 2], + ["an", -1, 2], + ["aban", 16, 2], + ["aran", 16, 2], + ["ieran", 16, 2], + ["\u00EDan", 16, 2], + ["ar\u00EDan", 20, 2], + ["er\u00EDan", 20, 2], + ["ir\u00EDan", 20, 2], + ["en", -1, 1], + ["asen", 24, 2], + ["iesen", 24, 2], + ["aron", -1, 2], + ["ieron", -1, 2], + ["ar\u00E1n", -1, 2], + ["er\u00E1n", -1, 2], + ["ir\u00E1n", -1, 2], + ["ado", -1, 2], + ["ido", -1, 2], + ["ando", -1, 2], + ["iendo", -1, 2], + ["ar", -1, 2], + ["er", -1, 2], + ["ir", -1, 2], + ["as", -1, 2], + ["abas", 39, 2], + ["adas", 39, 2], + ["idas", 39, 2], + ["aras", 39, 2], + ["ieras", 39, 2], + ["\u00EDas", 39, 2], + ["ar\u00EDas", 45, 2], + ["er\u00EDas", 45, 2], + ["ir\u00EDas", 45, 2], + ["es", -1, 1], + ["ases", 49, 2], + ["ieses", 49, 2], + ["abais", -1, 2], + ["arais", -1, 2], + ["ierais", -1, 2], + ["\u00EDais", -1, 2], + ["ar\u00EDais", 55, 2], + ["er\u00EDais", 55, 2], + ["ir\u00EDais", 55, 2], + ["aseis", -1, 2], + ["ieseis", -1, 2], + ["asteis", -1, 2], + ["isteis", -1, 2], + ["\u00E1is", -1, 2], + ["\u00E9is", -1, 1], + ["ar\u00E9is", 64, 2], + ["er\u00E9is", 64, 2], + ["ir\u00E9is", 64, 2], + ["ados", -1, 2], + ["idos", -1, 2], + ["amos", -1, 2], + ["\u00E1bamos", 70, 2], + ["\u00E1ramos", 70, 2], + ["i\u00E9ramos", 70, 2], + ["\u00EDamos", 70, 2], + ["ar\u00EDamos", 74, 2], + ["er\u00EDamos", 74, 2], + ["ir\u00EDamos", 74, 2], + ["emos", -1, 1], + ["aremos", 78, 2], + ["eremos", 78, 2], + ["iremos", 78, 2], + ["\u00E1semos", 78, 2], + ["i\u00E9semos", 78, 2], + ["imos", -1, 2], + ["ar\u00E1s", -1, 2], + ["er\u00E1s", -1, 2], + ["ir\u00E1s", -1, 2], + ["\u00EDs", -1, 2], + ["ar\u00E1", -1, 2], + ["er\u00E1", -1, 2], + ["ir\u00E1", -1, 2], + ["ar\u00E9", -1, 2], + ["er\u00E9", -1, 2], + ["ir\u00E9", -1, 2], + ["i\u00F3", -1, 2] + ]; + + /** @const */ var a_9 = [ + ["a", -1, 1], + ["e", -1, 2], + ["o", -1, 1], + ["os", -1, 1], + ["\u00E1", -1, 1], + ["\u00E9", -1, 2], + ["\u00ED", -1, 1], + ["\u00F3", -1, 1] + ]; + + /** @const */ var /** Array */ g_v = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10]; + + var /** number */ I_p2 = 0; + var /** number */ I_p1 = 0; + var /** number */ I_pV = 0; + + + /** @return {boolean} */ + function r_mark_regions() { + I_pV = base.limit; + I_p1 = base.limit; + I_p2 = base.limit; + var /** number */ v_1 = base.cursor; + lab0: { + lab1: { + var /** number */ v_2 = base.cursor; + lab2: { + if (!(base.in_grouping(g_v, 97, 252))) + { + break lab2; + } + lab3: { + var /** number */ v_3 = base.cursor; + lab4: { + if (!(base.out_grouping(g_v, 97, 252))) + { + break lab4; + } + golab5: while(true) + { + lab6: { + if (!(base.in_grouping(g_v, 97, 252))) + { + break lab6; + } + break golab5; + } + if (base.cursor >= base.limit) + { + break lab4; + } + base.cursor++; + } + break lab3; + } + base.cursor = v_3; + if (!(base.in_grouping(g_v, 97, 252))) + { + break lab2; + } + golab7: while(true) + { + lab8: { + if (!(base.out_grouping(g_v, 97, 252))) + { + break lab8; + } + break golab7; + } + if (base.cursor >= base.limit) + { + break lab2; + } + base.cursor++; + } + } + break lab1; + } + base.cursor = v_2; + if (!(base.out_grouping(g_v, 97, 252))) + { + break lab0; + } + lab9: { + var /** number */ v_6 = base.cursor; + lab10: { + if (!(base.out_grouping(g_v, 97, 252))) + { + break lab10; + } + golab11: while(true) + { + lab12: { + if (!(base.in_grouping(g_v, 97, 252))) + { + break lab12; + } + break golab11; + } + if (base.cursor >= base.limit) + { + break lab10; + } + base.cursor++; + } + break lab9; + } + base.cursor = v_6; + if (!(base.in_grouping(g_v, 97, 252))) + { + break lab0; + } + if (base.cursor >= base.limit) + { + break lab0; + } + base.cursor++; + } + } + I_pV = base.cursor; + } + base.cursor = v_1; + var /** number */ v_8 = base.cursor; + lab13: { + golab14: while(true) + { + lab15: { + if (!(base.in_grouping(g_v, 97, 252))) + { + break lab15; + } + break golab14; + } + if (base.cursor >= base.limit) + { + break lab13; + } + base.cursor++; + } + golab16: while(true) + { + lab17: { + if (!(base.out_grouping(g_v, 97, 252))) + { + break lab17; + } + break golab16; + } + if (base.cursor >= base.limit) + { + break lab13; + } + base.cursor++; + } + I_p1 = base.cursor; + golab18: while(true) + { + lab19: { + if (!(base.in_grouping(g_v, 97, 252))) + { + break lab19; + } + break golab18; + } + if (base.cursor >= base.limit) + { + break lab13; + } + base.cursor++; + } + golab20: while(true) + { + lab21: { + if (!(base.out_grouping(g_v, 97, 252))) + { + break lab21; + } + break golab20; + } + if (base.cursor >= base.limit) + { + break lab13; + } + base.cursor++; + } + I_p2 = base.cursor; + } + base.cursor = v_8; + return true; + }; + + /** @return {boolean} */ + function r_postlude() { + var /** number */ among_var; + while(true) + { + var /** number */ v_1 = base.cursor; + lab0: { + base.bra = base.cursor; + among_var = base.find_among(a_0); + if (among_var == 0) + { + break lab0; + } + base.ket = base.cursor; + switch (among_var) { + case 1: + if (!base.slice_from("a")) + { + return false; + } + break; + case 2: + if (!base.slice_from("e")) + { + return false; + } + break; + case 3: + if (!base.slice_from("i")) + { + return false; + } + break; + case 4: + if (!base.slice_from("o")) + { + return false; + } + break; + case 5: + if (!base.slice_from("u")) + { + return false; + } + break; + case 6: + if (base.cursor >= base.limit) + { + break lab0; + } + base.cursor++; + break; + } + continue; + } + base.cursor = v_1; + break; + } + return true; + }; + + /** @return {boolean} */ + function r_RV() { + if (!(I_pV <= base.cursor)) + { + return false; + } + return true; + }; + + /** @return {boolean} */ + function r_R1() { + if (!(I_p1 <= base.cursor)) + { + return false; + } + return true; + }; + + /** @return {boolean} */ + function r_R2() { + if (!(I_p2 <= base.cursor)) + { + return false; + } + return true; + }; + + /** @return {boolean} */ + function r_attached_pronoun() { + var /** number */ among_var; + base.ket = base.cursor; + if (base.find_among_b(a_1) == 0) + { + return false; + } + base.bra = base.cursor; + among_var = base.find_among_b(a_2); + if (among_var == 0) + { + return false; + } + if (!r_RV()) + { + return false; + } + switch (among_var) { + case 1: + base.bra = base.cursor; + if (!base.slice_from("iendo")) + { + return false; + } + break; + case 2: + base.bra = base.cursor; + if (!base.slice_from("ando")) + { + return false; + } + break; + case 3: + base.bra = base.cursor; + if (!base.slice_from("ar")) + { + return false; + } + break; + case 4: + base.bra = base.cursor; + if (!base.slice_from("er")) + { + return false; + } + break; + case 5: + base.bra = base.cursor; + if (!base.slice_from("ir")) + { + return false; + } + break; + case 6: + if (!base.slice_del()) + { + return false; + } + break; + case 7: + if (!(base.eq_s_b("u"))) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_standard_suffix() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_6); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + switch (among_var) { + case 1: + if (!r_R2()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + case 2: + if (!r_R2()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + var /** number */ v_1 = base.limit - base.cursor; + lab0: { + base.ket = base.cursor; + if (!(base.eq_s_b("ic"))) + { + base.cursor = base.limit - v_1; + break lab0; + } + base.bra = base.cursor; + if (!r_R2()) + { + base.cursor = base.limit - v_1; + break lab0; + } + if (!base.slice_del()) + { + return false; + } + } + break; + case 3: + if (!r_R2()) + { + return false; + } + if (!base.slice_from("log")) + { + return false; + } + break; + case 4: + if (!r_R2()) + { + return false; + } + if (!base.slice_from("u")) + { + return false; + } + break; + case 5: + if (!r_R2()) + { + return false; + } + if (!base.slice_from("ente")) + { + return false; + } + break; + case 6: + if (!r_R1()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + var /** number */ v_2 = base.limit - base.cursor; + lab1: { + base.ket = base.cursor; + among_var = base.find_among_b(a_3); + if (among_var == 0) + { + base.cursor = base.limit - v_2; + break lab1; + } + base.bra = base.cursor; + if (!r_R2()) + { + base.cursor = base.limit - v_2; + break lab1; + } + if (!base.slice_del()) + { + return false; + } + switch (among_var) { + case 1: + base.ket = base.cursor; + if (!(base.eq_s_b("at"))) + { + base.cursor = base.limit - v_2; + break lab1; + } + base.bra = base.cursor; + if (!r_R2()) + { + base.cursor = base.limit - v_2; + break lab1; + } + if (!base.slice_del()) + { + return false; + } + break; + } + } + break; + case 7: + if (!r_R2()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + var /** number */ v_3 = base.limit - base.cursor; + lab2: { + base.ket = base.cursor; + if (base.find_among_b(a_4) == 0) + { + base.cursor = base.limit - v_3; + break lab2; + } + base.bra = base.cursor; + if (!r_R2()) + { + base.cursor = base.limit - v_3; + break lab2; + } + if (!base.slice_del()) + { + return false; + } + } + break; + case 8: + if (!r_R2()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + var /** number */ v_4 = base.limit - base.cursor; + lab3: { + base.ket = base.cursor; + if (base.find_among_b(a_5) == 0) + { + base.cursor = base.limit - v_4; + break lab3; + } + base.bra = base.cursor; + if (!r_R2()) + { + base.cursor = base.limit - v_4; + break lab3; + } + if (!base.slice_del()) + { + return false; + } + } + break; + case 9: + if (!r_R2()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + var /** number */ v_5 = base.limit - base.cursor; + lab4: { + base.ket = base.cursor; + if (!(base.eq_s_b("at"))) + { + base.cursor = base.limit - v_5; + break lab4; + } + base.bra = base.cursor; + if (!r_R2()) + { + base.cursor = base.limit - v_5; + break lab4; + } + if (!base.slice_del()) + { + return false; + } + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_y_verb_suffix() { + if (base.cursor < I_pV) + { + return false; + } + var /** number */ v_2 = base.limit_backward; + base.limit_backward = I_pV; + base.ket = base.cursor; + if (base.find_among_b(a_7) == 0) + { + base.limit_backward = v_2; + return false; + } + base.bra = base.cursor; + base.limit_backward = v_2; + if (!(base.eq_s_b("u"))) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + return true; + }; + + /** @return {boolean} */ + function r_verb_suffix() { + var /** number */ among_var; + if (base.cursor < I_pV) + { + return false; + } + var /** number */ v_2 = base.limit_backward; + base.limit_backward = I_pV; + base.ket = base.cursor; + among_var = base.find_among_b(a_8); + if (among_var == 0) + { + base.limit_backward = v_2; + return false; + } + base.bra = base.cursor; + base.limit_backward = v_2; + switch (among_var) { + case 1: + var /** number */ v_3 = base.limit - base.cursor; + lab0: { + if (!(base.eq_s_b("u"))) + { + base.cursor = base.limit - v_3; + break lab0; + } + var /** number */ v_4 = base.limit - base.cursor; + if (!(base.eq_s_b("g"))) + { + base.cursor = base.limit - v_3; + break lab0; + } + base.cursor = base.limit - v_4; + } + base.bra = base.cursor; + if (!base.slice_del()) + { + return false; + } + break; + case 2: + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_residual_suffix() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_9); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + switch (among_var) { + case 1: + if (!r_RV()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + case 2: + if (!r_RV()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + var /** number */ v_1 = base.limit - base.cursor; + lab0: { + base.ket = base.cursor; + if (!(base.eq_s_b("u"))) + { + base.cursor = base.limit - v_1; + break lab0; + } + base.bra = base.cursor; + var /** number */ v_2 = base.limit - base.cursor; + if (!(base.eq_s_b("g"))) + { + base.cursor = base.limit - v_1; + break lab0; + } + base.cursor = base.limit - v_2; + if (!r_RV()) + { + base.cursor = base.limit - v_1; + break lab0; + } + if (!base.slice_del()) + { + return false; + } + } + break; + } + return true; + }; + + this.stem = /** @return {boolean} */ function() { + r_mark_regions(); + base.limit_backward = base.cursor; base.cursor = base.limit; + var /** number */ v_2 = base.limit - base.cursor; + r_attached_pronoun(); + base.cursor = base.limit - v_2; + var /** number */ v_3 = base.limit - base.cursor; + lab0: { + lab1: { + var /** number */ v_4 = base.limit - base.cursor; + lab2: { + if (!r_standard_suffix()) + { + break lab2; + } + break lab1; + } + base.cursor = base.limit - v_4; + lab3: { + if (!r_y_verb_suffix()) + { + break lab3; + } + break lab1; + } + base.cursor = base.limit - v_4; + if (!r_verb_suffix()) + { + break lab0; + } + } + } + base.cursor = base.limit - v_3; + var /** number */ v_5 = base.limit - base.cursor; + r_residual_suffix(); + base.cursor = base.limit - v_5; + base.cursor = base.limit_backward; + var /** number */ v_6 = base.cursor; + r_postlude(); + base.cursor = v_6; + return true; + }; + + /**@return{string}*/ + this['stemWord'] = function(/**string*/word) { + base.setCurrent(word); + this.stem(); + return base.getCurrent(); + }; +}; diff --git a/_static/sphinx_highlight.js b/_static/sphinx_highlight.js new file mode 100644 index 0000000..aae669d --- /dev/null +++ b/_static/sphinx_highlight.js @@ -0,0 +1,144 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + parent.insertBefore( + span, + parent.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(SphinxHighlight.highlightSearchWords); +_ready(SphinxHighlight.initEscapeListener); diff --git a/_static/translations.js b/_static/translations.js new file mode 100644 index 0000000..93b9677 --- /dev/null +++ b/_static/translations.js @@ -0,0 +1,61 @@ +Documentation.addTranslations({ + "locale": "es", + "messages": { + "%(filename)s — %(docstitle)s": "%(filename)s — %(docstitle)s", + "© Copyright %(copyright)s.": "© Derechos de autor %(copyright)s.", + "© Copyright %(copyright)s.": "© Derechos de autor %(copyright)s.", + ", in ": ", en ", + "About these documents": "Sobre este documento", + "Automatically generated list of changes in version %(version)s": "Lista de cambios generada autom\u00e1ticamente en la versi\u00f3n %(version)s", + "C API changes": "Cambios en la API C", + "Changes in Version %(version)s — %(docstitle)s": "Cambios en la versi\u00f3n %(version)s — %(docstitle)s", + "Collapse sidebar": "Contraer barra lateral", + "Complete Table of Contents": "\u00cdndice de contenidos completo", + "Contents": "Contenidos", + "Copyright": "Copyright", + "Created using Sphinx %(sphinx_version)s.": "Creado usando Sphinx %(sphinx_version)s.", + "Expand sidebar": "Expandir barra lateral", + "Full index on one page": "\u00cdndice completo en una p\u00e1gina", + "General Index": "\u00cdndice General", + "Global Module Index": "\u00cdndice Global de M\u00f3dulos", + "Go": "Ir a", + "Hide Search Matches": "Ocultar coincidencias de la b\u00fasqueda", + "Index": "\u00cdndice", + "Index – %(key)s": "\u00cdndice – %(key)s", + "Index pages by letter": "\u00cdndice alfab\u00e9tico de p\u00e1ginas", + "Indices and tables:": "\u00cdndices y tablas:", + "Last updated on %(last_updated)s.": "Actualizado por \u00faltima vez en %(last_updated)s.", + "Library changes": "Cambios en la biblioteca", + "Navigation": "Navegaci\u00f3n", + "Next topic": "Pr\u00f3ximo tema", + "Other changes": "Otros cambios", + "Overview": "Resumen", + "Please activate JavaScript to enable the search\n functionality.": "Por favor, active JavaScript para habilitar la funcionalidad\n de b\u00fasqueda.", + "Preparing search...": "Preparando b\u00fasqueda...", + "Previous topic": "Tema anterior", + "Quick search": "B\u00fasqueda r\u00e1pida", + "Search": "B\u00fasqueda", + "Search Page": "P\u00e1gina de B\u00fasqueda", + "Search Results": "Resultados de la b\u00fasqueda", + "Search finished, found ${resultCount} page(s) matching the search query.": "B\u00fasqueda finalizada, se encontraron ${resultCount} p\u00e1ginas que coinciden con la consulta de b\u00fasqueda.", + "Search within %(docstitle)s": "Buscar en %(docstitle)s", + "Searching": "Buscando", + "Searching for multiple words only shows matches that contain\n all words.": "La b\u00fasqueda de varias palabras solo muestra coincidencias que contienen\n todas las palabras.", + "Show Source": "Mostrar el c\u00f3digo", + "Table of Contents": "Tabla de contenido", + "This Page": "Esta p\u00e1gina", + "Welcome! This is": "\u00a1Bienvenido! Este es", + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Su b\u00fasqueda no coincide con ning\u00fan documentos. Por favor, aseg\u00farese de que todas las palabras est\u00e9n correctamente escritas y que usted all\u00e1 seleccionado las suficientes categor\u00edas.", + "all functions, classes, terms": "todas las funciones, clases, t\u00e9rminos", + "can be huge": "puede ser muy grande", + "last updated": "actualizado por \u00faltima vez el", + "lists all sections and subsections": "muestra todas las secciones y subsecciones", + "next chapter": "pr\u00f3ximo cap\u00edtulo", + "previous chapter": "cap\u00edtulo anterior", + "quick access to all modules": "acceso r\u00e1pido a todos los m\u00f3dulos", + "search": "buscar", + "search this documentation": "buscar en esta documentaci\u00f3n", + "the documentation for": "la documentaci\u00f3n para" + }, + "plural_expr": "n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2" +}); \ No newline at end of file diff --git a/bin/pycamp_manager.py b/bin/pycamp_manager.py deleted file mode 100644 index 0fc4a36..0000000 --- a/bin/pycamp_manager.py +++ /dev/null @@ -1,130 +0,0 @@ -import argparse -import datetime -from pycamp_bot.models import Pycamp -from pycamp_bot.models import Pycampista -from pycamp_bot.models import PycampistaAtPycamp -from pycamp_bot.models import models_db_connection -from pycamp_bot.logger import logger - - -def parse_args(): - parser = argparse.ArgumentParser() - subparsers = parser.add_subparsers(dest='wich') - - parser.add_argument('--list_pycampistas', action='store_true', - help='List all pycampistas in the DB.') - parser.add_argument('--list_pycamps', action='store_true', - help='List all pycamps in the DB.') - - pycampista_parser = subparsers.add_parser('pycampista', help='Manage Pycampista.') - pycampista_parser.add_argument('name', help='Pycampista.') - pycampista_parser.add_argument('--add', action='store_true', help='Add pycampista.') - pycampista_parser.add_argument('--arrive', - nargs='?', - const=datetime.datetime.now().isoformat(), - help='Add arrival time as isoformat\ - datetime. Example:\ - 2020-03-11T09:40:37.577157, 2020-03-11') - pycampista_parser.add_argument('--departure', - nargs='?', - const=datetime.datetime.now().isoformat(), - help='Add departure time as isoformat\ - datetime. Example:\ - 2020-03-11T09:40:37.577157, 2020-03-11') - - pycamp_parser = subparsers.add_parser('pycamp', help='Manage Pycamp.') - pycamp_parser.add_argument('name', help='Pycamp headquarters name.') - pycamp_parser.add_argument('--add', action='store_true', help='Add Pycamp.') - pycamp_parser.add_argument('--add_pycampista', - help='Add Pycampista to pycamp.') - pycamp_parser.add_argument('--init', - nargs='?', - const=datetime.datetime.now().isoformat(), - help='Add pycamps init time as isoformat\ - datetime. Example:\ - 2020-03-11T09:40:37.577157, 2020-03-11') - pycamp_parser.add_argument('--end', - nargs='?', - const=datetime.datetime.now().isoformat(), - help='Add pycamp end time as isoformat\ - datetime. Example:\ - 2020-03-11T09:40:37.577157, 2020-03-11') - - return parser.parse_args() - - -if __name__ == '__main__': - args = parse_args() - models_db_connection() - - if args.wich == 'pycampista': - if args.add: - logger.info('Adding pycampista') - pycampista = Pycampista.create(username=args.name) - - if args.arrive: - arrive_time = datetime.datetime.fromisoformat(args.arrive) - logger.info('Changing arrive time to {}'.format(arrive_time)) - pycampista = Pycampista.select().where( - Pycampista.username == args.name)[0] - pycampista.arrive = arrive_time - pycampista.save() - - if args.departure: - departure_time = datetime.datetime.fromisoformat(args.departure) - logger.info('Changing departure time to {}'.format(departure_time)) - pycampista = Pycampista.select().where( - Pycampista.username == args.name)[0] - pycampista.leave = departure_time - pycampista.save() - - pycampista = Pycampista.select().where( - Pycampista.username == args.name)[0] - print(pycampista) - elif args.wich == 'pycamp': - if args.add: - logger.info('Adding pycamp') - pycamp = Pycamp.create(headquarters=args.name) - - if args.init: - init_time = datetime.datetime.fromisoformat(args.init) - logger.info('Changing init time to {}'.format(init_time)) - pycamp = Pycamp.select().where( - Pycamp.headquarters == args.name)[0] - pycamp.init = init_time - pycamp.save() - - if args.end: - end_time = datetime.datetime.fromisoformat(args.end) - logger.info('Changing end time to {}'.format(end_time)) - pycamp = Pycamp.select().where( - Pycamp.headquarters == args.name)[0] - pycamp.end = end_time - pycamp.save() - - if args.add_pycampista: - pycamp = Pycamp.select().where( - Pycamp.headquarters == args.name)[0] - pycampista = Pycampista.select().where( - Pycampista.username == args.add_pycampista)[0] - pycampista_at_pycamp = PycampistaAtPycamp.create(pycamp=pycamp, - pycampista=pycampista) - - pycamp = Pycamp.select().where( - Pycamp.headquarters == args.name)[0] - print(pycamp) - pycampistas_at_pycamp = PycampistaAtPycamp.select().where( - PycampistaAtPycamp.pycamp == pycamp) - for pap in pycampistas_at_pycamp: - print('-' * 10) - print(pap.pycampista) - elif args.list_pycamps: - pycamps = Pycamp.select() - for pycamp in pycamps: - print('-' * 10) - print(pycamp) - elif args.list_pycampistas: - pycampistas = Pycampista.select() - for pycampista in pycampistas: - print('-' * 10) - print(pycampista) diff --git a/bin/run_bot.py b/bin/run_bot.py deleted file mode 100644 index dc0bb1e..0000000 --- a/bin/run_bot.py +++ /dev/null @@ -1,56 +0,0 @@ -import os - -from telegram.ext import Application, MessageHandler, filters -import sentry_sdk - -from pycamp_bot.commands import auth -from pycamp_bot.commands import voting -from pycamp_bot.commands import manage_pycamp -from pycamp_bot.commands import projects -from pycamp_bot.commands import wizard -from pycamp_bot.commands import base -from pycamp_bot.commands import raffle -from pycamp_bot.commands import schedule -from pycamp_bot.commands import announcements -from pycamp_bot.commands import devtools -from pycamp_bot.constants import SENTRY_DATA_SOURCE_NAME_ENVVAR -from pycamp_bot.models import models_db_connection -from pycamp_bot.logger import logger - - -if SENTRY_DATA_SOURCE_NAME_ENVVAR in os.environ: - sentry_sdk.init(dsn=os.environ[SENTRY_DATA_SOURCE_NAME_ENVVAR]) - - -async def unknown_command(update, context): - text = "No reconozco el comando, para ver comandos válidos usá /ayuda" - await context.bot.send_message(chat_id=update.message.chat_id, text=text) - - -def set_handlers(application): - base.set_handlers(application) - auth.set_handlers(application) - wizard.set_handlers(application) - voting.set_handlers(application) - manage_pycamp.set_handlers(application) - projects.set_handlers(application) - raffle.set_handlers(application) - schedule.set_handlers(application) - announcements.set_handlers(application) - devtools.set_handlers(application) - application.add_handler(MessageHandler(filters.COMMAND, unknown_command)) - - -if __name__ == '__main__': - logger.info('Starting PyCamp Bot') - - if 'TOKEN' in os.environ.keys(): - models_db_connection() - - application = Application.builder().token(os.environ['TOKEN']).build() - # application.add_handler(CommandHandler("start", start)) - set_handlers(application) - application.run_polling() - - else: - logger.info('Token not defined. Exiting.') diff --git a/bot_father_commands.md b/bot_father_commands.md deleted file mode 100644 index f6be771..0000000 --- a/bot_father_commands.md +++ /dev/null @@ -1,33 +0,0 @@ -voy_al_pycamp - (pycamp_name) avisá que vas al pycamp! si no especificas un pycamp por default es el que esta activo. -pycampistas - te da informacion de los pycampistas. -pycamps - lista todos los pycamps. -cargar_proyecto - empieza la conversacion de carga de proyecto. -proyectos - te muestra la informacion de todos los proyectos y sus responsables. -mis_proyectos - te muestra tus proyectos cargados -participantes - (project_name) dado un proyecto te muestra sus interesadxs -borrar_proyecto - borra un proyecto -rifar - Te devuelve un PyCampista random. -ver_magx - muestra la lista de Magxs -ser_magx - te agrega la lista de Magx. -evocar_magx - pingea a lael Magx de turno, informando que necesitas su ayuda. Con un gran poder, viene una gran responsabilidad. -ver_agenda_magx - te muestra la agenda de los magos. -votar - te muestra los proyectos presentados para que digas cuales te gustan. -cronograma - te muestra el cronograma del PyCamp. -contar_votos - te da la cantidad de gente que voto. -anunciar - *admin* pingea por privado a les interesades avisando que esta por empezar (solo para admins u owners del proyecto). -su - (passwrd) convierte al usuario en admin. Si sabe el password :P -admins - lista a todos los admins. -agregar_pycamp - (pycamp) *admin* Agrega un pycamp. -activar_pycamp - (pycamp) *admin* Setea un pycamp como activo (si ya hay uno activo lo desactiva). -empezar_carga_proyectos - *admin* Habilita la carga de proyectos en el pycamp activo. -terminar_carga_proyectos - *admin* Deshabilita la carga de proyectos en el pycamp activo. -empezar_votacion_proyectos - *admin* Habilita la seleccion sobre los proyectos del pycamp activo. -terminar_votacion_proyectos - *admin* Deshabilita la seleccion sobre los proyectos del pycamp activo. -empezar_pycamp - *admin* Setea el tiempo de inicio del pycamp activo.Por default usa datetime.now() -terminar_pycamp - *admin* Setea el timepo de fin del pycamp activo.Por default usa datetime.now() -cronogramear - *admin* Te pregunta cuantos dias y que slot tiene tu pycamp y genera el cronograma. -agendar_magx - *admin* Cronogramea los magxs en los slots el PyCamp -cambiar_slot - (project_name, new_slot)*admin* Toma el nombre de un proyecto y el nuevo slot y lo cambia en el cronograma. -degradar - (username) *admin* Le saca los permisos de admin a un usuario. -ayuda - esta ayuda.''' -mostrar_version - te muestra que version del bot esta corriendo en el server \ No newline at end of file diff --git a/comandos_bot.html b/comandos_bot.html new file mode 100644 index 0000000..7f75f5c --- /dev/null +++ b/comandos_bot.html @@ -0,0 +1,147 @@ + + + + + + + Comandos del Bot del Pycamp — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Comandos del Bot del Pycamp

+
+

Comandos básicos

+
    +
  • /start: Sirve para comenzar la interacción con el bot

  • +
+
+
+

Comandos de Administrador

+
    +
  • /su <password>: Reclama permisos de admin, la contraseña es la usada en la variable de entorno PYCAMP_BOT_MASTER_KEY.

  • +
  • /agregar_pycamp <pycamp_name>: Crea el PyCamp en la DB.

  • +
  • /activar_pycamp <pycamp_name>: Activa un Pycamp.

  • +
  • /empezar_pycamp: Setea la fecha de inicio del pycamp activo.

  • +
  • /empezar_carga_proyectos: Habilita la carga de los proyectos. En este punto los pycampistas pueden cargar sus proyectos, enviandole al bot el comando /cargar_proyecto.

  • +
  • /terminar_carga_proyectos: Termina carga proyectos.

  • +
  • /empezar_votacion: Activa la votacion (a partir de ahora los pycampistas pueden votar con /votar).

  • +
  • /terminar_votacion: Termina la votacion.

  • +
  • /cronogramear: Pregunta los dias y slot por día para poder crear el cronograma.

  • +
  • /cambiar_slot: Toma un nombre de proyecto y un slot; y te cambia ese proyecto a ese slot.

  • +
+
+
+

Compandos Pycampista

+
    +
  • /cargar_proyecto: Carga un proyecto (si está habilitada la carga).

  • +
  • /votar: Envia opciones para votar (si está habilitada la votacion).

  • +
  • /ver_cronograma: Te muestra el cronograma!.

  • +
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d0c3cbf..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = source -BUILDDIR = build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 747ffb7..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index e0d1ba0..0000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,61 +0,0 @@ -import os -import sys -# Configuration file for the Sphinx documentation builder. -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information - -project = 'Pycamp Bot' -copyright = '2021, PyAr' -author = 'PyAr' -release = '3.0.0' - -# -- Path setup -------------------------------------------------------------- - -sys.path.insert(0, f'{os.path.dirname(__file__)}/../..') - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration - -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.napoleon', - 'sphinx.ext.viewcode', -] - -templates_path = ['_templates'] -exclude_patterns = [] - -language = 'es' - -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - -html_theme = 'sphinx_rtd_theme' -# html_static_path = ['_static'] -# html_favicon = '_static/img/icon.svg' -# html_logo = '_static/img/logo.png' - -# -- Options for autodoc ----------------------------------------------------- - -autodoc_default_options = { - 'members': True, - 'undoc-members': True, - 'special-members': '__init__', - 'show-inheritance': True, -} - -# -- Options for napoleon ---------------------------------------------------- - -napoleon_include_init_with_doc = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_ivar = True -napoleon_use_param = True -napoleon_use_rtype = True -napoleon_preprocess_types = True -napoleon_attr_annotations = True -napoleon_custom_sections = [('Returns', 'params_style')] diff --git a/genindex.html b/genindex.html new file mode 100644 index 0000000..2bff1de --- /dev/null +++ b/genindex.html @@ -0,0 +1,109 @@ + + + + + + Índice — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + +
  • +
  • +
+
+
+
+
+ + +

Índice

+ +
+ +
+ + +
+
+
+ +
+ +
+

© Derechos de autor 2021, PyAr.

+
+ + Compilado con Sphinx usando un + tema + proporcionado por Read the Docs. + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..254f127 --- /dev/null +++ b/index.html @@ -0,0 +1,134 @@ + + + + + + + Bienvenido a la documentación de Pycamp Bot’s! — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/instalacion_entorno.html b/instalacion_entorno.html new file mode 100644 index 0000000..068efd7 --- /dev/null +++ b/instalacion_entorno.html @@ -0,0 +1,195 @@ + + + + + + + Instalación del entorno de desarrollo — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Instalación del entorno de desarrollo

+

Para poder colaborar con este desarrollo vas a necesitar 4 cosas:

+
    +
  • Obtener el token de telegram

  • +
  • Setear las variables de entorno

  • +
  • Instalar las dependencias

  • +
  • Ejecutar el bot

  • +
+
+

Obtención del token de telegram

+

Hace click en este link para hablar con BotFather y seguí los pasos:

+
    +
  • /start

  • +
  • /newbot

  • +
  • Dale un nombre

  • +
  • Dale un username

  • +
  • Copia el token de acceso

  • +
+
+
+

Variables de entorno

+ + + + + + + + + + + + + + + + + + + + +

Variable

Ejemplo

Requerida

Default

TOKEN

{TOKEN}

True

PYCAMP_BOT_MASTER_KEY

{KEY}

True

+

El PYCAMP_BOT_MASTER_KEY es una clave que tenes que inventar para poder ser admin con el bot.

+
+
+

Instalación de dependencias

+
python setup.py install
+
+
+
+
+

Ejecutar el bot

+

Para correr el bot ejecutá:

+
TOKEN='TOKEN_PERSONAL' PYCAMP_BOT_MASTER_KEY='KEY' python bin/run_bot.py
+
+
+

Y listo! Tu bot está corriendo en tu máquina, esperando que alguien le escriba por telegram. +Para probarlo buscalo en telegram y mandale el comando /start

+
+

Ejecutar en un entorno dockerizado

+

Para ejecutar el bot primero contruya la imagen:

+
docker build -t pycamp_bot:latest .
+
+
+

Ahora inicie el contenedor:

+
docker run -e "TOKEN=TOKEN_PERSONAL" -e "PYCAMP_BOT_MASTER_KEY=KEY" -v ./:/pycamp/telegram_bot --name pycamp_telegram_bot pycamp_bot
+
+
+

Para ejecutar los test:

+
docker run --rm -e "TOKEN=TOKEN_PERSONAL" -e "PYCAMP_BOT_MASTER_KEY=KEY" -v ./:/pycamp/telegram_bot --name pycamp_telegram_bot_test pycamp_bot python -m unittest -v test
+
+
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/migrations/migrate_to_repository_and_group_urls.py b/migrations/migrate_to_repository_and_group_urls.py deleted file mode 100644 index f1ba4c4..0000000 --- a/migrations/migrate_to_repository_and_group_urls.py +++ /dev/null @@ -1,24 +0,0 @@ -# https://docs.peewee-orm.com/en/latest/peewee/playhouse.html#schema-migrations - -import peewee -import playhouse.migrate - -import pycamp_bot.models - - -my_db = peewee.SqliteDatabase('pycamp_projects.db') -migrator = playhouse.migrate.SqliteMigrator(my_db) - - -playhouse.migrate.migrate( - migrator.add_column( - pycamp_bot.models.Project._meta.table_name, - 'repository_url', - pycamp_bot.models.Project.repository_url, - ), - migrator.add_column( - pycamp_bot.models.Project._meta.table_name, - 'group_url', - pycamp_bot.models.Project.group_url, - ), -) diff --git a/migrations/migrate_to_wizards_scheduling.py b/migrations/migrate_to_wizards_scheduling.py deleted file mode 100644 index 2a2f952..0000000 --- a/migrations/migrate_to_wizards_scheduling.py +++ /dev/null @@ -1,33 +0,0 @@ -# https://docs.peewee-orm.com/en/latest/peewee/playhouse.html#schema-migrations - -from datetime import datetime, timedelta -from playhouse.migrate import * -import peewee as pw - -from pycamp_bot.models import Pycampista, Slot, Pycamp - - -my_db = pw.SqliteDatabase('pycamp_projects.db') -migrator = SqliteMigrator(my_db) - -from pycamp_bot.models import Pycamp - - -migrate( - migrator.add_column( # wizard_slot_duration = pw.IntegerField(default=60, null=False) - Pycamp._meta.table_name, - 'wizard_slot_duration', - Pycamp.wizard_slot_duration - ), - migrator.add_column( # current_wizard = pw.ForeignKeyField(Pycampista) - Slot._meta.table_name, - 'current_wizard_id', - Slot.current_wizard - ), -) - -p = Pycamp.get() -p.end = datetime(2024,6,23,23,59,59,99) -p.end = datetime(2024,6,23,23,59,59,999999) -p.save() - diff --git a/objects.inv b/objects.inv new file mode 100644 index 0000000..0aa9b98 Binary files /dev/null and b/objects.inv differ diff --git a/pycamp_bot.html b/pycamp_bot.html new file mode 100644 index 0000000..1dd4f5e --- /dev/null +++ b/pycamp_bot.html @@ -0,0 +1,139 @@ + + + + + + + Pycamp bot — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Pycamp bot

+
+

Archivos

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands.html b/pycamp_bot/commands.html new file mode 100644 index 0000000..90fb464 --- /dev/null +++ b/pycamp_bot/commands.html @@ -0,0 +1,143 @@ + + + + + + + commands — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

commands

+
+

Archivos

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands/announcements.html b/pycamp_bot/commands/announcements.html new file mode 100644 index 0000000..1f61f25 --- /dev/null +++ b/pycamp_bot/commands/announcements.html @@ -0,0 +1,127 @@ + + + + + + + announcements — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

announcements

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands/auth.html b/pycamp_bot/commands/auth.html new file mode 100644 index 0000000..531bdf2 --- /dev/null +++ b/pycamp_bot/commands/auth.html @@ -0,0 +1,127 @@ + + + + + + + auth — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

auth

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands/base.html b/pycamp_bot/commands/base.html new file mode 100644 index 0000000..754b982 --- /dev/null +++ b/pycamp_bot/commands/base.html @@ -0,0 +1,127 @@ + + + + + + + base — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

base

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands/help_msg.html b/pycamp_bot/commands/help_msg.html new file mode 100644 index 0000000..654d1dc --- /dev/null +++ b/pycamp_bot/commands/help_msg.html @@ -0,0 +1,127 @@ + + + + + + + help_msg — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

help_msg

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands/manage_pycamp.html b/pycamp_bot/commands/manage_pycamp.html new file mode 100644 index 0000000..dcf8e2c --- /dev/null +++ b/pycamp_bot/commands/manage_pycamp.html @@ -0,0 +1,127 @@ + + + + + + + manage_pycamp — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

manage_pycamp

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands/projects.html b/pycamp_bot/commands/projects.html new file mode 100644 index 0000000..2a723f9 --- /dev/null +++ b/pycamp_bot/commands/projects.html @@ -0,0 +1,127 @@ + + + + + + + projects — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

projects

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands/raffle.html b/pycamp_bot/commands/raffle.html new file mode 100644 index 0000000..c97904a --- /dev/null +++ b/pycamp_bot/commands/raffle.html @@ -0,0 +1,127 @@ + + + + + + + raffle — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

raffle

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands/schedule.html b/pycamp_bot/commands/schedule.html new file mode 100644 index 0000000..54dfa63 --- /dev/null +++ b/pycamp_bot/commands/schedule.html @@ -0,0 +1,127 @@ + + + + + + + schedule — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

schedule

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands/voting.html b/pycamp_bot/commands/voting.html new file mode 100644 index 0000000..8364735 --- /dev/null +++ b/pycamp_bot/commands/voting.html @@ -0,0 +1,127 @@ + + + + + + + voting — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

voting

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/commands/wizard.html b/pycamp_bot/commands/wizard.html new file mode 100644 index 0000000..20c8541 --- /dev/null +++ b/pycamp_bot/commands/wizard.html @@ -0,0 +1,127 @@ + + + + + + + wizard — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

wizard

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/db_schemma.html b/pycamp_bot/db_schemma.html new file mode 100644 index 0000000..3c84919 --- /dev/null +++ b/pycamp_bot/db_schemma.html @@ -0,0 +1,123 @@ + + + + + + + db_schemma — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

db_schemma

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/models.html b/pycamp_bot/models.html new file mode 100644 index 0000000..38f1453 --- /dev/null +++ b/pycamp_bot/models.html @@ -0,0 +1,123 @@ + + + + + + + models — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+ +
+

models

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/scheduler.html b/pycamp_bot/scheduler.html new file mode 100644 index 0000000..1ff8b93 --- /dev/null +++ b/pycamp_bot/scheduler.html @@ -0,0 +1,135 @@ + + + + + + + scheduler — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

scheduler

+
+

Archivos

+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/scheduler/db_to_json.html b/pycamp_bot/scheduler/db_to_json.html new file mode 100644 index 0000000..b3bb60f --- /dev/null +++ b/pycamp_bot/scheduler/db_to_json.html @@ -0,0 +1,127 @@ + + + + + + + db_to_json — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

db_to_json

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pycamp_bot/scheduler/schedule_calculator.html b/pycamp_bot/scheduler/schedule_calculator.html new file mode 100644 index 0000000..3080f6a --- /dev/null +++ b/pycamp_bot/scheduler/schedule_calculator.html @@ -0,0 +1,125 @@ + + + + + + + schedule_calculator — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

schedule_calculator

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 6934f48..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,30 +0,0 @@ -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[project] -name = "PyCamp_Bot" -version = "3.0" -dependencies = [ - "munch==4.0.0", - "python-telegram-bot==21.10", - "peewee==3.17.9", - "sentry-sdk==2.22.0", -] -requires-python = ">=3.10" -authors = [ - {name = "Pyar", email = "pyar@pyar.com"}, -] -description = "Bot de telegram para organizar pycamp" -readme = "README.md" - -[project.optional-dependencies] -dev = [ - "flake8==7.1.2", - "freezegun==1.5.1", - "pytest==8.3.4", -] -doc = [ - "sphinx==7.3.7", - "sphinx_rtd_theme==2.0.0", -] diff --git a/search.html b/search.html new file mode 100644 index 0000000..991b005 --- /dev/null +++ b/search.html @@ -0,0 +1,124 @@ + + + + + + Búsqueda — documentación de Pycamp Bot - 3.0.0 + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + +
  • +
  • +
+
+
+
+
+ + + + +
+ +
+ +
+
+
+ +
+ +
+

© Derechos de autor 2021, PyAr.

+
+ + Compilado con Sphinx usando un + tema + proporcionado por Read the Docs. + + +
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/searchindex.js b/searchindex.js new file mode 100644 index 0000000..3f55eb8 --- /dev/null +++ b/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"docnames": ["comandos_bot", "index", "instalacion_entorno", "pycamp_bot", "pycamp_bot/commands", "pycamp_bot/commands/announcements", "pycamp_bot/commands/auth", "pycamp_bot/commands/base", "pycamp_bot/commands/help_msg", "pycamp_bot/commands/manage_pycamp", "pycamp_bot/commands/projects", "pycamp_bot/commands/raffle", "pycamp_bot/commands/schedule", "pycamp_bot/commands/voting", "pycamp_bot/commands/wizard", "pycamp_bot/db_schemma", "pycamp_bot/models", "pycamp_bot/scheduler", "pycamp_bot/scheduler/db_to_json", "pycamp_bot/scheduler/schedule_calculator"], "filenames": ["comandos_bot.rst", "index.rst", "instalacion_entorno.rst", "pycamp_bot.rst", "pycamp_bot/commands.rst", "pycamp_bot/commands/announcements.rst", "pycamp_bot/commands/auth.rst", "pycamp_bot/commands/base.rst", "pycamp_bot/commands/help_msg.rst", "pycamp_bot/commands/manage_pycamp.rst", "pycamp_bot/commands/projects.rst", "pycamp_bot/commands/raffle.rst", "pycamp_bot/commands/schedule.rst", "pycamp_bot/commands/voting.rst", "pycamp_bot/commands/wizard.rst", "pycamp_bot/db_schemma.rst", "pycamp_bot/models.rst", "pycamp_bot/scheduler.rst", "pycamp_bot/scheduler/db_to_json.rst", "pycamp_bot/scheduler/schedule_calculator.rst"], "titles": ["Comandos del Bot del Pycamp", "Bienvenido a la documentaci\u00f3n de Pycamp Bot\u2019s!", "Instalaci\u00f3n del entorno de desarrollo", "Pycamp bot", "commands", "announcements", "auth", "base", "help_msg", "manage_pycamp", "projects", "raffle", "schedule", "voting", "wizard", "db_schemma", "models", "scheduler", "db_to_json", "schedule_calculator"], "terms": {"start": [0, 2], "sirv": 0, "par": [0, 2], "comenz": 0, "interaccion": 0, "password": 0, "reclam": 0, "permis": 0, "admin": [0, 2], "contrase\u00f1": 0, "usad": 0, "variabl": [0, 1], "entorn": [0, 1], "pycamp_bot_master_key": [0, 2], "agregar_pycamp": 0, "pycamp_nam": 0, "cre": 0, "db": 0, "activar_pycamp": 0, "activ": 0, "empezar_pycamp": 0, "sete": 0, "fech": 0, "inici": [0, 2], "empezar_carga_proyect": 0, "habilit": 0, "carg": 0, "proyect": 0, "En": 0, "punt": 0, "pued": 0, "envi": 0, "com": [0, 2], "cargar_proyect": 0, "terminar_carga_proyect": 0, "termin": 0, "empezar_votacion": 0, "votacion": 0, "part": 0, "ahor": [0, 2], "vot": 0, "terminar_votacion": 0, "cronogram": 0, "pregunt": 0, "dias": 0, "slot": 0, "dia": 0, "pod": [0, 2], "cambiar_slot": 0, "tom": 0, "nombr": [0, 2], "cambi": 0, "si": 0, "opcion": 0, "ver_cronogram": 0, "Te": 0, "muestr": 0, "instal": 1, "desarroll": 1, "obtencion": 1, "tok": 1, "telegram": 1, "dependent": 1, "ejecut": 1, "comand": 1, "basic": 1, "administr": 1, "compand": 1, "pycampist": 1, "colabor": 2, "vas": 2, "necesit": 2, "4": 2, "cos": 2, "obten": 2, "set": 2, "hac": 2, "click": 2, "link": 2, "habl": 2, "botfath": 2, "segu": 2, "pas": 2, "newbot": 2, "dal": 2, "usernam": 2, "copi": 2, "acces": 2, "ejempl": 2, "requer": 2, "default": 2, "tru": 2, "key": 2, "El": 2, "clav": 2, "ten": 2, "invent": 2, "ser": 2, "python": 2, "setup": 2, "py": 2, "install": 2, "corr": 2, "token_personal": 2, "bin": 2, "run_bot": 2, "Y": 2, "list": 2, "Tu": 2, "maquin": 2, "esper": 2, "algui": 2, "escrib": 2, "prob": 2, "buscal": 2, "mandal": 2, "primer": 2, "contru": 2, "imag": 2, "dock": 2, "build": 2, "t": 2, "pycamp_bot": 2, "latest": 2, "contenedor": 2, "run": 2, "v": 2, "pycamp": 2, "telegram_bot": 2, "nam": 2, "pycamp_telegram_bot": 2, "test": 2, "rm": 2, "pycamp_telegram_bot_test": 2, "m": 2, "unittest": 2, "db_schemm": 3, "models": 3, "commands": 3, "schedul": [3, 4], "announcements": 4, "auth": 4, "bas": 4, "help_msg": 4, "manage_pycamp": 4, "projects": 4, "raffl": 4, "voting": 4, "wizard": 4, "db_to_json": 17, "schedule_calculator": 17}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"comand": 0, "bot": [0, 1, 2, 3], "pycamp": [0, 1, 3], "basic": 0, "administr": 0, "compand": 0, "pycampist": 0, "bienven": 1, "document": 1, "s": 1, "conten": 1, "instal": 2, "entorn": 2, "desarroll": 2, "obtencion": 2, "tok": 2, "telegram": 2, "variabl": 2, "dependent": 2, "ejecut": 2, "dockeriz": 2, "archiv": [3, 4, 17], "commands": 4, "announcements": 5, "auth": 6, "bas": 7, "help_msg": 8, "manage_pycamp": 9, "projects": 10, "raffl": 11, "schedul": [12, 17], "voting": 13, "wizard": 14, "db_schemm": 15, "models": 16, "db_to_json": 18, "schedule_calculator": 19}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "sphinx": 57}, "alltitles": {"Comandos del Bot del Pycamp": [[0, "comandos-del-bot-del-pycamp"]], "Comandos b\u00e1sicos": [[0, "comandos-basicos"]], "Comandos de Administrador": [[0, "comandos-de-administrador"]], "Compandos Pycampista": [[0, "compandos-pycampista"]], "Bienvenido a la documentaci\u00f3n de Pycamp Bot\u2019s!": [[1, "bienvenido-a-la-documentacion-de-pycamp-bot-s"]], "Contenido": [[1, "contenido"]], "Contenido:": [[1, null]], "Instalaci\u00f3n del entorno de desarrollo": [[2, "instalacion-del-entorno-de-desarrollo"]], "Obtenci\u00f3n del token de telegram": [[2, "obtencion-del-token-de-telegram"]], "Variables de entorno": [[2, "variables-de-entorno"]], "Instalaci\u00f3n de dependencias": [[2, "instalacion-de-dependencias"]], "Ejecutar el bot": [[2, "ejecutar-el-bot"]], "Ejecutar en un entorno dockerizado": [[2, "ejecutar-en-un-entorno-dockerizado"]], "Pycamp bot": [[3, "pycamp-bot"]], "Archivos": [[3, "archivos"], [4, "archivos"], [17, "archivos"]], "commands": [[4, "commands"]], "announcements": [[5, "announcements"]], "auth": [[6, "auth"]], "base": [[7, "base"]], "help_msg": [[8, "help-msg"]], "manage_pycamp": [[9, "manage-pycamp"]], "projects": [[10, "projects"]], "raffle": [[11, "raffle"]], "schedule": [[12, "schedule"]], "voting": [[13, "voting"]], "wizard": [[14, "wizard"]], "db_schemma": [[15, "db-schemma"]], "models": [[16, "models"]], "scheduler": [[17, "scheduler"]], "db_to_json": [[18, "db-to-json"]], "schedule_calculator": [[19, "schedule-calculator"]]}, "indexentries": {}}) \ No newline at end of file diff --git a/src/pycamp_bot/__init__.py b/src/pycamp_bot/__init__.py deleted file mode 100644 index cc4833a..0000000 --- a/src/pycamp_bot/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from pycamp_bot import models # noqa: F401 -from pycamp_bot import commands # noqa: F401 diff --git a/src/pycamp_bot/commands/announcements.py b/src/pycamp_bot/commands/announcements.py deleted file mode 100644 index 69a0236..0000000 --- a/src/pycamp_bot/commands/announcements.py +++ /dev/null @@ -1,247 +0,0 @@ -from telegram import Update, Bot -from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, filters, CallbackContext -from pycamp_bot.models import Project, Pycampista, Vote -from pycamp_bot.commands.auth import get_admins_username -from pycamp_bot.logger import logger -from pycamp_bot.commands.manage_pycamp import active_needed -from pycamp_bot.utils import escape_markdown - -PROYECTO, LUGAR, MENSAJE = ["proyecto", "lugar", "mensaje"] - -ERROR_MESSAGES = { - "format_error": "Error de formato, recuerde que el formato debe ser el siguiente:\n/anunciar tu_proyecto\nPor favor comienza de nuevo.", - "not_admin": "No tenes proyectos para anunciar y no eres admin.", - "not_found": "No se encontro el proyecto *{project_name}*. Intenta de nuevo por favor.", - "no_admin": "No puedes anunciar proyectos si no eres el owner.\nPor favor contacta un admin" -} - - -class AnnouncementState: - def __init__(self): - self.username = None - self.p_name = '' - self.current_project = False - self.projects = [] - self.owner = '' - self.lugar = '' - self.mensaje = '' - -state = AnnouncementState() - -async def user_is_admin(pycampist: str) -> bool: - return pycampist in get_admins_username() - -async def should_be_able_to_announce(pycampista: str, proyect: Project) -> bool: - return pycampista == proyect.owner.username or await user_is_admin(pycampista) - - -@active_needed -async def announce(update: Update, context: CallbackContext) -> str: - logger.info("Announcement project process started") - parameters: list[str] = update.message.text.split() - project_name = ("").join(parameters[1:]) - - state.username = update.message.from_user.username - state.projects = Project.select().join(Pycampista).where(Pycampista.username == state.username) - - if len(state.projects) == 0: - if not await user_is_admin(state.username): - await context.bot.send_message( - chat_id=update.message.chat_id, - text=ERROR_MESSAGES["no_admin"], - ) - logger.warn(f"Pycampista {state.username} no contiene proyectos creados.") - return ConversationHandler.END - else: - state.projects = Project.select() - return await get_project(update, context) - - if len(parameters) == 1: - project_list: str = "" - if len(state.projects) == 0: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Ingresá el Nombre del Proyecto a anunciar." - ) - else: - project_list = "\n".join(p.name for p in state.projects) - await context.bot.send_message( - chat_id=update.message.chat_id, - text=f"""Ingresá el Nombre del Proyecto a anunciar.\n\nTienes los siguientes proyectos:\n{project_list}""", - ) - - # if len(parameters) > 2: - # print('-Handle correct commands-') - # project_name = (" ").join(parameters[1:]) - # state.p_name = project_name - # _projects = Project.select().join(Pycampista).where(Project.name == state.p_name) - - # if len(_projects) == 0: - # await context.bot.send_message( - # chat_id=update.message.chat_id, - # text=f"No existe el proyecto: *{escape_markdown(state.p_name)}*.", - # parse_mode='MarkdownV2' - # ) - # return ConversationHandler.END - # elif not await should_be_able_to_announce(state.username, _projects[0]): - # await context.bot.send_message( - # chat_id=update.message.chat_id, - # text=ERROR_MESSAGES["no_admin"], - # ) - # logger.warn(f"Solicitud de anuncio no autorizada.") - # return ConversationHandler.END - # else: - # await context.bot.send_message( - # chat_id=update.message.chat_id, - # text=f"Anunciando el proyecto: *{escape_markdown(_projects[0].name)}* !!!", - # parse_mode='MarkdownV2' - # ) - # state.owner = _projects[0].owner.username - # state.current_project = _projects[0] - # return await get_project(update, context) - return PROYECTO - - -async def get_project(update: Update, context: CallbackContext) -> str: - '''Dialog to set project to announce''' - logger.info("Getting project") - parameters_list: list[str] = update.message.text.split() - - if "/anunciar" in parameters_list: - if len(parameters_list) > 2: - project_name = " ".join(parameters_list[1:]) - state.current_project = Project.select().join(Pycampista).where(Project.name == project_name.lower()) - if not await should_be_able_to_announce(update.message.from_user.username, state.current_project[0]): - await handle_error(context, update.message.chat_id, "format_error", state.current_project) - logger.warning(f"Project {parameters_list[1]} not found!") - return PROYECTO - else: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Ingrese lugar donde comienza el proyecto." - ) - state.p_name = parameters_list[1].lower() - state.current_project = state.current_project[0] - if len(parameters_list) == 1: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Ingrese el nombre del proyecto." - ) - return PROYECTO - - else: - project_name = (" ").join(parameters_list) - c_proyect = Project.select().where(Project.name == project_name).first() - if c_proyect: - if await should_be_able_to_announce(update.message.from_user.username, c_proyect): - state.current_project = c_proyect - state.p_name = c_proyect.name - state.owner = c_proyect.owner.username - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Ingrese lugar donde comienza el proyecto." - ) - else: - logger.warning("Solicitud de anuncio no autorizada.") - await handle_error( - context, - update.message.chat_id, - "no_admin" - ) - return ConversationHandler.END - else: - logger.warning("Solicitud de anuncio no autorizada.") - await handle_error( - context, - update.message.chat_id, - "not_found", - project_name=project_name - ) - logger.warning("Error de formato en la solicitud. No se encontró el proyecto.") - return PROYECTO - return LUGAR - - -async def meeting_place(update: Update, context: CallbackContext) -> str: - '''Dialog to set the place of the meeting''' - logger.info("Setting place") - state.lugar = update.message.text.capitalize() - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Escribe un mensaje a los pycampistas suscriptos ..." - ) - return MENSAJE - - -async def message_project(update: Update, context: CallbackContext) -> str: - '''Dialog to set project topic''' - state.mensaje = update.message.text.capitalize() - pycampistas: list[Vote] = Vote.select().join( - Pycampista).where( - (Vote.project == Project.select().where( - Project.name == state.current_project.name)) & (Vote.interest)) - chat_id_list: list[int] = [user.pycampista.chat_id for user in pycampistas] - for chat_id in chat_id_list: - try: - await context.bot.send_message( - chat_id=chat_id, - text=f'''Está por empezar el proyecto *"{escape_markdown(state.p_name)}"* a cargo de *@{escape_markdown(state.owner)}*\.\n*¿Dónde?* 👉🏼 {escape_markdown(state.lugar)}''', - parse_mode='MarkdownV2' - ) - if update.message.from_user.username == state.owner: - await context.bot.send_message( - chat_id=chat_id, - text=f'*Project Owner says:* **{escape_markdown(state.mensaje)}**', - parse_mode='MarkdownV2' - ) - else: - await context.bot.send_message( - chat_id=chat_id, - text=f'Admin *@{escape_markdown(update.message.from_user.username)}* says: **{escape_markdown(state.mensaje)}**', - parse_mode='MarkdownV2' - ) - except Exception as e: - logger.error(f"Error al enviar el mensaje: {e}") - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Anunciado!" - ) - logger.info('Project announced!') - return ConversationHandler.END - - -async def cancel(update: Update, context: CallbackContext) -> str: - '''Cancel the project announcement''' - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Has cancelado el anuncio del proyecto") - logger.warning("Announcement canceled") - return ConversationHandler.END - - -async def handle_error(context: CallbackContext, chat_id: int, error_key: str, **kwargs: list) -> None: - error_message = ERROR_MESSAGES[error_key].format(**kwargs) - print('error_message: ', error_message) - '''Handle error messages''' - try: - await context.bot.send_message( - chat_id=chat_id, - text=error_message, - ) - except Exception as e: - logger.error(f"Error al enviar el mensaje: {e}") - - -start_project_handler = ConversationHandler( - entry_points=[CommandHandler('anunciar', announce)], - states={ - PROYECTO: [MessageHandler(filters.TEXT & ~filters.COMMAND, get_project)], - LUGAR: [MessageHandler(filters.TEXT & ~filters.COMMAND, meeting_place)], - MENSAJE: [MessageHandler(filters.TEXT & ~filters.COMMAND, message_project)] - }, - fallbacks=[CommandHandler('cancel', cancel)] -) - -def set_handlers(application): - '''Add handlers to the application''' - application.add_handler(start_project_handler) diff --git a/src/pycamp_bot/commands/auth.py b/src/pycamp_bot/commands/auth.py deleted file mode 100644 index 445f946..0000000 --- a/src/pycamp_bot/commands/auth.py +++ /dev/null @@ -1,110 +0,0 @@ -import os -from telegram.ext import CommandHandler -from pycamp_bot.models import Pycampista -from pycamp_bot.logger import logger -from pycamp_bot.utils import escape_markdown - - -def get_admins_username(): - admins = [] - pycampistas = Pycampista.select() - for user in pycampistas: - if user.admin: - admins.append(user.username) - return admins - - -def is_admin(update, context): - """Checks if the user is authorized as admin""" - username = update.message.from_user.username - authorized = get_admins_username() - - if username not in authorized: - logger.info("{} is not authorized as admin".format(username)) - return False - else: - logger.info("{} is authorized as admin".format(username)) - return True - - -def admin_needed(f): - async def wrap(*args, **kargs): - update, context = args - if is_admin(*args): - return await f(*args) - else: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="No estas Autorizadx para hacer esta acción" - ) - return wrap - - -async def grant_admin(update, context): - username = update.message.from_user.username - chat_id = update.message.chat_id - text = update.message.text - - parameters = text.split(' ') - if not len(parameters) == 2: - await context.bot.send_message(chat_id=chat_id, - text='Parametros incorrectos.') - return - - passwrd = parameters[1] - - user = Pycampista.get_or_create(username=username, chat_id=chat_id)[0] - if 'PYCAMP_BOT_MASTER_KEY' in os.environ.keys(): - if passwrd == os.environ['PYCAMP_BOT_MASTER_KEY']: - user.admin = True - user.save() - rply_msg = 'Ahora tenes el poder. Cuidado!' - else: - logger.info('Wrong attempt on getting admin privileges.') - rply_msg = 'Ah ah ah, you didn\'t say the magic word.' - else: - logger.error('PYCAMP_BOT_MASTER_KEY env not set.') - rply_msg = 'Hay un problema en el servidor, avisale a un admin.' - - await context.bot.send_message(chat_id=chat_id, text=rply_msg) - - -@admin_needed -async def revoke_admin(update, context): - chat_id = update.message.chat_id - text = update.message.text - - parameters = text.split(' ') - if not len(parameters) == 2: - await context.bot.send_message(chat_id=chat_id, - text='Parametros incorrectos.') - return - - fallen_admin = parameters[1] - - user = Pycampista.select().where(Pycampista.username == fallen_admin)[0] - user.admin = False - user.save() - await context.bot.send_message( - chat_id=chat_id, - text=f'Un admin ha caído ~{escape_markdown(fallen_admin)}~\\.', - parse_mode='MarkdownV2', - ) - - -async def list_admins(update, context): - chat_id = update.message.chat_id - - admins = get_admins_username() - rply_msg = 'Lxs administradorxs son:\n' - - for admin in admins: - rply_msg += '@' + admin + '\n' - - await context.bot.send_message(chat_id=chat_id, text=rply_msg) - - -def set_handlers(application): - application.add_handler(CommandHandler('su', grant_admin)) - application.add_handler(CommandHandler('degradar', revoke_admin)) - application.add_handler(CommandHandler('admins', list_admins)) diff --git a/src/pycamp_bot/commands/base.py b/src/pycamp_bot/commands/base.py deleted file mode 100644 index bac80c5..0000000 --- a/src/pycamp_bot/commands/base.py +++ /dev/null @@ -1,51 +0,0 @@ -from telegram.ext import CommandHandler -from pycamp_bot.commands.help_msg import get_help -from pycamp_bot.logger import logger - -import os - - -async def msg_to_active_pycamp_chat(bot, text): - if 'TEST_CHAT_ID' in os.environ: - chat_id = -1001404878013 # Prueba - await bot.send_message( - chat_id=os.environ['TEST_CHAT_ID'], - text=text - ) - - -async def start(update, context): - logger.info('Start command') - chat_id = update.message.chat_id - - if update.message.from_user.username is None: - await context.bot.send_message( - chat_id=chat_id, - text="""Hola! Necesitas tener un username primero. - \nCreate uno siguiendo esta guia: https://ewtnet.com/technology/how-to/how-to-add-a-username-on-telegram-android-app. - Y despues dame /start the nuevo :) """) - - elif update.message.from_user.username: - await context.bot.send_message( - chat_id=chat_id, - text='Hola ' + update.message.from_user.username + - '! Bienvenidx' - ) - - -async def help(update, context): - logger.info('Returning help message') - await context.bot.send_message(chat_id=update.message.chat_id, text=get_help(update, context), parse_mode='MarkdownV2') - - -# async def error(update, context): -# '''Log Errors caused by Updates.''' -# logger.warning('Update {} caused error {}'.format(update, context.error)) - - -def set_handlers(application): -# application.add_error_handler(error) - - application.add_handler(CommandHandler('start', start)) - application.add_handler(CommandHandler('ayuda', help)) - application.add_handler(CommandHandler('help', help)) diff --git a/src/pycamp_bot/commands/devtools.py b/src/pycamp_bot/commands/devtools.py deleted file mode 100644 index 143c1b6..0000000 --- a/src/pycamp_bot/commands/devtools.py +++ /dev/null @@ -1,54 +0,0 @@ -import os -import subprocess -import sys - -from telegram.ext import CommandHandler - -from pycamp_bot.constants import SENTRY_DATA_SOURCE_NAME_ENVVAR -from pycamp_bot.utils import escape_markdown - - -async def show_version(update, context): - """Let people see the details about what is being run and how""" - - git_rev_parse = subprocess.run(['git', 'rev-parse', '--short', 'HEAD'], capture_output=True, check=True) - commit = git_rev_parse.stdout.decode().rstrip() - - git_log = subprocess.run(['git', 'log', '--max-count=1', '--pretty=format:%ai'], capture_output=True, check=True) - author_date = git_log.stdout.decode().rstrip() - - git_diff = subprocess.run(['git', 'diff', '--quiet'], capture_output=True) - if git_diff.returncode == 0: - clean_worktree = '🟢' - else: - clean_worktree = '🔴' - - python_version = '.'.join(str(component) for component in sys.version_info[:3]) - - pip_freeze = subprocess.run(['pip', 'freeze', '--exclude', 'PyCamp_Bot'], capture_output=True, check=True) - dependencies = [] - for pip_line in pip_freeze.stdout.decode().splitlines(): - dependencies.append(escape_markdown(pip_line)) - - if SENTRY_DATA_SOURCE_NAME_ENVVAR in os.environ: - sentry_envvar_set = '🟢' - else: - sentry_envvar_set = '🔴' - - lines = [ - f'Commit deployado: `{commit}`', - f'Fecha del commit \\(author date\\): `{escape_markdown(author_date)}`', - f'Clean worktree: {clean_worktree}', - f'Versión de Python: `{python_version}`', - 'Dependencias:', - '```', - *dependencies, - '```', - f'Variable de entorno de Sentry definida: {sentry_envvar_set}', - ] - - await update.message.reply_text('\n'.join(lines), parse_mode='MarkdownV2') - - -def set_handlers(application): - application.add_handler(CommandHandler('mostrar_version', show_version)) diff --git a/src/pycamp_bot/commands/help_msg.py b/src/pycamp_bot/commands/help_msg.py deleted file mode 100644 index d768b5d..0000000 --- a/src/pycamp_bot/commands/help_msg.py +++ /dev/null @@ -1,88 +0,0 @@ -from pycamp_bot.commands.auth import is_admin - -user_commands_help = ''' -Comandos de usuario: -/voy\\_al\\_pycamp \\(pycamp name\\): avisá que vas al pycamp\\! si no especificas un\ - pycamp por default es el que esta activo\\. -/pycamps: lista todos los pycamps\\. -/cargar\\_proyecto: empieza la conversacion de carga de proyecto\\. -/proyectos: te muestra la informacion de todos los proyectos y sus responsables\\. -/mis\\_proyectos: te muestra día y horario de los proyectos que votaste\\. -/agregar\\_repositorio: para cargar o modificar la URL del repositorio de un proyecto\\. -/agregar\\_grupo: para cargar o modificar la URL del grupo de Telegram de un proyecto\\. -/ser\\_magx: te agrega la lista de Magx\\. -/evocar\\_magx: pingea a la/el Magx de turno, informando que necesitas su\ - ayuda\\. Con un gran poder, viene una gran responsabilidad\\. -/elegir\\_proyectos: te muestra los proyectos presentados para que digas cuales te gustan\\. -/cronograma: te muestra el cronograma del PyCamp\\. -/anunciar: te pide el nombre de un proyecto y pingea por privado a les \ - interesades avisando que esta por empezar \\(solo para admins u owners del proyecto\\)\\. -/su \\(passwrd\\): convierte al usuario en admin\\. Si sabe el password :P -/mostrar\\_version: te muestra qué versión del bot está corriendo y otros detalles -/admins: lista a todos los admins\\. -/ayuda: esta ayuda\\. -''' - -HELP_MESSAGE = ''' -Este bot facilita la carga, administración y procesamiento de magues, \ -proyectos y votos durante el PyCamp - -El proceso se divide en 3 etapas: - -*Primera etapa*: Iniciar el PyCamp\\. Algún admin del Bot - -*Segunda etapa*: Lxs responsables de los proyectos cargan sus proyectos \ -mediante el comando */cargar\\_proyecto*\\. Solo un responsable carga el \ -proyecto, y luego si hay otrxs responsables adicionales, pueden \ -agregarse con el comando */ownear*\\. - -*Tercera etapa*: Mediante el comando */elegir\\_proyectos* todxs lxs participantes \ -seleccionan los proyectos que se expongan\\. Esto se puede hacer a medida que \ -se expone, o al haber finalizado todas las exposiciones\\. Si no se está \ -segurx de un proyecto, conviene no seleccionar nada, ya que luego podés \ -volver a ejecutar el comando y darle que si aquellas cosas que no tocaste\\. NO \ -SE PUEDE CAMBIAR TU RESPUESTA UNA VEZ HECHO\\. - -*Cuarta etapa*: Lxs admins mergean los proyectos que se haya decidido \ -mergear durante las exposiciones \\(Por tematica similar, u otros \ -motivos\\), y luego se procesan los datos para obtener el cronograma \ -final\\. -''' + user_commands_help - -HELP_MESSAGE_ADMIN = ''' -Be AWARE, you have sudo\\.\\.\\. - -Pycamp: -/activar\\_pycamp \\(pycamp\\): Setea un pycamp como activo \\(si ya hay uno activo lo \ -desactiva\\)\\. - -/empezar\\_carga\\_proyectos: Habilita la carga de proyectos en el pycamp activo\\. -/terminar\\_carga\\_proyectos: Deshabilita la carga de proyectos en el pycamp activo\\. -/empezar\\_seleccion\\_proyectos: Habilita la seleccion sobre los proyectos del pycamp activo\\. -/terminar\\_seleccion\\_proyectos: Deshabilita la seleccion sobre los proyectos del pycamp activo\\. -/empezar\\_pycamp: Setea el tiempo de inicio del pycamp activo\\. \ -Por default usa datetime\\.now\\(\\) -/terminar\\_pycamp: Setea el timepo de fin del pycamp activo\\. \ -Por default usa datetime\\.now\\(\\) -/cronogramear: Te pregunta cuantos dias y que slot tiene tu pycamp \ - y genera el cronograma\\. -/cambiar\\_slot: Toma el nombre de un proyecto y el nuevo slot \ - y lo cambia en el cronograma\\. - -**Gestión de magxs** - -/ser\\_magx Tienen que ejecutar los candidatos, al inicio del PyCamp\\. -/agendar\\_magx Genera una agenda de magxs para todo el evento\\. -/ver\\_agenda\\_magx Para conocer la agenda magos de todo el evento\\. -/ver\\_magx Para conocer el magx actual\\. -/evocar\\_magx Para llamar al mago actual\\. - -Pycampista: -/degradar \\(username\\): Le saca los permisos de admin a un usuario\\. -''' + user_commands_help - - -def get_help(update, context): - if is_admin(update, context): - return HELP_MESSAGE_ADMIN - return HELP_MESSAGE diff --git a/src/pycamp_bot/commands/manage_pycamp.py b/src/pycamp_bot/commands/manage_pycamp.py deleted file mode 100644 index 9d3b2f4..0000000 --- a/src/pycamp_bot/commands/manage_pycamp.py +++ /dev/null @@ -1,248 +0,0 @@ -import datetime -from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, filters -from pycamp_bot.models import Pycamp -from pycamp_bot.models import Pycampista -from pycamp_bot.models import PycampistaAtPycamp -from pycamp_bot.commands.auth import admin_needed -from pycamp_bot.logger import logger -from pycamp_bot.utils import escape_markdown - - -SET_DATE_STATE = "set_fate" -SET_DURATION_STATE = "set_duration" -WRAP_UP_STATE = "wrap_up" - - -def get_pycamp_by_name(name): - pycamps = Pycamp.select().where(Pycamp.headquarters == name) - count = pycamps.count() - if count == 1: - return pycamps[0] - logger.info('There is some error. Pycamps with name {} has count != 1 ({})'.format(name, count)) - return None - - -def get_active_pycamp(): - active = Pycamp.select().where(Pycamp.active) - if active.count() == 0: - return False, None - return True, active[0] - - -def active_needed(f): - def wrap(*args, **kargs): - bot, update = args - is_active, _ = get_active_pycamp() - if is_active: - return f(*args) - else: - bot.send_message( - chat_id=update.message.chat_id, - text="No hay un PyCamp activo.") - return wrap - - -@admin_needed -async def set_active_pycamp(update, context): - is_active, pycamp = get_active_pycamp() - parameters = update.message.text.split(' ') - - if is_active: - pycamp.active = False - pycamp.save() - - if not len(parameters) == 2: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="El comando necesita un parametro (pycamp name)") - return - - pycamp = get_pycamp_by_name(parameters[1]) - if pycamp is None: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="El Pycamp {} no existe".format(parameters[1])) - return - - pycamp.active = True - pycamp.save() - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="El Pycamp {} ahora esta activo".format(pycamp.headquarters)) - - -@admin_needed -async def add_pycamp(update, context): - parameters = update.message.text.split(' ', 1) - if len(parameters) < 2: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="El comando necesita un parametro (headquarters)") - return - hq = parameters[1].strip() - if not hq: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="El parámetro headquarters no puede ser vacío") - return - - pycamp = Pycamp.get_or_create(headquarters=hq, active=True)[0] - pycamp.set_as_only_active() - logger.info('Creado: {}'.format(pycamp)) - - msg = "El Pycamp {} fue creado.\n¿Cuándo empieza? (formato yyyy-mm-dd)" - await context.bot.send_message( - chat_id=update.message.chat_id, - text=msg.format(pycamp.headquarters) - ) - return SET_DATE_STATE - - -async def define_start_date(update, context): - text = update.message.text - try: - start_date = datetime.datetime.fromisoformat(text) - except ValueError: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="mmm no entiendo esa fecha\\. El formato esperado es `yyyy-mm-dd`\\. ¿De nuevo?", - parse_mode="MarkdownV2" - ) - return SET_DATE_STATE - - _, pycamp = get_active_pycamp() - pycamp.init = start_date - pycamp.save() - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="¿Cuantos días dura el PyCamp?" - ) - return SET_DURATION_STATE - - -async def define_duration(update, context): - text = update.message.text.strip() - try: - duration = int(text) - except ValueError: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="mmm no entiendo. Poné un número entero porfa." - ) - return SET_DURATION_STATE - - _, pycamp = get_active_pycamp() - pycamp.end = pycamp.init + datetime.timedelta( - days=duration - 1, - hours=23, - minutes=59, - seconds=59, - milliseconds=99 - ) - pycamp.save() - - msg = "Listo, el PyCamp '{}' está activo, desde el {} hasta el {}".format( - pycamp.headquarters, - pycamp.init.date(), - pycamp.end.date() - ) - await context.bot.send_message( - chat_id=update.message.chat_id, - text=msg - ) - return ConversationHandler.END - - -async def cancel(update, context): - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Se canceló la carga del PyCamp...") - return ConversationHandler.END - - -load_start_pycamp = ConversationHandler( - entry_points=[CommandHandler('empezar_pycamp', add_pycamp)], - states={ - SET_DATE_STATE: [MessageHandler(filters.TEXT, define_start_date)], - SET_DURATION_STATE: [MessageHandler(filters.TEXT, define_duration)] - }, - fallbacks=[CommandHandler('cancel', cancel)] -) - - -@active_needed -@admin_needed -async def end_pycamp(update, context): - parameters = update.message.text.split(' ') - if len(parameters) == 2: - date = datetime.datetime.fromisoformat(parameters[1]) - else: - date = datetime.datetime.now() - - is_active, pycamp = get_active_pycamp() - pycamp.active = False - pycamp.end = date - pycamp.save() - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Terminó Pycamp :( ! {}".format(date)) - - -async def add_pycampista_to_pycamp(update, context): - username = update.message.from_user.username - chat_id = update.message.chat_id - pycampista = Pycampista.get_or_create(username=username, chat_id=chat_id)[0] - - parameters = update.message.text.split(' ') - if len(parameters) == 2: - pycamp = get_pycamp_by_name(parameters[1]) - else: - is_active, pycamp = get_active_pycamp() - PycampistaAtPycamp.get_or_create(pycamp=pycamp, pycampista=pycampista) - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="El pycampista {} fue agregado al pycamp {}".format(username, - pycamp.headquarters)) - - -async def list_pycamps(update, context): - pycamps = Pycamp.select() - text = ['Pycamps:'] - for pycamp in pycamps: - text.append(str(pycamp)) - - text = "\n\n".join(text) - await update.message.reply_text(text) - - -@active_needed -async def list_pycampistas(update, context): - is_active, pycamp = get_active_pycamp() - - pycampistas_at_pycamp = PycampistaAtPycamp.select().where( - PycampistaAtPycamp.pycamp == pycamp) - - text = ['Pycampistas:'] - for pap in pycampistas_at_pycamp: - text.append(str(pap.pycampista)) - - text = "\n\n".join(text) - await update.message.reply_text(text + len(pycampistas_at_pycamp)) - - -def set_handlers(application): - application.add_handler(load_start_pycamp) - application.add_handler( - CommandHandler('terminar_pycamp', end_pycamp)) - application.add_handler( - CommandHandler('activar_pycamp', set_active_pycamp)) - application.add_handler( - CommandHandler('pycamps', list_pycamps)) - application.add_handler( - CommandHandler('voy_al_pycamp', add_pycampista_to_pycamp)) - application.add_handler( - CommandHandler('pycampistas', list_pycampistas)) diff --git a/src/pycamp_bot/commands/projects.py b/src/pycamp_bot/commands/projects.py deleted file mode 100644 index 3d80c4b..0000000 --- a/src/pycamp_bot/commands/projects.py +++ /dev/null @@ -1,611 +0,0 @@ -import logging -import textwrap - -import peewee -from telegram import InlineKeyboardButton, InlineKeyboardMarkup, LinkPreviewOptions -from telegram.ext import CallbackQueryHandler, CommandHandler, ConversationHandler, MessageHandler, filters -from pycamp_bot.models import Pycampista, Project, Slot, Vote -from pycamp_bot.commands.base import msg_to_active_pycamp_chat -from pycamp_bot.commands.manage_pycamp import active_needed, get_active_pycamp -from pycamp_bot.commands.auth import admin_needed, get_admins_username -from pycamp_bot.utils import escape_markdown, get_slot_weekday_name - -current_projects = {} - -NOMBRE = "nombre" -DIFICULTAD = "dificultad" -TOPIC = "topic" -CHECK_REPOSITORIO = "check_repositorio" -REPOSITORIO = "repositorio" -CHECK_GRUPO = "check_grupo" -GRUPO = "grupo" - -DIFFICULTY_LEVEL_NAMES = { - 1: 'inicial', - 2: 'intermedio', - 3: 'avanzado', -} - -REPO_EXISTS_PATTERN = 'repoexists' -PROJECT_NAME_PATTERN = 'projectname' -GROUP_EXISTS_PATTERN = 'groupexists' - -logger = logging.getLogger(__name__) - - -def load_authorized(f): - async def wrap(*args, **kargs): - logger.info('Load authorized wrapper') - - update, context = args - is_active, pycamp = get_active_pycamp() - if pycamp.project_load_authorized: - return await f(*args, **kargs) - else: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="La carga de proyectos no está autorizada. Avisale a un\ - admin (/admins)!") - return wrap - - -@load_authorized -@active_needed -async def load_project(update, context): - '''Command to start the cargar_proyectos dialog''' - logger.info("Adding project") - username = update.message.from_user.username - - logger.info("Load authorized. Starting dialog") - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="¿Cuál es el nombre del proyecto?", - ) - return NOMBRE - - -async def naming_project(update, context): - '''Dialog to set project name''' - logger.info("Nombrando el proyecto") - username = update.message.from_user.username - name = update.message.text - - if name == '/cargar_proyecto': - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Hubo un problema de conectividad, volvé a ingresar el nombre" - ) - return NOMBRE - user = Pycampista.get_or_create(username=username, chat_id=update.message.chat_id)[0] - - new_project = Project(name=name) - new_project.owner = user - - current_projects[username] = new_project - - await context.bot.send_message( - chat_id=update.message.chat_id, - text=textwrap.dedent(f""" - ¿Cuál es el nivel de dificultad del proyecto? - - 1: {DIFFICULTY_LEVEL_NAMES[1]} - 2: {DIFFICULTY_LEVEL_NAMES[2]} - 3: {DIFFICULTY_LEVEL_NAMES[3]}""" - ) - ) - return DIFICULTAD - - -async def project_level(update, context): - '''Dialog to set project level''' - username = update.message.from_user.username - text = update.message.text - - if text in ["1", "2", "3"]: - new_project = current_projects[username] - new_project.difficult_level = text - - await context.bot.send_message( - chat_id=update.message.chat_id, - text=textwrap.dedent(""" - ¿Cuál es la temática del proyecto? - - Ejemplos: - - flask - - django - - telegram - - inteligencia artificial - - recreativo""" - ) - ) - return TOPIC - else: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Nooooooo input no válido, por favor ingresá 1, 2 o 3" - ) - return DIFICULTAD - - -async def project_topic(update, context): - '''Dialog to set project topic''' - username = update.message.from_user.username - text = update.message.text - - new_project = current_projects[username] - new_project.topic = text - - keyboard = [ - [ - InlineKeyboardButton("Sí", callback_data=f"{REPO_EXISTS_PATTERN}:si"), - InlineKeyboardButton("No", callback_data=f"{REPO_EXISTS_PATTERN}:no"), - ] - ] - reply_markup = InlineKeyboardMarkup(keyboard) - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="¿El proyecto tiene un repositorio?", - reply_markup=reply_markup, - ) - - return CHECK_REPOSITORIO - - -async def save_project(username, chat_id, context): - '''Save project to database''' - new_project = current_projects[username] - - try: - new_project.save() - except peewee.IntegrityError: - await context.bot.send_message( - chat_id=chat_id, - text="Ups ese proyecto ya fue cargado" - ) - else: - await context.bot.send_message( - chat_id=chat_id, - text="Proyecto cargado" - ) - - -async def present_group_inline_keyboard(chat_id, context): - keyboard = [ - [ - InlineKeyboardButton("Sí", callback_data=f"{GROUP_EXISTS_PATTERN}:si"), - InlineKeyboardButton("No", callback_data=f"{GROUP_EXISTS_PATTERN}:no"), - ] - ] - reply_markup = InlineKeyboardMarkup(keyboard) - await context.bot.send_message( - chat_id=chat_id, - text="¿Tu proyecto tiene un grupo de Telegram?", - reply_markup=reply_markup, - ) - - -async def ask_if_repository_exists(update, context): - '''Dialog to ask if a repository exists''' - callback_query = update.callback_query - chat = callback_query.message.chat - - if callback_query.data.split(':')[1] == "si": - await context.bot.send_message( - chat_id=chat.id, - text="¿Cuál es la URL del repositorio del proyecto?", - ) - return REPOSITORIO - else: - await context.bot.send_message( - chat_id=chat.id, - text="Si creás un repositorio, podés agregarlo con /agregar_repositorio." - ) - - await present_group_inline_keyboard( - chat_id=chat.id, - context=context, - ) - - return CHECK_GRUPO - - -async def ask_if_group_exists(update, context): - '''Dialog to ask if a group exists''' - callback_query = update.callback_query - chat = callback_query.message.chat - - if callback_query.data.split(':')[1] == "si": - await context.bot.send_message( - chat_id=chat.id, - text="¿Cuál es la URL del grupo del proyecto?", - ) - return GRUPO - else: - await context.bot.send_message( - chat_id=chat.id, - text="Si creás un grupo, podés agregarlo con /agregar_grupo." - ) - await save_project(callback_query.from_user.username, chat.id, context) - return ConversationHandler.END - - -async def project_repository(update, context): - '''Dialog to set project repository''' - username = update.message.from_user.username - text = update.message.text - - new_project = current_projects[username] - new_project.repository_url = text - - await present_group_inline_keyboard( - chat_id=update.message.chat_id, - context=context, - ) - - return CHECK_GRUPO - - -async def project_group(update, context): - '''Dialog to set project group''' - username = update.message.from_user.username - text = update.message.text - - new_project = current_projects[username] - new_project.group_url = text - - await save_project(username, update.message.chat_id, context) - return ConversationHandler.END - - -async def cancel(update, context): - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Has cancelado la carga del proyecto") - return ConversationHandler.END - - -@active_needed -async def ask_project_name(update, context): - '''Command to start the agregar_repositorio/agregar_grupo dialogs''' - username = update.message.from_user.username - - projects = Project.select().join(Pycampista).where(Pycampista.username == username) - - if not projects: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="No cargaste ningún proyecto", - ) - return ConversationHandler.END - - keyboard = [] - for project in projects: - keyboard.append([InlineKeyboardButton(project.name, callback_data=f"{PROJECT_NAME_PATTERN}:{project.id}")]) - reply_markup = InlineKeyboardMarkup(keyboard) - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="¿Qué proyecto querés modificar?", - reply_markup=reply_markup, - ) - - return 1 - - -async def ask_repository_url(update, context): - '''Dialog to set project name''' - callback_query = update.callback_query - chat = callback_query.message.chat - - username = callback_query.from_user.username - - current_projects[username] = callback_query.data.split(':')[1] - - await context.bot.send_message( - chat_id=chat.id, - text="¿Cuál es la URL del repositorio?", - ) - return 2 - - -async def ask_group_url(update, context): - '''Dialog to set project name''' - callback_query = update.callback_query - chat = callback_query.message.chat - - username = callback_query.from_user.username - - current_projects[username] = callback_query.data.split(':')[1] - - await context.bot.send_message( - chat_id=chat.id, - text="¿Cuál es la URL del grupo?", - ) - return 2 - - -async def add_repository(update, context): - '''Dialog to set repository''' - username = update.message.from_user.username - text = update.message.text - - project = Project.select().where(Project.id == current_projects[username]).get() - - project.repository_url = text - project.save() - - await context.bot.send_message( - chat_id=update.message.chat_id, - text=f'Repositorio agregado', - ) - return ConversationHandler.END - - -async def add_group(update, context): - '''Dialog to set group''' - username = update.message.from_user.username - text = update.message.text - - project = Project.select().where(Project.id == current_projects[username]).get() - - project.group_url = text - project.save() - - await context.bot.send_message( - chat_id=update.message.chat_id, - text=f'Grupo agregado', - ) - return ConversationHandler.END - - -@active_needed -@admin_needed -async def start_project_load(update, context): - """Allow people to upload projects""" - _, pycamp = get_active_pycamp() - - if not pycamp.project_load_authorized: - pycamp.project_load_authorized = True - pycamp.save() - - await update.message.reply_text("Carga de proyectos Abierta") - await msg_to_active_pycamp_chat(context.bot, "Carga de proyectos Abierta") - else: - await update.message.reply_text("La carga de proyectos ya estaba abierta") - - -@active_needed -@admin_needed -async def end_project_load(update, context): - """Prevent people for keep uploading projects""" - logger.info("Closing proyect load") - - _, pycamp = get_active_pycamp() - - if pycamp.project_load_authorized: - pycamp.project_load_authorized = False - pycamp.save() - - await update.message.reply_text( - "Autorizadx \nInformación Cargada, carga de proyectos cerrada") - await msg_to_active_pycamp_chat(context.bot, "La carga de proyectos esta Cerrada") - - -load_project_handler = ConversationHandler( - entry_points=[CommandHandler('cargar_proyecto', load_project)], - states={ - NOMBRE: [MessageHandler(filters.TEXT, naming_project)], - DIFICULTAD: [MessageHandler(filters.TEXT, project_level)], - TOPIC: [MessageHandler(filters.TEXT, project_topic)], - CHECK_REPOSITORIO: [CallbackQueryHandler(ask_if_repository_exists, pattern=f'{REPO_EXISTS_PATTERN}:')], - REPOSITORIO: [MessageHandler(filters.TEXT, project_repository)], - CHECK_GRUPO: [CallbackQueryHandler(ask_if_group_exists, pattern=f'{GROUP_EXISTS_PATTERN}:')], - GRUPO: [MessageHandler(filters.TEXT, project_group)], - }, - fallbacks=[CommandHandler('cancel', cancel)]) - - -async def delete_project(update, context): - """delete project loaded""" - username = update.message.from_user.username - project_name_splited = update.message.text.split() - project_name_lower = [i.lower() for i in project_name_splited] - - if len(project_name_splited) < 2: - await context.bot.send_message( - chat_id=update.message.chat_id, - text=( - "Debes ingresar el nombre de proyecto a eliminar.\n" - "Ej: /borrar_proyecto intro django." - ) - ) - return - else: - try: - project_name = ' '.join(project_name_lower[1:]) - project = Project.select().where(Project.name == project_name).get() - except Exception: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="No se encontró el proyecto '{}'.".format(project_name) - ) - return - - if username != project.owner.username and username not in get_admins_username(): - await context.bot.send_message( - chat_id=update.message.chat_id, - text="No sos ni admin ni el owner de este proyecto, Careta." - ) - return - else: - project.delete_instance() - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Se ha eliminado el proyecto {} satisfactoriamente.".format(project_name.title()) - ) - return - - -async def show_projects(update, context): - """Show available projects""" - projects = Project.select() - if not projects: - msg_text = "Todavía no hay ningún proyecto cargado" - await update.message.reply_text(msg_text, link_preview_options=LinkPreviewOptions(is_disabled=True)) - - msg_text = "" - PROJECT_FIELDS = [ - '*{}*', - 'Owner: @{}', - 'Temática: {}', - 'Nivel: {}', - 'Repositorio: {}', - 'Grupo de Telegram: {}', - ] - for project in projects: - project_text = '\n'.join(PROJECT_FIELDS).format( - escape_markdown(project.name), - escape_markdown(project.owner.username), - escape_markdown(project.topic), - DIFFICULTY_LEVEL_NAMES[project.difficult_level], - escape_markdown(project.repository_url or '(ninguno)'), - escape_markdown(project.group_url or '(ninguno)'), - ) - participants_count = Vote.select().where( - (Vote.project == project) & (Vote.interest)).count() - if participants_count > 0: - project_text += "\nInteresades: {}".format(participants_count) - - if len(msg_text) + len(project_text) > 4096: - await update.message.reply_text(msg_text, link_preview_options=LinkPreviewOptions(is_disabled=True), parse_mode='MarkdownV2') - msg_text = "" - - msg_text += "\n\n" + project_text - - if msg_text: - await update.message.reply_text(msg_text, link_preview_options=LinkPreviewOptions(is_disabled=True), parse_mode='MarkdownV2') - - -async def show_participants(update, context): - """Show participants for a project""" - - if len(update.message.text.split()) < 2: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="No se indico el nombre del proyecto. Modo de uso: '/participantes '" - ) - return - project_name = update.message.text.split() - project_name = (' '.join(project_name[1:])) - project = Project.select().where(Project.name == project_name) - if not project: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="No se encontro el proyecto. Consulte /proyectos" - ) - return - - votes = Vote.select().where( - (Vote.project == project) & (Vote.interest)) - participants = set() - for vote in votes: - participants.add(vote.pycampista.username) - - response = f"Participantes:\n" - for participant in participants: - response = response + f"@{participant} \n" - - await update.message.reply_text(response) - - -async def show_my_projects(update, context): - """Let people see what projects they have voted for""" - - user = Pycampista.get( - Pycampista.username == update.message.from_user.username, - ) - votes = ( - Vote - .select(Project, Slot) - .join(Project) - .join(Slot) - .where( - (Vote.pycampista == user) & - Vote.interest - ) - .order_by(Slot.code) - ) - - if votes: - text_chunks = [] - - prev_slot_day_code = None - - for vote in votes: - slot_day_code = vote.project.slot.code[0] - slot_day_name = get_slot_weekday_name(slot_day_code) - - if slot_day_code != prev_slot_day_code: - text_chunks.append(f'*{slot_day_name}*') - - project_lines = [ - f'{vote.project.slot.start}:00', - escape_markdown(vote.project.name), - f'Owner: @{escape_markdown(vote.project.owner.username)}', - ] - - text_chunks.append('\n'.join(project_lines)) - - prev_slot_day_code = slot_day_code - - text = '\n\n'.join(text_chunks) - else: - text = "No votaste por ningún proyecto" - - await update.message.reply_text(text, parse_mode='MarkdownV2') - -def set_handlers(application): - add_repository_handler = ConversationHandler( - entry_points=[ - CommandHandler('agregar_repositorio', ask_project_name), - ], - states={ - 1: [CallbackQueryHandler(ask_repository_url, pattern=f'{PROJECT_NAME_PATTERN}:')], - 2: [MessageHandler(filters.TEXT, add_repository)], - }, - fallbacks=[ - CommandHandler('cancel', cancel), - ], - ) - add_group_handler = ConversationHandler( - entry_points=[ - CommandHandler('agregar_grupo', ask_project_name), - ], - states={ - 1: [CallbackQueryHandler(ask_group_url, pattern=f'{PROJECT_NAME_PATTERN}:')], - 2: [MessageHandler(filters.TEXT, add_group)], - }, - fallbacks=[ - CommandHandler('cancel', cancel), - ], - ) - - application.add_handler(load_project_handler) - application.add_handler(add_repository_handler) - application.add_handler(add_group_handler) - - application.add_handler( - CommandHandler('empezar_carga_proyectos', start_project_load)) - application.add_handler( - CommandHandler('terminar_carga_proyectos', end_project_load)) - application.add_handler( - CommandHandler('borrar_proyecto', delete_project)) - application.add_handler( - CommandHandler('proyectos', show_projects)) - application.add_handler( - CommandHandler('participantes', show_participants)) - application.add_handler( - CommandHandler('mis_proyectos', show_my_projects)) - diff --git a/src/pycamp_bot/commands/raffle.py b/src/pycamp_bot/commands/raffle.py deleted file mode 100644 index 8031e4e..0000000 --- a/src/pycamp_bot/commands/raffle.py +++ /dev/null @@ -1,17 +0,0 @@ -import random -from telegram.ext import CommandHandler -from pycamp_bot.models import Pycampista -from pycamp_bot.commands.auth import admin_needed - - -@admin_needed -async def get_random_user(update, context): - cantidad_campistas = Pycampista.select().count() - index_random = random.randint(1,cantidad_campistas) - user_name = Pycampista.get_by_id(index_random).username - await update.message.reply_text(user_name) - -def set_handlers(application): - application.add_handler( - CommandHandler('rifar', get_random_user)) - \ No newline at end of file diff --git a/src/pycamp_bot/commands/schedule.py b/src/pycamp_bot/commands/schedule.py deleted file mode 100644 index 19c9c51..0000000 --- a/src/pycamp_bot/commands/schedule.py +++ /dev/null @@ -1,229 +0,0 @@ -import string -from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, filters -from pycamp_bot.models import Project, Slot, Pycampista, Vote -from pycamp_bot.commands.auth import admin_needed -from pycamp_bot.scheduler.db_to_json import export_db_2_json -from pycamp_bot.scheduler.schedule_calculator import export_scheduled_result -from pycamp_bot.utils import escape_markdown, get_slot_weekday_name - - -DAY_SLOT_TIME = { - 'day':[], # Guarda el codigo del dia ej: ['A','B'] - 'slot':[], # Guarda la cantidad de slots del dia iterado ej [5] (se sobreescribe) - 'time':[], # Guarda la hora a la que empieza el dia iterado [15] (se sobreescribe) -} - - -async def cancel(update, context): - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Has cancelado la carga de slots") - return ConversationHandler.END - - -@admin_needed -async def define_slot_days(update, context): - # TODO: filtrar proyectos por pycamp activo. - if Slot.select().exists(): - await context.bot.send_message( - chat_id=update.message.chat_id, - text="El cronograma ya existe." - ) - return - - if not Project.select().exists(): - await context.bot.send_message( - chat_id=update.message.chat_id, - text="No hay proyectos que cronogramear." - ) - return - - if not Vote.select().exists(): - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Todavia no se realizo la votacion." - ) - return - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Cuantos dias tiene tu cronograma?" - ) - return 1 - - -async def define_slot_ammount(update, context): - global DAY_SLOT_TIME - text = update.message.text - if text not in ["1", "2", "3", "4", "5", "6", "7"]: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="mmm eso no parece un numero de dias razonable, de nuevo?" - ) - return 1 - - - DAY_SLOT_TIME['day'] =list(string.ascii_uppercase[0:int(text)]) - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Cuantos slots tiene tu dia {}".format(DAY_SLOT_TIME['day'][0]) - ) - return 2 - - -async def define_slot_times(update, context): - text = update.message.text - day = DAY_SLOT_TIME['day'][0] - await context.bot.send_message( - chat_id=update.message.chat_id, - text="A que hora empieza tu dia {}".format(day) - ) - DAY_SLOT_TIME['slot'] = [text] - return 3 - - -async def create_slot(update, context): - username = update.message.from_user.username - chat_id = update.message.chat_id - text = update.message.text - - DAY_SLOT_TIME['time'] = [text] - slot_amount = DAY_SLOT_TIME['slot'][0] - times = list(range(int(slot_amount)+1))[1:] - starting_hour = int(text) - - while len(times) > 0: - new_slot = Slot(code=str(DAY_SLOT_TIME['day'][0]+str(times[0]))) - new_slot.start = starting_hour - - pycampista = Pycampista.get_or_create(username=username, chat_id=chat_id)[0] - new_slot.current_wizard = pycampista - - new_slot.save() - times.pop(0) - starting_hour += 1 - - DAY_SLOT_TIME['day'].pop(0) - - if len(DAY_SLOT_TIME['day']) > 0: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Cuantos slots tiene tu dia {}".format(DAY_SLOT_TIME['day'][0]) - ) - return 2 - else: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Genial! Slots Asignados" - ) - make_schedule(update, context) - return ConversationHandler.END - - -async def make_schedule(update, context): - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Generando el Cronograma..." - ) - - data_json = export_db_2_json() - my_schedule = export_scheduled_result(data_json) - - for relationship in my_schedule: - slot = Slot.get(Slot.code == relationship[1]) - project = Project.get(Project.name == relationship[0]) - project.slot = slot.id - project.save() - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Cronograma Generado!" - ) - - -async def check_day_tab(slot, prev_slot, cronograma): - def append_day_name(): - cronograma.append(f'*{get_slot_weekday_name(slot.code[0])}:*') - - if prev_slot is None: - append_day_name() - elif slot.code[0] != prev_slot.code[0]: - cronograma.append('') - append_day_name() - - -async def show_schedule(update, context): - slots = Slot.select() - projects = Project.select() - cronograma = [] - - prev_slot = None - - for i, slot in enumerate(slots): - await check_day_tab(slot, prev_slot, cronograma) - - for project in projects: - if project.slot_id == slot.id: - cronograma.append(f'{slot.start}:00 *{escape_markdown(project.name)}*') - cronograma.append(f'Owner: @{escape_markdown(project.owner.username)}') - - prev_slot = slot - - await context.bot.send_message( - chat_id=update.message.chat_id, - text='\n'.join(cronograma), - parse_mode='MarkdownV2' - ) - - -@admin_needed -async def change_slot(update, context): - projects = Project.select() - slots = Slot.select() - text = update.message.text.split(' ') - - if not len(text) >= 3: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="""El formato de este comando es: - /cambiar_slot NOMBRE_DEL_PROYECTO NUEVO_SLOT - ej: /cambiar_slot fades AB - """ - ) - return - - found = False - project_name = " ".join(text[1:-1]) - for project in projects: - if project.name == project_name: - for slot in slots: - if slot.code == text[-1]: - found = True - project.slot = slot.id - project.save() - if found: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="Exito" - ) - else: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="O el slot o el nombre del proyecto no estan en la db" - ) - - -load_schedule_handler = ConversationHandler( - entry_points=[CommandHandler('cronogramear', define_slot_days)], - states={ - 1: [MessageHandler(filters.TEXT, define_slot_ammount)], - 2: [MessageHandler(filters.TEXT, define_slot_times)], - 3: [MessageHandler(filters.TEXT, create_slot)]}, - fallbacks=[CommandHandler('cancel', cancel)]) - - -def set_handlers(application): - application.add_handler(CommandHandler('cronograma', show_schedule)) - application.add_handler(CommandHandler('cambiar_slot', change_slot)) - application.add_handler(load_schedule_handler) diff --git a/src/pycamp_bot/commands/voting.py b/src/pycamp_bot/commands/voting.py deleted file mode 100644 index db8c143..0000000 --- a/src/pycamp_bot/commands/voting.py +++ /dev/null @@ -1,143 +0,0 @@ -import functools -import peewee -from telegram import InlineKeyboardButton, InlineKeyboardMarkup -from telegram.ext import CommandHandler, CallbackQueryHandler -from pycamp_bot.commands.base import msg_to_active_pycamp_chat -from pycamp_bot.commands.auth import admin_needed -from pycamp_bot.commands.manage_pycamp import active_needed, get_active_pycamp -from pycamp_bot.models import Pycampista, Project, Vote -from pycamp_bot.logger import logger - - -VOTE_PATTERN = 'vote' - - -def vote_authorized(func): - @functools.wraps(func) - async def wrap(*args): - logger.info('Vote authorized wrapper') - - update, context = args - is_active, pycamp = get_active_pycamp() - if pycamp.vote_authorized: - await func(update, context) - else: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="La eleccion no está autorizada. Avisale a un admin (/admins)!") - return wrap - - -@admin_needed -@active_needed -async def start_voting(update, context): - logger.info("Empezando la seleccion.") - - is_active, pycamp = get_active_pycamp() - - if not pycamp.vote_authorized: - pycamp.vote_authorized = True - pycamp.save() - await update.message.reply_text("Autorizadx. \nSelección Abierta.") - await msg_to_active_pycamp_chat(context.bot, "La elección de proyectos esta abierta!") - else: - await update.message.reply_text("La eleccion ya estaba abierta.") - - -async def button(update, context): - '''Save user vote in the database''' - query = update.callback_query - username = query.message['chat']['username'] - chat_id = query.message.chat_id - user = Pycampista.get_or_create(username=username, chat_id=chat_id)[0] - project_name = query.message['text'] - - # Get project from the database - project = Project.get(Project.name == project_name) - - # create a new vote object - new_vote = Vote( - pycampista=user, - project=project, - _project_pycampista_id=f"{project.id}-{user.id}" - ) - - # Save vote in the database and confirm the chosen proyects. - - if query.data.split(':')[1] == "si": - result = f"✅ Sumade a {project_name}!" - new_vote.interest = True - else: - new_vote.interest = False - result = f'❌ Proyecto {project_name} salteado.' - - try: - new_vote.save() - await context.bot.edit_message_text(text=result, - chat_id=query.message.chat_id, - message_id=query.message.message_id) - except peewee.IntegrityError: - logger.warning(f"Error al guardar la eleccion de {username} en el proyecto {project_name}") - await context.bot.edit_message_text( - text=f"Ya te habías sumado al proyecto {project_name}!", - chat_id=query.message.chat_id, - message_id=query.message.message_id - ) - - -@vote_authorized -async def vote(update, context): - logger.info("Vote message") - - await update.message.reply_text( - 'Te interesa el proyecto:' - ) - - # if there is not project in the database, create a new project - if not Project.select().exists(): - Project.create(name='PROYECTO DE PRUEBA') - - # ask user for each project in the database - for project in Project.select(): - keyboard = [[InlineKeyboardButton("Me Sumo!", callback_data=f"{VOTE_PATTERN}:si"), - InlineKeyboardButton("Paso", callback_data=f"{VOTE_PATTERN}:no")]] - - reply_markup = InlineKeyboardMarkup(keyboard) - - await update.message.reply_text( - text=project.name, - reply_markup=reply_markup - ) - - -@admin_needed -@active_needed -@vote_authorized -async def end_voting(update, context): - is_active, pycamp = get_active_pycamp() - - pycamp.vote_authorized = False - pycamp.save() - await update.message.reply_text("Selección cerrada") - await msg_to_active_pycamp_chat(context.bot, "La selección de proyectos ha finalizado.") - -async def vote_count(update, context): - votes = [vote.pycampista_id for vote in Vote.select()] - vote_count = len(set(votes)) - await context.bot.send_message( - chat_id=update.message.chat_id, - text=f"Votaron: {vote_count}" - ) - - -def set_handlers(application): - application.add_handler( - CallbackQueryHandler(button, pattern=f'{VOTE_PATTERN}:')) - application.add_handler( - CommandHandler('empezar_votacion_proyectos', start_voting)) - application.add_handler( - CommandHandler('votar', vote)) - application.add_handler( - CommandHandler('terminar_votacion_proyectos', end_voting)) - application.add_handler( - CommandHandler('contar_votos', vote_count)) diff --git a/src/pycamp_bot/commands/wizard.py b/src/pycamp_bot/commands/wizard.py deleted file mode 100644 index e8e9c17..0000000 --- a/src/pycamp_bot/commands/wizard.py +++ /dev/null @@ -1,319 +0,0 @@ -import random -from collections import defaultdict -from datetime import datetime, timedelta -from itertools import cycle -from telegram.ext import CommandHandler -from telegram.error import BadRequest -from pycamp_bot.models import Pycampista, WizardAtPycamp -from pycamp_bot.commands.auth import admin_needed -from pycamp_bot.commands.manage_pycamp import get_active_pycamp -from pycamp_bot.logger import logger -from pycamp_bot.utils import escape_markdown, active_pycamp_needed - - -LUNCH_TIME_START_HOUR = 13 -LUNCH_TIME_END_HOUR = 14 -WIZARD_TIME_START_HOUR = 9 -WIZARD_TIME_END_HOUR = 20 - -MSG_MAX_LEN = 4096 - - -def is_wizard_time_slot(slot): - return slot[0].hour in range(WIZARD_TIME_START_HOUR, WIZARD_TIME_END_HOUR) - - -def is_lunch_time_slot(slot): - return slot[0].hour in range(LUNCH_TIME_START_HOUR, LUNCH_TIME_END_HOUR) - - -def is_after_first_lunch_slot(pycamp, slot): - return slot[0].day != pycamp.init.day or slot[0].hour >= LUNCH_TIME_END_HOUR - - -def is_before_last_lunch_slot(pycamp, slot): - """Must be False if slot starts after lunch the last day""" - return slot[0].day != pycamp.end.day or slot[0].hour < LUNCH_TIME_START_HOUR - - -def is_valid_wizard_slot(pycamp, slot): - """If True the slot is kept.""" - return ( - is_wizard_time_slot(slot) - and not is_lunch_time_slot(slot) - and is_after_first_lunch_slot(pycamp, slot) - and is_before_last_lunch_slot(pycamp, slot) - ) - - -def clean_wizards_free_slots(pycamp, slots): - return [slot for slot in slots if is_valid_wizard_slot(pycamp, slot)] - - -def compute_wizards_slots(pycamp): - """ - * Magxs trabajan de 9 a 19, sacando almuerzo (13 a 14). - * Magxs trabajan desde el mediodía del primer día, hasta el mediodía del último día. - - Slots son [start; end) - """ - wizard_start = pycamp.init - wizard_end = pycamp.end - slots = [] - current_period = wizard_start - while current_period < wizard_end: # TODO: check fields None - slot_start = current_period - slot_end = current_period + timedelta(minutes=pycamp.wizard_slot_duration) - slots.append( - (slot_start, slot_end) - ) - current_period = slot_end - - slots = clean_wizards_free_slots(pycamp, slots) - - return slots - - -def define_wizards_schedule(pycamp): - """ - Returns a dict whose keys are times and values are wizards (Pycampistas instances). - - """ - all_wizards = pycamp.get_wizards() - if len(all_wizards) == 0: - return {} - - wizard_per_slot = {} - wizards_iter = cycle(all_wizards) - for slot in compute_wizards_slots(pycamp): - # Cycle through the wizards, asigning them to slots. - wizard = next(wizards_iter) - if wizard.is_busy(*slot): - # If the target wizard is busy in this time slot, try to find another available wizard - if all(w.is_busy(*slot) for w in all_wizards): - # Nada que hacer, todos ocupados. Queda - logger.warning( - 'Queda el magx {} con conflicto en el slot {}'.format(wizard.username, slot) - ) - else: - # Sigo hasta el próximo que esté disponible - continue - wizard_per_slot[slot] = wizard - - return wizard_per_slot - - -@active_pycamp_needed -async def become_wizard(update, context, pycamp=None): - username = update.message.from_user.username - chat_id = update.message.chat_id - - pycamp.add_wizard(username, chat_id) - - await context.bot.send_message( - chat_id=update.message.chat_id, - text="¡Felicidades! Has sido registrado como magx." - ) - - -@active_pycamp_needed -async def list_wizards(update, context, pycamp=None): - msg = "" - for i, wizard in enumerate(pycamp.get_wizards()): - msg += "{}) @{}\n".format(i+1, wizard.username) - try: - await context.bot.send_message( - chat_id=update.message.chat_id, - text=msg - ) - except BadRequest as e: - logger.exception("Coulnd't deliver the Wizards list to {}".format(update.message.from_user.username)) - - -@active_pycamp_needed -async def summon_wizard(update, context, pycamp=None): - wizard = pycamp.get_current_wizard() - if wizard is None: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="No hay ningunx magx agendado a esta hora :-(" - ) - return - - username = update.message.from_user.username - if username == wizard.username: - await context.bot.send_message( - chat_id=wizard.chat_id, - text="🧙" - ) - await context.bot.send_message( - chat_id=wizard.chat_id, - text="Checkeá tu cabeza: si no ténes el sombrero de magx ¡deberías!\n(soltá la compu)" - ) - else: - try: - await context.bot.send_message( - chat_id=wizard.chat_id, - text="PING PING PING MAGX! @{} te necesita!".format(username) - ) - text="Tu magx asignadx es: @{}".format(wizard.username) - except BadRequest: - text="No se pudo notificar al magx asignadx: @{} Andá a buscarlo...".format(wizard.username) - logger.warn("Coulnd't notify the wizard {}".format(wizard.username)) - finally: - await context.bot.send_message( - chat_id=update.message.chat_id, - text=text - ) - -async def notify_scheduled_slots_to_wizard(update, context, pycamp, wizard, agenda): - per_day = defaultdict(list) - for entry in agenda: - k = entry.init.strftime("%a %d de %b") - per_day[k].append(entry) - - msg = "Esta es tu agenda de magx para el PyCamp {}".format(pycamp.headquarters) - for day, items in per_day.items(): - msg += "\nEl día _{}_:\n".format(day) - for i in items: - msg += "\t \\- {} a {}\n".format( - i.init.strftime("%H:%M"), - i.end.strftime("%H:%M"), - ) - - await context.bot.send_message( - chat_id=wizard.chat_id, - text=msg, - parse_mode="MarkdownV2" - ) - - -async def notify_schedule_to_wizards(update, context, pycamp): - for wizard in pycamp.get_wizards(): - wizard_agenda = WizardAtPycamp.select().where( - (WizardAtPycamp.pycamp == pycamp) & (WizardAtPycamp.wizard == wizard) - ).order_by(WizardAtPycamp.init) - - try: - await notify_scheduled_slots_to_wizard(update, context, pycamp, wizard, wizard_agenda) - logger.debug("Notified wizard schedule to {}".format(wizard.username)) - except BadRequest: - logger.warn("Coulnd't notify its wizard schedule to {}".format(wizard.username)) - - -def persist_wizards_schedule_in_db(pycamp): - """ - Aux function to generate the wizards schedule and persist WizardAtPycamp instances in the DB. - - """ - schedule = define_wizards_schedule(pycamp) - - for slot, wizard in schedule.items(): - start, end = slot - WizardAtPycamp.create( - pycamp=pycamp, - wizard=wizard, - init=start, - end=end - ) - - -@admin_needed -@active_pycamp_needed -async def schedule_wizards(update, context, pycamp=None): - n = pycamp.clear_wizards_schedule() - logger.info("Deleted wizards schedule ({} records)".format(n)) - - persist_wizards_schedule_in_db(pycamp) - logger.info("Wizards schedule persisted in the DB.") - - - await notify_schedule_to_wizards(update, context, pycamp) - - agenda = WizardAtPycamp.select().where(WizardAtPycamp.pycamp == pycamp) - - msg = format_wizards_schedule(agenda) - try: - await context.bot.send_message( - chat_id=update.message.chat_id, - text=msg, - parse_mode="MarkdownV2" - ) - except BadRequest as e: - m = "Coulnd't return the Wizards list to the admin. ".format(update.message.from_user.username) - if len(msg) >= MSG_MAX_LEN: - m += "The message is too long. Check the data in the DB ;-)" - logger.exception(m) - - -def format_wizards_schedule(agenda): - """Aux function to render the wizards schedule as a friendly message.""" - per_day = defaultdict(list) - for entry in agenda: - k = entry.init.strftime("%a %d de %b") - per_day[k].append(entry) - - msg = "Agenda de magxs:" - for day, items in per_day.items(): - msg += "\nEl día _{}_:\n".format(day) - for i in items: - msg += "\t \\- {} a {}:\t*{}* \n".format( - i.init.strftime("%H:%M"), - i.end.strftime("%H:%M"), - "@" + escape_markdown(i.wizard.username) - ) - return msg - -def aux_resolve_show_all(message): - show_all = False - parameters = message.text.strip().split(' ', 1) - if len(parameters) == 2: - flag = parameters[1].strip().lower() - show_all = (flag == "completa") # Once here, the only parameter must be valid - if not show_all: - # The parameter was something else... - raise ValueError("Wrong parameter") - elif len(parameters) > 2: - # Too many parameters... - raise ValueError("Wrong parameter") - return show_all - - -@active_pycamp_needed -async def show_wizards_schedule(update, context, pycamp=None): - try: - show_all = aux_resolve_show_all(update.message) - except ValueError: - await context.bot.send_message( - chat_id=update.message.chat_id, - text="El comando solo acepta un parámetro (opcional): 'completa'. ¿Probás de nuevo?", - ) - return - - agenda = WizardAtPycamp.select().where(WizardAtPycamp.pycamp == pycamp) - if not show_all: - agenda = agenda.where(WizardAtPycamp.end > datetime.now()) - agenda = agenda.order_by(WizardAtPycamp.init) - - msg = format_wizards_schedule(agenda) - - await context.bot.send_message( - chat_id=update.message.chat_id, - text=msg, - parse_mode="MarkdownV2" - ) - logger.debug("Wizards schedule delivered to {}".format(update.message.from_user.username)) - - - -def set_handlers(application): - application.add_handler( - CommandHandler('evocar_magx', summon_wizard)) - application.add_handler( - CommandHandler('ser_magx', become_wizard)) - application.add_handler( - CommandHandler('ver_magx', list_wizards)) - application.add_handler( - CommandHandler('agendar_magx', schedule_wizards)) - application.add_handler( - CommandHandler('ver_agenda_magx', show_wizards_schedule)) diff --git a/src/pycamp_bot/constants.py b/src/pycamp_bot/constants.py deleted file mode 100644 index e84cd30..0000000 --- a/src/pycamp_bot/constants.py +++ /dev/null @@ -1 +0,0 @@ -SENTRY_DATA_SOURCE_NAME_ENVVAR = 'SENTRY_DATA_SOURCE_NAME' diff --git a/src/pycamp_bot/logger.py b/src/pycamp_bot/logger.py deleted file mode 100644 index 4f431d3..0000000 --- a/src/pycamp_bot/logger.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Módulo para hacer loggeos.""" - -import logging - - -LOG_FORMAT = '[%(asctime)s] - [%(filename)s %(lineno)d] %(levelname)s:' -LOG_DATE_FORMAT = '%Y:%m:%d %H:%M:%S' - - -class LogFormatter(logging.Formatter): - """Formateador del log.""" - grey = "\x1b[38;20m" - blue = "\x1b[34;20m" - yellow = "\x1b[33;20m" - red = "\x1b[31;20m" - bold_red = "\x1b[31;1m" - reset = "\x1b[0m" - - FORMATS = { - logging.DEBUG: LOG_FORMAT + ' ' + grey + '%(message)s' + reset, - logging.INFO: LOG_FORMAT + ' ' + blue + '%(message)s' + reset, - logging.WARNING: LOG_FORMAT + ' ' + yellow + '%(message)s' + reset, - logging.ERROR: LOG_FORMAT + ' ' + red + '%(message)s' + reset, - logging.CRITICAL: LOG_FORMAT + ' ' + bold_red + '%(message)s' + reset, - } - - def format(self, record): - log_formatter = logging.Formatter( - fmt=self.FORMATS.get(record.levelno), - datefmt=LOG_DATE_FORMAT - ) - return log_formatter.format(record) - - -formatter = LogFormatter() -ch = logging.StreamHandler() -ch.setFormatter(formatter) -logger = logging.getLogger(__name__) -logger.addHandler(ch) -logger.setLevel(logging.DEBUG) -logger.propagate = False diff --git a/src/pycamp_bot/models.py b/src/pycamp_bot/models.py deleted file mode 100644 index 935c770..0000000 --- a/src/pycamp_bot/models.py +++ /dev/null @@ -1,212 +0,0 @@ -import peewee as pw - -from datetime import datetime, timedelta -import datetime -from zoneinfo import ZoneInfo -from pycamp_bot.logger import logger - -from random import choice - - -DEFAULT_SLOT_PERIOD = 60 # Minutos - -db = pw.SqliteDatabase('pycamp_projects.db') - - -class BaseModel(pw.Model): - class Meta: - database = db - - -class Pycampista(BaseModel): - ''' - Representation of the pycamp user - username: name on telegram (ex. roberto for @roberto) - chat_id: number in string format - arrive: time of arrival - leave: time of departure - wizard: True or False for is a wizard - admin: True or False for admin privileges - ''' - username = pw.CharField(unique=True) - chat_id = pw.CharField(unique=True, null=True) - arrive = pw.DateTimeField(null=True) - leave = pw.DateTimeField(null=True) - wizard = pw.BooleanField(null=True) - admin = pw.BooleanField(null=True) - - def __str__(self): - rv_str = 'Pycampista:\n' - for attr in ['username', 'arrive', 'leave']: - rv_str += f'{attr}: {getattr(self, attr)}\n' - rv_str += 'Wizard on!' if self.wizard else 'Muggle' - rv_str += '\n' - rv_str += 'Admin' if self.admin else 'Commoner' - return rv_str - - def is_busy(self, from_time, to_time): - """`from_time, to_time` are two datetime objects.""" - project_presentation_slots = Slot.select().where(Slot.current_wizard == self) - for slot in project_presentation_slots: - # https://stackoverflow.com/a/13403827/1161156 - # Fix-patch for int tipe - if isinstance(slot.start, int): - slot.start = from_time.replace(hour=slot.start) - latest_start = max(from_time, slot.start) - earliest_end = min(to_time, slot.get_end_time()) - if latest_start <= earliest_end: # Overlap - return True - return False - - -class Pycamp(BaseModel): - ''' - Representation of the pycamp - headquartes: headquarters name - init: time of init - end: time of end - vote_authorized: the vote is auth in this pycamp - project_load_authorized: the project load is auth in this pycamp - active: boolean telling wheter this PyCamp instance is active (or an old one) - wizard_slot_duration: config to compute the schedule of mages - ''' - headquarters = pw.CharField(unique=True) - init = pw.DateTimeField(null=True) - end = pw.DateTimeField(null=True) - vote_authorized = pw.BooleanField(default=False, null=True) - project_load_authorized = pw.BooleanField(default=False, null=True) - active = pw.BooleanField(default=False, null=True) - wizard_slot_duration = pw.IntegerField(default=60, null=False) # In minutes - - def __str__(self): - rv_str = 'Pycamp:\n' - for attr in ['headquarters', 'init', 'end', 'active', - 'vote_authorized', 'project_load_authorized']: - rv_str += f'{attr}: {getattr(self, attr)}\n' - return rv_str - - def set_as_only_active(self): - active = Pycamp.select().where(Pycamp.active) - for p in active: - p.active = False - Pycamp.bulk_update(active, fields=[Pycamp.active]) - self.active = True - self.save() - - def add_wizard(self, username, chat_id): - pycampista = Pycampista.get_or_create(username=username, chat_id=chat_id)[0] - pycampista.wizard = True - pycampista.save() - PycampistaAtPycamp.get_or_create(pycamp=self, pycampista=pycampista) - return pycampista - - def get_wizards(self): - pac = PycampistaAtPycamp.select().join(Pycampista).where( - (PycampistaAtPycamp.pycamp == self) & - (PycampistaAtPycamp.pycampista.wizard == True) - ) - return [p.pycampista for p in pac] - - def get_current_wizard(self): - """Return the Pycampista instance that's the currently scheduled wizard.""" - now = datetime.datetime.now(ZoneInfo("America/Argentina/Cordoba")) - logger.info("Request wizard at user time: %s", str(now)) - current_wizards = WizardAtPycamp.select().where( - (WizardAtPycamp.pycamp == self) & - (WizardAtPycamp.init <= now) & - (WizardAtPycamp.end > now) - ) - - wizard = None # Default if n_wiz == 0 - if current_wizards.count() >= 1: - # Ready for an improbable future where we'll have many concurrent wizards ;-) - wizard = choice(current_wizards).wizard - - return wizard - - - def clear_wizards_schedule(self): - return WizardAtPycamp.delete().where(WizardAtPycamp.pycamp == self).execute() - -class PycampistaAtPycamp(BaseModel): - ''' - Many to many relationship. Ona pycampista will attend many pycamps. A - pycamps will have many pycampistas - ''' - pycamp = pw.ForeignKeyField(Pycamp) - pycampista = pw.ForeignKeyField(Pycampista) - - -class WizardAtPycamp(BaseModel): - ''' - Many to many relationship. Ona pycampista will attend many pycamps. A - pycamps will have many pycampistas - ''' - pycamp = pw.ForeignKeyField(Pycamp) - wizard = pw.ForeignKeyField(Pycampista) - init = pw.DateTimeField() - end = pw.DateTimeField() - - -class Slot(BaseModel): - ''' - Time slot representation - code: String that represent the slot in the form A1, where the letter - represents the day and the number the position of the slot that day. - start: Time of start of the slot - ''' - code = pw.CharField() # For example A1 for first slot first day - start = pw.DateTimeField() - current_wizard = pw.ForeignKeyField(Pycampista, null=True) - - def get_end_time(self): - return self.start + timedelta(minutes=DEFAULT_SLOT_PERIOD) - - -class Project(BaseModel): - ''' - Project representation - name: name of the project - difficult_level: difficult level between 1 and 3 - topic: string comma separated with the pertinences - slot: ForeignKey with the slot asigned - owner: ForeignKey with the pycamp user asigned - repository_url: URL of the repository of the project - group_url: URL of the Telegram group of the project - ''' - name = pw.CharField(unique=True) - difficult_level = pw.IntegerField(default=1) - topic = pw.CharField(null=True) - slot = pw.ForeignKeyField(Slot, null=True) - owner = pw.ForeignKeyField(Pycampista) - repository_url = pw.CharField(null=True) - group_url = pw.CharField(null=True) - - -class Vote(BaseModel): - ''' - Vote representation. Relation many to many - project: ForeignKey project - pycampista: ForeignKey pycampista - interest: True or False for interest in the project. None repesents no - vote. - ''' - project = pw.ForeignKeyField(Project) - pycampista = pw.ForeignKeyField(Pycampista) - interest = pw.BooleanField(null=True) - # this field is to prevent saving multi votes from the same user in the - # same project - _project_pycampista_id = pw.CharField(unique=True) - - -def models_db_connection(): - db.connect() - db.create_tables([ - Pycamp, - Pycampista, - PycampistaAtPycamp, - WizardAtPycamp, - Project, - Slot, - Vote], safe=True) - db.close() diff --git a/src/pycamp_bot/scheduler/__init__.py b/src/pycamp_bot/scheduler/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/pycamp_bot/scheduler/db_to_json.py b/src/pycamp_bot/scheduler/db_to_json.py deleted file mode 100644 index 4c8c654..0000000 --- a/src/pycamp_bot/scheduler/db_to_json.py +++ /dev/null @@ -1,34 +0,0 @@ -import json -from pycamp_bot.models import Project, Slot, Vote - - -def export_db_2_json(): - projects = Project.select() - - result = {"projects": {}, "responsable_available_slots": {}} - - available_slots = [slot.code for slot in Slot.select()] - - result["available_slots"] = available_slots - all_responsables = [] - - for project in projects: - votes = list(Vote.select().where(Vote.project == project, Vote.interest)) - # responsables = list(ProjectOwner.select().where(ProjectOwner.project == project)) - # responsables = [responsable.username for responsable in responsables] - responsables = [project.owner.username] - if project.owner.username not in all_responsables: - all_responsables.append(project.owner.username) - votes_users = set([v.pycampista.username for v in votes]) - result["projects"][project.name] = { - "priority_slots": [], - "difficult_level": project.difficult_level, - "responsables": responsables, - "votes": list(votes_users), - "theme": project.topic, - } - - for responsable in all_responsables: - result["responsable_available_slots"][responsable] = available_slots - - return result diff --git a/src/pycamp_bot/scheduler/schedule_calculator.py b/src/pycamp_bot/scheduler/schedule_calculator.py deleted file mode 100644 index bae190f..0000000 --- a/src/pycamp_bot/scheduler/schedule_calculator.py +++ /dev/null @@ -1,278 +0,0 @@ -""" -Algorithm to create s schedule based on users votes. - -Author: Ariel Rossanigo -Original repo for this script: https://github.com/arielrossanigo/pycamp_scheduling -""" -import json -import random -import sys -from collections import OrderedDict -from itertools import combinations -from operator import itemgetter -from munch import munchify - -IMPOSIBLE_COST = 1000000 - - -def schedule(data): - data = json.loads(data) - problem = PyCampScheduleProblem(data) - best_solution = random_restart_hill_climbing(problem) - return best_solution - - -class PyCampScheduleProblem: - def __init__(self, data, - responsables_collisions_weight=1.0, - participant_collisions_weight=1.0, - responsable_not_available_weight=1.0, - most_voted_weight=1.0, - slot_population_weight=1.0, - project_not_in_priority_slot_weight=1.0, - same_levels_weight=1.0, - same_theme_weight=1.0): - - self.data = munchify(data) - - # force project responsables to be on their project votes list - for project in self.data.projects: - for resp in self.data.projects[project].responsables: - if resp not in self.data.projects[project].votes: - self.data.projects[project].votes.append(resp) - - self.responsables_collisions_weight = responsables_collisions_weight - self.participant_collisions_weight = participant_collisions_weight - self.responsable_not_available_weight = responsable_not_available_weight - self.most_voted_weight = most_voted_weight - self.slot_population_weight = slot_population_weight - self.project_not_in_priority_slot_weight = project_not_in_priority_slot_weight - self.same_levels_weight = same_levels_weight - self.same_theme_weight = same_theme_weight - - self.project_list = list(self.data.projects.keys()) - self.total_participants = len(set([vote - for pr in self.data.projects.values() - for vote in pr.votes])) - - def neighboors(self, state): - ''''Returns the list of neighboors of the state''' - neighboors = [] - for project in self.project_list: - for slot in self.data.available_slots: - d = dict(state) - current_slot = d[project] - if current_slot != slot: - d[project] = slot - new_state = list(d.items()) - neighboors.append(new_state) - - # include swipped projects in neighboors - for (proj1, slot1), (proj2, slot2) in combinations(state, 2): - d = dict(state) - if slot1 != slot2: - d[proj1] = slot2 - d[proj2] = slot1 - new_state = list(d.items()) - neighboors.append(new_state) - - return neighboors - - def value(self, state): - '''Returns the objective value of the state''' - responsables_collisions_cost = 0 - participant_collisions_cost = 0 - responsable_not_available_cost = 0 - most_voted_cost = 0 - slot_population_cost = 0 - project_not_in_priority_slot_cost = 0 - same_levels_cost = 0 - same_theme_cost = 0 - - slots_and_projects = OrderedDict() - for slot in self.data.available_slots: - slots_and_projects[slot] = [proj for proj, proj_slot in state if proj_slot == slot] - - for slot_number, (slot, slot_projects) in enumerate(slots_and_projects.items()): - for proj1, proj2 in combinations(slot_projects, 2): - proj1_data = self.data.projects[proj1] - proj2_data = self.data.projects[proj2] - - set_resp_1 = set(proj1_data.responsables) - set_resp_2 = set(proj2_data.responsables) - - # Cost for having responsables collisions - if len(set_resp_1.intersection(set_resp_2)) > 0: - responsables_collisions_cost += IMPOSIBLE_COST - - # Cost for having voters collisions - set_vot_1 = set(proj1_data.votes) - set_vot_2 = set(proj2_data.votes) - votes_collisions = len(set_vot_1.intersection(set_vot_2)) - participant_collisions_cost += votes_collisions - - # Cost for same level - if proj1_data.difficult_level == proj2_data.difficult_level: - same_levels_cost += 1 - - # Cost for same theme - if proj1_data.theme == proj2_data.theme: - same_theme_cost += 1 - - # Cost for having multiple projects in the same slot and preference - # for more occupadied slots at the begining - project_quantity = len(slot_projects) - slot_population_cost += (3 ** project_quantity) + (slot_number * project_quantity) - - # Cost according to the quantity of votes. It's prefered that most voted projects - # were at the begining - vote_quantity = sum([len(self.data.projects[project].votes) - for project in slot_projects]) - most_voted_cost += (slot_number * vote_quantity) / self.total_participants - - for project, slot in state: - project_data = self.data.projects[project] - # Cost for having projects in slots where responsables are not available - responsables = project_data.responsables - for resp in responsables: - if slot not in self.data.responsable_available_slots[resp]: - responsable_not_available_cost += IMPOSIBLE_COST - - # Cost for having a project outside priority slots - priority_slots = project_data.priority_slots - if len(priority_slots) > 0 and slot not in priority_slots: - project_not_in_priority_slot_cost += 10 - - return -1 * ( - responsables_collisions_cost * self.responsables_collisions_weight + - participant_collisions_cost * self.participant_collisions_weight + - responsable_not_available_cost * self.responsable_not_available_weight + - most_voted_cost * self.most_voted_weight + - slot_population_cost * self.slot_population_weight + - project_not_in_priority_slot_cost * self.project_not_in_priority_slot_weight + - same_levels_cost * self.same_levels_weight + - same_theme_cost * self.same_theme_weight - ) - - def generate_random_state(self): - res = [] - for project in self.project_list: - random_slot = random.choice(self.data.available_slots) - res.append((project, random_slot)) - return res - - def print_state(self, state): - def empty_slot_template(slot): - return '|{:^4s}|{:26s}|{:21s}|{:4s}|{:4s}|{:11s}|{:4s}|'.format( - slot, '', '', '', '', '', '' - ) - - separator_line = '+{:-<4s}+{:-<26s}+{:-<21s}+{:-<4s}+{:-<4s}+{:-<11s}+{:-<4s}+'.format( - '', '', '', '', '', '', '' - ) - - slots_and_projects = OrderedDict() - for slot in self.data.available_slots: - slots_and_projects[slot] = [proj for proj, proj_slot in state if proj_slot == slot] - - by_project_votes_collisions = {} - for slot_number, (slot, slot_projects) in enumerate(slots_and_projects.items()): - total_collisions_on_slot = 0 - for proj1, proj2 in combinations(slot_projects, 2): - proj1_data = self.data.projects[proj1] - proj2_data = self.data.projects[proj2] - set_vot_1 = set(proj1_data.votes) - set_vot_2 = set(proj2_data.votes) - votes_collisions = len(set_vot_1.intersection(set_vot_2)) - total_collisions_on_slot += votes_collisions - - for proj in slot_projects: - by_project_votes_collisions[proj] = total_collisions_on_slot - - sorted_by_slot = sorted(state, key=itemgetter(1)) - lines = [] - for slot in self.data.available_slots: - lines.append(separator_line) - slot_project_lines = [] - for project, project_slot in sorted_by_slot: - if project_slot == slot: - project_data = self.data.projects[project] - responsables = ', '.join(project_data.responsables) - number_of_votes = len(project_data.votes) - slot_project_lines.append( - '|{:^4s}| {:25s}| {:20s}| {:2d} | {:2d} | {:10s}| {:2d} |'.format( - slot, project, responsables, number_of_votes, - project_data.difficult_level, project_data.theme, - by_project_votes_collisions[project] - ) - ) - - if len(slot_project_lines) > 0: - lines.extend(slot_project_lines) - else: - lines.append(empty_slot_template(slot)) - lines.append(separator_line) - print('\n'.join(lines)) - - -def hill_climbing(problem, initial_state): - current_state = initial_state - current_value = problem.value(initial_state) - - while True: - neighboors = [(n, problem.value(n)) for n in problem.neighboors(current_state)] - best_neighbour, best_value = max(neighboors, key=itemgetter(1)) - - if best_value > current_value: - current_value = best_value - current_state = best_neighbour - else: - return current_state - - -def random_restart_hill_climbing(problem, max_iters=100, max_iters_without_improvement=10): - best_state = None - best_value = None - - number_of_iterations_without_improvement = 0 - for iteration in range(max_iters): - print('Iteration {:3d} # Best value {}'.format(iteration, best_value)) - initial_state = problem.generate_random_state() - current_solution = hill_climbing(problem, initial_state) - current_value = problem.value(current_solution) - - if best_value is None or current_value > best_value: - best_value = current_value - best_state = current_solution - - number_of_iterations_without_improvement = 0 - else: - number_of_iterations_without_improvement += 1 - if number_of_iterations_without_improvement == max_iters_without_improvement: - break - - return best_state - - -def export_scheduled_result(myjson): - problem = PyCampScheduleProblem(myjson) - best_solution = random_restart_hill_climbing(problem, - max_iters=10000, - max_iters_without_improvement=10) - return best_solution - - -if __name__ == '__main__': - try: - input_file = sys.argv[1] - except IndexError: - input_file = 'input_example.json' - - data = open(input_file, 'r').read() - - data = json.loads(data) - problem = PyCampScheduleProblem(data) - best_solution = random_restart_hill_climbing(problem, - max_iters=10000, - max_iters_without_improvement=10) - problem.print_state(best_solution) diff --git a/src/pycamp_bot/utils.py b/src/pycamp_bot/utils.py deleted file mode 100644 index 7c87902..0000000 --- a/src/pycamp_bot/utils.py +++ /dev/null @@ -1,52 +0,0 @@ -from pycamp_bot.models import Pycamp -from pycamp_bot.logger import logger - - -def escape_markdown(string): - # See: https://core.telegram.org/bots/api#markdownv2-style - - new_string = string - - for char in "_*[]()~`>#+-=|{}.!": - new_string = new_string.replace(char, f'\\{char}') - - return new_string - - -def get_slot_weekday_name(slot_day_code): - ISO_WEEKDAY_NAMES = { - 0: 'Lunes', - 1: 'Martes', - 2: 'Miércoles', - 3: 'Jueves', - 4: 'Viernes', - 5: 'Sábado', - 6: 'Domingo', - } - - pycamp_start_weekday = Pycamp.get(Pycamp.active == True).init.weekday() - - # Convert slot day code to a zero-based code, to use it as an - # offset to get the weekday name of the slot - offset = ord(slot_day_code) - ord('A') - day_name = ISO_WEEKDAY_NAMES[pycamp_start_weekday + offset] - - return day_name -def active_pycamp_needed(f): - from pycamp_bot.commands.manage_pycamp import get_active_pycamp - async def wrap(*args, **kargs): - update, context = args - - _, pycamp = get_active_pycamp() - if pycamp is None: - msg = "🔥 %s: This operation (%s) needs an active PyCamp. Talk to an admin." % ( - update.message.from_user.username, str(f.__name__) - ) - await context.bot.send_message( - chat_id=update.message.chat_id, - text=msg) - logger.warning(msg) - return - - return await f(*args, pycamp=pycamp) - return wrap diff --git a/test/__init__.py b/test/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test/conftest.py b/test/conftest.py deleted file mode 100644 index b57cf62..0000000 --- a/test/conftest.py +++ /dev/null @@ -1,27 +0,0 @@ -import os - -from datetime import datetime -from functools import wraps -from peewee import SqliteDatabase -from telegram import Bot - -from pycamp_bot.models import Pycampista, Slot, Pycamp, WizardAtPycamp, PycampistaAtPycamp - - -# use an in-memory SQLite for tests. -test_db = SqliteDatabase(':memory:') - -MODELS = [Pycampista, Slot, Pycamp, WizardAtPycamp, PycampistaAtPycamp] - - -def use_test_database(fn): - """Bind the given models to the db for the duration of wrapped block.""" - @wraps(fn) - def inner(self): - with test_db.bind_ctx(MODELS): - test_db.create_tables(MODELS) - try: - fn(self) - finally: - test_db.drop_tables(MODELS) - return inner diff --git a/test/data/data_example.json b/test/data/data_example.json deleted file mode 100644 index dfe13db..0000000 --- a/test/data/data_example.json +++ /dev/null @@ -1,491 +0,0 @@ -{ - "responsable_available_slots": { - "Fisa": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "Mario": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "Litox": [ - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "Luri": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "Diego": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "Matias": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "David": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "Ariel": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5" - ], - "Facu": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "Zoe": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "Gilgamezh": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "Agustin": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ], - "Manuq": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ] - }, - "projects": { - "Cuentos a epub": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "Diego" - ], - "theme": "desktop", - "votes": [ - "T", - "Y", - "X", - "PRUEBAAA", - "aaaa" - ] - }, - "Linkode": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "Facu", - "Matias" - ], - "theme": "mobile", - "votes": [ - "W", - "V", - "Diego", - "J", - "M", - "PRUEBAAA" - ] - }, - "Pilas": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "Manuq" - ], - "theme": "", - "votes": [ - "H", - "V", - "Ariel", - "E", - "Q", - "M", - "U", - "Mario", - "G", - "Manuq" - ] - }, - "Choppycamp": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "Fisa" - ], - "theme": "mobile", - "votes": [ - "M", - "Y", - "G", - "A", - "Ariel", - "K", - "U", - "Manuq", - "Diego", - "Litox", - "S", - "Gilgamezh" - ] - }, - "Mirror Pypi": { - "priority_slots": [], - "difficult_level": 3, - "responsables": [ - "Fisa", - "Gilgamezh" - ], - "theme": "web", - "votes": [ - "Manuq", - "A", - "Fisa", - "T", - "Agustin", - "Z", - "Ariel", - "Diego", - "G", - "H", - "David", - "Y" - ] - }, - "Raspi": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "David" - ], - "theme": "hardware", - "votes": [ - "W", - "Luri" - ] - }, - "Fades": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "Facu", - "Gilgamezh" - ], - "theme": "web", - "votes": [ - "Litox", - "Gilgamezh", - "Luri", - "J", - "D" - ] - }, - "Moravec": { - "priority_slots": [], - "difficult_level": 3, - "responsables": [ - "Mario" - ], - "theme": "mobile", - "votes": [ - "T", - "D", - "David", - "E" - ] - }, - "Easy Camp": { - "priority_slots": [], - "difficult_level": 3, - "responsables": [ - "Matias", - "Luri" - ], - "theme": "web", - "votes": [ - "Fisa", - "W", - "F", - "Manuq", - "Z", - "G", - "E" - ] - }, - "Programar, que es eso?": { - "priority_slots": [ - "A3" - ], - "difficult_level": 2, - "responsables": [ - "Matias", - "David" - ], - "theme": "", - "votes": [ - "O", - "U", - "X", - "M", - "B", - "Manuq", - "Ariel", - "J", - "D", - "N", - "Agustin", - "Y", - "C", - "Q", - "Fisa" - ] - }, - "LabJM": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "Agustin" - ], - "theme": "comunity", - "votes": [ - "Y", - "H", - "PRUEBAAA", - "aaaa" - ] - }, - "Radio to podcast": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "Diego" - ], - "theme": "mobile", - "votes": [ - "Z", - "I", - "M" - ] - }, - "Recordium": { - "priority_slots": [], - "difficult_level": 3, - "responsables": [ - "Facu" - ], - "theme": "", - "votes": [ - "Gilgamezh", - "Diego", - "R", - "C", - "G", - "W" - ] - }, - "Encajonar apps": { - "priority_slots": [], - "difficult_level": 3, - "responsables": [ - "Manuq" - ], - "theme": "desktop", - "votes": [ - "Litox", - "J", - "Q", - "H", - "X", - "V", - "PRUEBAAA" - ] - }, - "Metaprogramacion": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "David" - ], - "theme": "mobile", - "votes": [ - "X", - "Gilgamezh", - "David", - "T" - ] - }, - "Vis de redes neuronales": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "Ariel" - ], - "theme": "", - "votes": [ - "David", - "N", - "A", - "PRUEBAAA" - ] - }, - "PyCamp voting manager": { - "priority_slots": [], - "difficult_level": 3, - "responsables": [ - "Zoe" - ], - "theme": "hardware", - "votes": [ - "Fisa", - "C", - "K", - "Agustin", - "B", - "Luri", - "G", - "S", - "Mario", - "aaaa" - ] - }, - "Web PyAr": { - "priority_slots": [], - "difficult_level": 2, - "responsables": [ - "Litox" - ], - "theme": "comunity", - "votes": [ - "B", - "Diego", - "Fisa", - "H", - "David", - "T", - "Y", - "Zoe" - ] - } - }, - "available_slots": [ - "A3", - "A4", - "A5", - "B2", - "B3", - "B4", - "B5", - "C1", - "C2", - "C3", - "C4" - ] -} \ No newline at end of file diff --git a/test/test_pycamp_model.py b/test/test_pycamp_model.py deleted file mode 100644 index 73199b9..0000000 --- a/test/test_pycamp_model.py +++ /dev/null @@ -1,74 +0,0 @@ -from datetime import datetime -from freezegun import freeze_time -from pycamp_bot.models import Pycamp, Pycampista, WizardAtPycamp -from pycamp_bot.commands import wizard -from test.conftest import use_test_database, test_db, MODELS - - -# --------------------------- -# Module Level Setup/TearDown -# --------------------------- -def setup_module(module): - test_db.bind(MODELS, bind_refs=False, bind_backrefs=False) - test_db.connect() - -def teardown_module(module): - # Not strictly necessary since SQLite in-memory databases only live - # for the duration of the connection, and in the next step we close - # the connection...but a good practice all the same. - test_db.drop_tables(MODELS) - - # Close connection to db. - test_db.close() - # If we wanted, we could re-bind the models to their original - # database here. But for tests this is probably not necessary. - - -class TestPycampGetCurrentWizard: - - def init_pycamp(self): - self.pycamp = Pycamp.create( - headquarters="Narnia", - init=datetime(2024, 6, 20), - end=datetime(2024, 6, 24), - ) - - @use_test_database - @freeze_time("2024-06-21 15:30:00") - def test_returns_correct_wizard_within_its_turno(self): - """Integration test using persist_wizards_schedule_in_db.""" - p = Pycamp.create( - headquarters="Narnia", - init=datetime(2024,6,20), - end=datetime(2024,6,23), - ) - pycamper = p.add_wizard("pepe", 123) - wizard.persist_wizards_schedule_in_db(p) - - assert p.get_current_wizard() == pycamper - - @use_test_database - def test_no_scheduled_wizard_then_return_none(self): - p = Pycamp.create( - headquarters="Narnia" - ) - # Wizard exists, but no time scheduled. - pycamper = Pycampista.create(username="pepe", wizard=True) - assert WizardAtPycamp.select().count() == 0 - - assert p.get_current_wizard() is None - - @use_test_database - @freeze_time("2024-06-21 15:30:00") - def test_many_scheduled_wizard_then_return_one_of_them(self): - p = Pycamp.create( - headquarters="Narnia", - init=datetime(2024,6,20), - end=datetime(2024,6,23), - ) - w1 = p.add_wizard("gandalf", 123) - w2 = p.add_wizard("merlin", 456 ) - wizard.persist_wizards_schedule_in_db(p) - w = p.get_current_wizard() - - assert w == w1 or w == w2 diff --git a/test/test_pycampista.py b/test/test_pycampista.py deleted file mode 100644 index 1a7e899..0000000 --- a/test/test_pycampista.py +++ /dev/null @@ -1,91 +0,0 @@ -from datetime import datetime, timedelta -from pycamp_bot.models import Pycampista, Slot -from test.conftest import use_test_database, test_db, MODELS - - -# --------------------------- -# Module Level Setup/TearDown -# --------------------------- -def setup_module(module): - """setup any state specific to the execution of the given module.""" - test_db.bind(MODELS, bind_refs=False, bind_backrefs=False) - test_db.connect() - -def teardown_module(module): - """teardown any state that was previously setup with a setup_module method.""" - # Not strictly necessary since SQLite in-memory databases only live - # for the duration of the connection, and in the next step we close - # the connection...but a good practice all the same. - test_db.drop_tables(MODELS) - - # Close connection to db. - test_db.close() - # If we wanted, we could re-bind the models to their original - # database here. But for tests this is probably not necessary. - - -class TestPycampistaIsBusy: - - @use_test_database - def test_return_true_if_assigned_in_slot_equal_to_target_period(self): - pycamper = Pycampista.create(username="pepe") - slot = Slot.create(code = "A1", start=datetime.now(), current_wizard=pycamper) - period = (slot.start, slot.get_end_time()) - assert pycamper.is_busy(*period) - - @use_test_database - def test_return_true_if_assigned_in_slot_starting_at_target_period(self): - pycamper = Pycampista.create(username="pepe") - slot_start = datetime.now() - Slot.create(code = "A1", start=slot_start, current_wizard=pycamper) - period = (slot_start, slot_start + timedelta(minutes=5)) - assert pycamper.is_busy(*period) - - @use_test_database - def test_return_true_if_assigned_in_slot_around_target_period(self): - pycamper = Pycampista.create(username="pepe") - slot_start = datetime.now() - Slot.create(code = "A1", start=slot_start, current_wizard=pycamper) - period_start = slot_start + timedelta(minutes=5) - period = (period_start, period_start + timedelta(minutes=10)) - assert pycamper.is_busy(*period) - - @use_test_database - def test_return_true_if_assigned_in_slot_ending_after_target_period_starts(self): - pycamper = Pycampista.create(username="pepe") - slot = Slot.create(code = "A1", start=datetime.now(), current_wizard=pycamper) - period = ( - slot.start + timedelta(minutes=5), - slot.get_end_time() + timedelta(minutes=5), - ) - assert pycamper.is_busy(*period) - - @use_test_database - def test_return_true_if_assigned_in_slot_starting_before_target_period_ends(self): - pycamper = Pycampista.create(username="pepe") - slot = Slot.create(code = "A1", start=datetime.now(), current_wizard=pycamper) - period = ( - slot.start - timedelta(minutes=5), - slot.start + timedelta(minutes=5), - ) - assert pycamper.is_busy(*period) - - @use_test_database - def test_return_false_if_assigned_in_slot_ending_before_target_period_starts(self): - pycamper = Pycampista.create(username="pepe") - slot = Slot.create(code = "A1", start=datetime.now(), current_wizard=pycamper) - period = ( - slot.get_end_time() + timedelta(seconds=1), - slot.get_end_time() + timedelta(seconds=10), - ) - assert not pycamper.is_busy(*period) - - @use_test_database - def test_return_false_if_assigned_in_slot_start_after_target_period_ends(self): - pycamper = Pycampista.create(username="pepe") - slot = Slot.create(code = "A1", start=datetime.now(), current_wizard=pycamper) - period = ( - slot.start - timedelta(seconds=10), - slot.start - timedelta(seconds=1), - ) - assert not pycamper.is_busy(*period) diff --git a/test/test_wizard.py b/test/test_wizard.py deleted file mode 100644 index 5b020be..0000000 --- a/test/test_wizard.py +++ /dev/null @@ -1,199 +0,0 @@ -from datetime import datetime -from pycamp_bot.models import Pycamp, Pycampista, Slot -from pycamp_bot.commands import wizard -from test.conftest import use_test_database, test_db, MODELS - - -def setup_module(module): - """setup any state specific to the execution of the given module.""" - test_db.bind(MODELS, bind_refs=False, bind_backrefs=False) - test_db.connect() - -def teardown_module(module): - """teardown any state that was previously setup with a setup_module method.""" - # Not strictly necessary since SQLite in-memory databases only live - # for the duration of the connection, and in the next step we close - # the connection...but a good practice all the same. - test_db.drop_tables(MODELS) - - # Close connection to db. - test_db.close() - # If we wanted, we could re-bind the models to their original - # database here. But for tests this is probably not necessary. - - -class BaseForOtherWizardsTests: - - def init_pycamp(self): - self.pycamp = Pycamp.create( - headquarters="Narnia", - init=datetime(2024,6,20), - end=datetime(2024,6,24), - ) - - -class TestWizardScheduleSlots(BaseForOtherWizardsTests): - @use_test_database - def test_correct_number_of_slots_in_one_day(self): - p = Pycamp.create( - headquarters="Narnia", - init=datetime(2024,6,20), - end=datetime(2024,6,20), - ) - slots = wizard.compute_wizards_slots(p) - assert len(slots) == 0 - - @use_test_database - def test_correct_number_of_slots_in_three_day(self): - p = Pycamp.create( - headquarters="Narnia", - init=datetime(2024,6,20), - end=datetime(2024,6,22,23,59,59,99), - ) - slots = wizard.compute_wizards_slots(p) - for i in slots: - print(i) - assert len(slots) == 20 - - - @use_test_database - def test_no_slot_before_first_day_lunch(self): - self.init_pycamp() - lunch_time_end = datetime( - self.pycamp.init.year, - self.pycamp.init.month, - self.pycamp.init.day, - wizard.LUNCH_TIME_END_HOUR - ) - for (start, end) in wizard.compute_wizards_slots(self.pycamp): - assert lunch_time_end <= start - - @use_test_database - def test_no_slot_after_coding_time(self): - self.init_pycamp() - for (start, _) in wizard.compute_wizards_slots(self.pycamp): - assert start.hour < wizard.WIZARD_TIME_END_HOUR - - @use_test_database - def test_no_slot_before_breakfast(self): - self.init_pycamp() - for (start, _) in wizard.compute_wizards_slots(self.pycamp): - assert start.hour >= wizard.WIZARD_TIME_START_HOUR - - - - @use_test_database - def test_no_slot_after_last_day_lunch(self): - self.init_pycamp() - lunch_time_end = datetime( - self.pycamp.end.year, - self.pycamp.end.month, - self.pycamp.end.day, - wizard.LUNCH_TIME_END_HOUR - ) - for (start, _) in wizard.compute_wizards_slots(self.pycamp): - print(start) - if start.day == self.pycamp.end.day: - assert start >= lunch_time_end - - -class TestDefineWizardsSchedule(BaseForOtherWizardsTests): - - # If no wizards, returns {} - @use_test_database - def test_no_wizards_then_return_empty_dict(self): - self.init_pycamp() - sched = wizard.define_wizards_schedule(self.pycamp) - assert sched == {} - - # all slots are asigned a wizard - @use_test_database - def test_all_slots_are_signed_a_wizard(self): - self.init_pycamp() - gandalf = Pycampista.create(username="gandalf", wizard=True) - sched = wizard.define_wizards_schedule(self.pycamp) - assert all( - (isinstance(s, Pycampista) and s.wizard) for s in sched.values() - ) - - # Wizards are not asigned to slots when they are busy - @use_test_database - def test_all_slots_are_signed_a_wizard(self): - self.init_pycamp() - gandalf = Pycampista.create(username="gandalf", wizard=True) - merlin = Pycampista.create(username="merlin", wizard=True) - for h in [9, 10, 11, 12]: - # Create 3 slots where Gandalf is busy - Slot.create( - code = "A1", - start=datetime(2024, 6, 21, h, 30, 0), - current_wizard=gandalf - ) - sched = wizard.define_wizards_schedule(self.pycamp) - # Verify Gandalf is not assigned to slots where he is busy - for (ini, end), w in sched.items(): - if gandalf.is_busy(ini, end): - print(ini, end, w.username) - assert w != gandalf - - # If all wizards are busy in a slot, then one is asigned all the same - @use_test_database - def test_all_slots_are_signed_a_wizard(self): - self.init_pycamp() - gandalf = Pycampista.create(username="gandalf", wizard=True) - merlin = Pycampista.create(username="merlin", wizard=True) - for h in [9, 10, 11, 12]: - # Create 3 slots where Gandalf AND Merlin are busy - Slot.create( - code = "A1", - start=datetime(2024, 6, 21, h, 30, 0), - current_wizard=gandalf - ) - Slot.create( - code = "A1", - start=datetime(2024, 6, 21, h, 30, 0), - current_wizard=merlin - ) - sched = wizard.define_wizards_schedule(self.pycamp) - - assert all( - (isinstance(s, Pycampista) and s.wizard) for s in sched.values() - ) - -class TestListWizards(BaseForOtherWizardsTests): - - @use_test_database - def test_wizard_registration(self): - self.init_pycamp() - w = self.pycamp.add_wizard("Gandalf", 123) - wizards = self.pycamp.get_wizards() - assert len(wizards) == 1 - assert w.username == wizards[0].username - - - @use_test_database - def test_wizard_registration_works_in_one_pycamp_only(self): - self.init_pycamp() - self.pycamp.add_wizard("Gandalf", 123) - - other_pycamp = Pycamp.create( - headquarters="Mordor", - init=datetime(2025,3,22), - end=datetime(2025,3,24), - ) - w = other_pycamp.add_wizard("Merlin", 456) - #import ipdb; ipdb.set_trace() - results = other_pycamp.get_wizards() - assert len(results) == 1 - assert w.username == results[0].username - - - # @use_test_database - # def test_no_active_pycamp_then_fail(self): - # self.init_pycamp() - # agregarle un mago - - # creo OTRO Pycamp - # agregarle otro mago - - # pedir listado: check está el OTRO mago solamente \ No newline at end of file