Permalink
Browse files

Rename internal templates to avoid conflicts.

Minor bug fixes.
  • Loading branch information...
javipalanca committed Sep 12, 2018
1 parent 3053f5d commit 6436628551ed335aa3aff18546d060b1eb67688d
View
@@ -56,7 +56,7 @@
# General information about the project.
project = u'SPADE'
copyright = u"2017, Javi Palanca"
copyright = u"2018, Javi Palanca"
# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
@@ -257,8 +257,8 @@
u'SPADE Documentation',
u'Javi Palanca',
'spade',
'One line description of project.',
'Miscellaneous'),
'Smart Python multi-Agent Development Environment.',
'Artificial Intelligence'),
]
# Documents to append as an appendix to all manuals.
View
@@ -3,6 +3,7 @@ bumpversion==0.5.3
wheel==0.29.0
watchdog==0.8.3
flake8==2.6.0
pyflakes==1.6.0
tox>2.3.1
coverage==4.0.3
Sphinx==1.4.8
View
@@ -1,15 +1,12 @@
# -*- coding: utf-8 -*-
"""Top-level package for SPADE."""
from . import agent
from . import behaviour
from . import message
from . import template
__author__ = """Javi Palanca"""
__email__ = 'jpalanca@gmail.com'
__version__ = '3.0.2'
from .agent import Agent
from .behaviour import CyclicBehaviour, OneShotBehaviour, PeriodicBehaviour, TimeoutBehaviour, FSMBehaviour, State
from .behaviour import NotValidState, NotValidTransition, BehaviourNotFinishedException
from .message import Message
from .template import Template, ANDTemplate, ORTemplate, NOTTemplate, XORTemplate
__all__ = ["agent", "behaviour", "message", "template"]
@@ -1,5 +1,5 @@
{% extends "base.html" %}
{% from 'macros.html' import chat_box, modal_msg %}
{% extends "internal_tpl_base.html" %}
{% from 'internal_tpl_macros.html' import chat_box, modal_msg %}
{% block content_title -%}{{ ajid }}{%- endblock %}
File renamed without changes.
@@ -1,5 +1,5 @@
{% extends "base.html" %}
{% from 'macros.html' import chat_box, modal_msg %}
{% extends "internal_tpl_base.html" %}
{% from 'internal_tpl_macros.html' import chat_box, modal_msg %}
{% block content_title %}{{ behaviour }}{% endblock %}
{% block content %}
@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "internal_tpl_base.html" %}
{% block content %}
<!-- Main content -->
@@ -1,5 +1,5 @@
{% extends "base.html" %}
{% from 'macros.html' import modal_msg %}
{% extends "internal_tpl_base.html" %}
{% from 'internal_tpl_macros.html' import modal_msg %}
{% block content_title -%}Messages{%- endblock %}
View
@@ -126,7 +126,7 @@ def timeago(date):
# Default controllers for agent
@aiohttp_jinja2.template('index.html')
@aiohttp_jinja2.template('internal_tpl_index.html')
async def index(self, request):
contacts = [{"jid": jid,
"avatar": self.agent.build_avatar_url(jid.bare()),
@@ -135,7 +135,7 @@ def timeago(date):
} for jid, c in self.agent.presence.get_contacts().items()]
return {"contacts": contacts}
@aiohttp_jinja2.template("index.html")
@aiohttp_jinja2.template("internal_tpl_index.html")
async def stop_agent(self, request):
return {"stopping": True}
@@ -144,12 +144,12 @@ def timeago(date):
self.agent.stop()
return aioweb.json_response({})
@aiohttp_jinja2.template("messages.html")
@aiohttp_jinja2.template("internal_tpl_messages.html")
async def get_messages(self, request):
messages = [(self.timeago(m[0]), m[1]) for m in self.agent.traces.received()]
return {"messages": messages}
@aiohttp_jinja2.template('behaviour.html')
@aiohttp_jinja2.template('internal_tpl_behaviour.html')
async def get_behaviour(self, request):
behaviour_str = request.match_info['behaviour_type'] + "/" + request.match_info['behaviour_class']
behaviour = self.find_behaviour(behaviour_str)
@@ -162,7 +162,7 @@ def timeago(date):
behaviour.kill()
raise aioweb.HTTPFound('/')
@aiohttp_jinja2.template("agent.html")
@aiohttp_jinja2.template("internal_tpl_agent.html")
async def get_agent(self, request):
agent_jid = request.match_info['agentjid']
agent_messages = [(self.timeago(m[0]), m[1]) for m in self.agent.traces.filter(to=agent_jid)]
View
@@ -49,8 +49,8 @@ def test_default_template_path():
assert type(package_loader) == PackageLoader
assert type(filesystem_loader) == FileSystemLoader
assert "agent.html" in package_loader.list_templates()
assert "agent.html" not in filesystem_loader.list_templates()
assert "internal_tpl_agent.html" in package_loader.list_templates()
assert "internal_tpl_agent.html" not in filesystem_loader.list_templates()
assert filesystem_loader.searchpath == ["."]
View
@@ -16,6 +16,7 @@ changedir=docs
deps=sphinx
commands=
pip install -r{toxinidir}/requirements_dev.txt
pip install -r{toxinidir}/requirements.txt
sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

0 comments on commit 6436628

Please sign in to comment.