Modify package template

This commit is contained in:
Griatch 2020-07-10 17:58:07 +02:00
parent 7fed14d233
commit b1cae35e34
64 changed files with 307 additions and 446 deletions

View file

@ -1,5 +1,8 @@
# Makefile to control Evennia documentation building. # Makefile to control Evennia documentation building.
# Most common commands are `make help`, `make quick` and `make local`. # Most common commands are `make help`, `make quick` and `make local`.
SOURCEDIR = source
BUILDDIR = build
AUTODOCDIR = $(SOURCEDIR)/api
# You can set these variables from the command line, and also # You can set these variables from the command line, and also
# from the environment for the first two. # from the environment for the first two.
@ -7,12 +10,9 @@ SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build SPHINXBUILD ?= sphinx-build
SPHINXMULTIVERSION ?= sphinx-multiversion SPHINXMULTIVERSION ?= sphinx-multiversion
SPHINXAPIDOC ?= sphinx-apidoc SPHINXAPIDOC ?= sphinx-apidoc
SPHINXAPIDOCOPTS = --tocfile evennia-api --module-first --force --separate SPHINXAPIDOCOPTS = --tocfile evennia-api --module-first --force -d 6 --separate --templatedir=$(SOURCEDIR)/_templates/
SPHINXAPIDOCENV = members,undoc-members,show-inheritance SPHINXAPIDOCENV = members,undoc-members,show-inheritance
SPHINXAPIDOCEXCLUDE = ../*/migrations/* ../evennia/game_template/* SPHINXAPIDOCEXCLUDE = ../*/migrations/* ../evennia/game_template/* ../*/*/tests/*
SOURCEDIR = source
BUILDDIR = build
AUTODOCDIR = $(SOURCEDIR)/api
EVDIR ?= $(realpath ../evennia) EVDIR ?= $(realpath ../evennia)
EVGAMEDIR ?= $(realpath ../../gamedir) EVGAMEDIR ?= $(realpath ../../gamedir)

View file

@ -0,0 +1,54 @@
{%- macro automodule(modname, options) -%}
.. automodule:: {{ modname }}
{%- for option in options %}
:{{ option }}:
{%- endfor %}
{%- endmacro %}
{%- macro toctree(docnames) -%}
.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
{%- endmacro %}
{%- if is_namespace %}
{{- [pkgname, "namespace"] | join(" ") | e | heading }}
{% else %}
{{- [pkgname, "package"] | join(" ") | e | heading }}
{% endif %}
{%- if modulefirst and not is_namespace %}
{{ automodule(pkgname, automodule_options) }}
{% endif %}
{%- if not modulefirst and not is_namespace %}
Module contents
---------------
{{ automodule(pkgname, automodule_options) }}
{% endif %}
{%- if submodules %}
Modules
-------
{% if separatemodules %}
{{ toctree(submodules) }}
{%- else %}
{%- for submodule in submodules %}
{% if show_headings %}
{{- [submodule, "module"] | join(" ") | e | heading(2) }}
{% endif %}
{{ automodule(submodule, automodule_options) }}
{% endfor %}
{%- endif %}
{% endif %}
{%- if subpackages %}
Packages/folders
----------------
{{ toctree(subpackages) }}
{% endif %}

View file

@ -2,6 +2,6 @@ evennia
======= =======
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia evennia

View file

@ -6,11 +6,11 @@ evennia.accounts
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.accounts.accounts evennia.accounts.accounts
evennia.accounts.admin evennia.accounts.admin

View file

@ -6,11 +6,11 @@ evennia.commands.default
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.commands.default.account evennia.commands.default.account
evennia.commands.default.admin evennia.commands.default.admin

View file

@ -6,19 +6,11 @@ evennia.commands
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Subpackages Modules
----------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.commands.default
Submodules
----------
.. toctree::
:maxdepth: 4
evennia.commands.cmdhandler evennia.commands.cmdhandler
evennia.commands.cmdparser evennia.commands.cmdparser
@ -26,3 +18,11 @@ Submodules
evennia.commands.cmdsethandler evennia.commands.cmdsethandler
evennia.commands.command evennia.commands.command
evennia.commands.tests evennia.commands.tests
Packages/folders
----------------
.. toctree::
:maxdepth: 6
evennia.commands.default

View file

@ -6,11 +6,11 @@ evennia.comms
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.comms.admin evennia.comms.admin
evennia.comms.channelhandler evennia.comms.channelhandler

View file

@ -6,11 +6,11 @@ evennia.contrib.awsstorage
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.contrib.awsstorage.aws_s3_cdn evennia.contrib.awsstorage.aws_s3_cdn
evennia.contrib.awsstorage.tests evennia.contrib.awsstorage.tests

View file

@ -6,11 +6,11 @@ evennia.contrib.ingame\_python
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.contrib.ingame_python.callbackhandler evennia.contrib.ingame_python.callbackhandler
evennia.contrib.ingame_python.commands evennia.contrib.ingame_python.commands

View file

@ -6,24 +6,11 @@ evennia.contrib
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Subpackages Modules
----------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.contrib.awsstorage
evennia.contrib.ingame_python
evennia.contrib.security
evennia.contrib.turnbattle
evennia.contrib.tutorial_examples
evennia.contrib.tutorial_world
Submodules
----------
.. toctree::
:maxdepth: 4
evennia.contrib.barter evennia.contrib.barter
evennia.contrib.building_menu evennia.contrib.building_menu
@ -54,3 +41,16 @@ Submodules
evennia.contrib.tree_select evennia.contrib.tree_select
evennia.contrib.unixcommand evennia.contrib.unixcommand
evennia.contrib.wilderness evennia.contrib.wilderness
Packages/folders
----------------
.. toctree::
:maxdepth: 6
evennia.contrib.awsstorage
evennia.contrib.ingame_python
evennia.contrib.security
evennia.contrib.turnbattle
evennia.contrib.tutorial_examples
evennia.contrib.tutorial_world

View file

@ -6,11 +6,11 @@ evennia.contrib.security.auditing
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.contrib.security.auditing.outputs evennia.contrib.security.auditing.outputs
evennia.contrib.security.auditing.server evennia.contrib.security.auditing.server

View file

@ -6,10 +6,10 @@ evennia.contrib.security
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Subpackages Packages/folders
----------- ----------------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.contrib.security.auditing evennia.contrib.security.auditing

View file

@ -6,11 +6,11 @@ evennia.contrib.turnbattle
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.contrib.turnbattle.tb_basic evennia.contrib.turnbattle.tb_basic
evennia.contrib.turnbattle.tb_equip evennia.contrib.turnbattle.tb_equip

View file

@ -6,11 +6,11 @@ evennia.contrib.tutorial\_examples
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.contrib.tutorial_examples.bodyfunctions evennia.contrib.tutorial_examples.bodyfunctions
evennia.contrib.tutorial_examples.cmdset_red_button evennia.contrib.tutorial_examples.cmdset_red_button

View file

@ -6,11 +6,11 @@ evennia.contrib.tutorial\_world
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.contrib.tutorial_world.mob evennia.contrib.tutorial_world.mob
evennia.contrib.tutorial_world.objects evennia.contrib.tutorial_world.objects

View file

@ -6,11 +6,11 @@ evennia.help
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.help.admin evennia.help.admin
evennia.help.manager evennia.help.manager

View file

@ -6,11 +6,11 @@ evennia.locks
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.locks.lockfuncs evennia.locks.lockfuncs
evennia.locks.lockhandler evennia.locks.lockhandler

View file

@ -6,11 +6,11 @@ evennia.objects
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.objects.admin evennia.objects.admin
evennia.objects.manager evennia.objects.manager

View file

@ -6,11 +6,11 @@ evennia.prototypes
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.prototypes.menus evennia.prototypes.menus
evennia.prototypes.protfuncs evennia.prototypes.protfuncs

View file

@ -6,11 +6,19 @@ evennia
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Subpackages Modules
----------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.settings_default
Packages/folders
----------------
.. toctree::
:maxdepth: 6
evennia.accounts evennia.accounts
evennia.commands evennia.commands
@ -25,11 +33,3 @@ Subpackages
evennia.typeclasses evennia.typeclasses
evennia.utils evennia.utils
evennia.web evennia.web
Submodules
----------
.. toctree::
:maxdepth: 4
evennia.settings_default

View file

@ -6,11 +6,11 @@ evennia.scripts
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.scripts.admin evennia.scripts.admin
evennia.scripts.manager evennia.scripts.manager

View file

@ -6,11 +6,11 @@ evennia.server.game\_index\_client
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.server.game_index_client.client evennia.server.game_index_client.client
evennia.server.game_index_client.service evennia.server.game_index_client.service

View file

@ -6,11 +6,11 @@ evennia.server.portal
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.server.portal.amp evennia.server.portal.amp
evennia.server.portal.amp_server evennia.server.portal.amp_server

View file

@ -6,11 +6,11 @@ evennia.server.profiling
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.server.profiling.dummyrunner evennia.server.profiling.dummyrunner
evennia.server.profiling.dummyrunner_settings evennia.server.profiling.dummyrunner_settings

View file

@ -6,22 +6,11 @@ evennia.server
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Subpackages Modules
----------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.server.game_index_client
evennia.server.portal
evennia.server.profiling
evennia.server.tests
Submodules
----------
.. toctree::
:maxdepth: 4
evennia.server.admin evennia.server.admin
evennia.server.amp_client evennia.server.amp_client
@ -40,3 +29,13 @@ Submodules
evennia.server.throttle evennia.server.throttle
evennia.server.validators evennia.server.validators
evennia.server.webserver evennia.server.webserver
Packages/folders
----------------
.. toctree::
:maxdepth: 6
evennia.server.game_index_client
evennia.server.portal
evennia.server.profiling

View file

@ -1,20 +0,0 @@
evennia.server.tests
============================
.. automodule:: evennia.server.tests
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
.. toctree::
:maxdepth: 4
evennia.server.tests.test_amp_connection
evennia.server.tests.test_initial_setup
evennia.server.tests.test_launcher
evennia.server.tests.test_misc
evennia.server.tests.test_server
evennia.server.tests.testrunner

View file

@ -1,7 +0,0 @@
evennia.server.tests.test\_amp\_connection
=================================================
.. automodule:: evennia.server.tests.test_amp_connection
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.server.tests.test\_initial\_setup
================================================
.. automodule:: evennia.server.tests.test_initial_setup
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.server.tests.test\_launcher
==========================================
.. automodule:: evennia.server.tests.test_launcher
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.server.tests.test\_misc
======================================
.. automodule:: evennia.server.tests.test_misc
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.server.tests.test\_server
========================================
.. automodule:: evennia.server.tests.test_server
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.server.tests.testrunner
======================================
.. automodule:: evennia.server.tests.testrunner
:members:
:undoc-members:
:show-inheritance:

View file

@ -6,11 +6,11 @@ evennia.typeclasses
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.typeclasses.admin evennia.typeclasses.admin
evennia.typeclasses.attributes evennia.typeclasses.attributes

View file

@ -6,11 +6,11 @@ evennia.utils.idmapper
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.utils.idmapper.manager evennia.utils.idmapper.manager
evennia.utils.idmapper.models evennia.utils.idmapper.models

View file

@ -6,20 +6,11 @@ evennia.utils
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Subpackages Modules
----------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.utils.idmapper
evennia.utils.tests
Submodules
----------
.. toctree::
:maxdepth: 4
evennia.utils.ansi evennia.utils.ansi
evennia.utils.batchprocessors evennia.utils.batchprocessors
@ -42,3 +33,11 @@ Submodules
evennia.utils.text2html evennia.utils.text2html
evennia.utils.utils evennia.utils.utils
evennia.utils.validatorfuncs evennia.utils.validatorfuncs
Packages/folders
----------------
.. toctree::
:maxdepth: 6
evennia.utils.idmapper

View file

@ -1,7 +0,0 @@
evennia.utils.tests.data.evform\_example
===============================================
.. automodule:: evennia.utils.tests.data.evform_example
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.data.prototypes\_example
===================================================
.. automodule:: evennia.utils.tests.data.prototypes_example
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,16 +0,0 @@
evennia.utils.tests.data
================================
.. automodule:: evennia.utils.tests.data
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
.. toctree::
:maxdepth: 4
evennia.utils.tests.data.evform_example
evennia.utils.tests.data.prototypes_example

View file

@ -1,33 +0,0 @@
evennia.utils.tests
===========================
.. automodule:: evennia.utils.tests
:members:
:undoc-members:
:show-inheritance:
Subpackages
-----------
.. toctree::
:maxdepth: 4
evennia.utils.tests.data
Submodules
----------
.. toctree::
:maxdepth: 4
evennia.utils.tests.test_ansi
evennia.utils.tests.test_batchprocessors
evennia.utils.tests.test_create_functions
evennia.utils.tests.test_eveditor
evennia.utils.tests.test_evform
evennia.utils.tests.test_evmenu
evennia.utils.tests.test_gametime
evennia.utils.tests.test_tagparsing
evennia.utils.tests.test_text2html
evennia.utils.tests.test_utils
evennia.utils.tests.test_validatorfuncs

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_ansi
=====================================
.. automodule:: evennia.utils.tests.test_ansi
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_batchprocessors
================================================
.. automodule:: evennia.utils.tests.test_batchprocessors
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_create\_functions
==================================================
.. automodule:: evennia.utils.tests.test_create_functions
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_eveditor
=========================================
.. automodule:: evennia.utils.tests.test_eveditor
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_evform
=======================================
.. automodule:: evennia.utils.tests.test_evform
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_evmenu
=======================================
.. automodule:: evennia.utils.tests.test_evmenu
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_gametime
=========================================
.. automodule:: evennia.utils.tests.test_gametime
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_tagparsing
===========================================
.. automodule:: evennia.utils.tests.test_tagparsing
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_text2html
==========================================
.. automodule:: evennia.utils.tests.test_text2html
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_utils
======================================
.. automodule:: evennia.utils.tests.test_utils
:members:
:undoc-members:
:show-inheritance:

View file

@ -1,7 +0,0 @@
evennia.utils.tests.test\_validatorfuncs
===============================================
.. automodule:: evennia.utils.tests.test_validatorfuncs
:members:
:undoc-members:
:show-inheritance:

View file

@ -6,11 +6,11 @@ evennia.web.api
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.web.api.filters evennia.web.api.filters
evennia.web.api.permissions evennia.web.api.permissions

View file

@ -6,21 +6,21 @@ evennia.web
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Subpackages Modules
----------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.web.urls
Packages/folders
----------------
.. toctree::
:maxdepth: 6
evennia.web.api evennia.web.api
evennia.web.utils evennia.web.utils
evennia.web.webclient evennia.web.webclient
evennia.web.website evennia.web.website
Submodules
----------
.. toctree::
:maxdepth: 4
evennia.web.urls

View file

@ -6,11 +6,11 @@ evennia.web.utils
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.web.utils.backends evennia.web.utils.backends
evennia.web.utils.general_context evennia.web.utils.general_context

View file

@ -6,11 +6,11 @@ evennia.web.webclient
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.web.webclient.urls evennia.web.webclient.urls
evennia.web.webclient.views evennia.web.webclient.views

View file

@ -6,21 +6,21 @@ evennia.web.website
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Subpackages Modules
----------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.web.website.templatetags
Submodules
----------
.. toctree::
:maxdepth: 4
evennia.web.website.forms evennia.web.website.forms
evennia.web.website.tests evennia.web.website.tests
evennia.web.website.urls evennia.web.website.urls
evennia.web.website.views evennia.web.website.views
Packages/folders
----------------
.. toctree::
:maxdepth: 6
evennia.web.website.templatetags

View file

@ -6,10 +6,10 @@ evennia.web.website.templatetags
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
Submodules Modules
---------- -------
.. toctree:: .. toctree::
:maxdepth: 4 :maxdepth: 6
evennia.web.website.templatetags.addclass evennia.web.website.templatetags.addclass

View file

@ -211,7 +211,7 @@ if not _no_autodoc:
if _no_autodoc: if _no_autodoc:
exclude_patterns = ["api/*"] exclude_patterns = ["api/*"]
else: else:
exclude_patterns = ["api/*migrations.rst", "api/*tests.rst"] exclude_patterns = ["api/*migrations.rst"]
autodoc_default_options = { autodoc_default_options = {
"members": True, "members": True,
@ -219,6 +219,7 @@ autodoc_default_options = {
"show-inheritance": True, "show-inheritance": True,
"special-members": "__init__", "special-members": "__init__",
"enable_eval_rst": True, "enable_eval_rst": True,
# "inherited_members": True
} }
autodoc_member_order = "bysource" autodoc_member_order = "bysource"

View file

@ -278,17 +278,18 @@ class SshProtocol(Manhole, _BASE_SESSION_CLASS):
text (str): The first argument is always the text string to send. No other arguments text (str): The first argument is always the text string to send. No other arguments
are considered. are considered.
Keyword args: Keyword args:
options (dict): Send-option flags options (dict): Send-option flags (booleans)
- mxp: Enforce MXP link support.
- ansi: Enforce no ANSI colors. - mxp: enforce mxp link support.
- xterm256: Enforce xterm256 colors, regardless of TTYPE setting. - ansi: enforce no ansi colors.
- nocolor: Strip all colors. - xterm256: enforce xterm256 colors, regardless of ttype setting.
- raw: Pass string through without any ansi processing - nocolor: strip all colors.
(i.e. include Evennia ansi markers but do not - raw: pass string through without any ansi processing
convert them into ansi tokens) (i.e. include evennia ansi markers but do not
- echo: Turn on/off line echo on the client. Turn convert them into ansi tokens)
off line echo for client, for example for password. - echo: turn on/off line echo on the client. turn
Note that it must be actively turned back on again! off line echo for client, for example for password.
note that it must be actively turned back on again!
""" """
# print "telnet.send_text", args,kwargs # DEBUG # print "telnet.send_text", args,kwargs # DEBUG

View file

@ -386,17 +386,18 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, _BASE_SESSION_CLASS):
are considered. are considered.
Keyword args: Keyword args:
options (dict): Send-option flags options (dict): Send-option flags
- mxp: Enforce MXP link support.
- ansi: Enforce no ANSI colors. - mxp: Enforce MXP link support.
- xterm256: Enforce xterm256 colors, regardless of TTYPE. - ansi: Enforce no ANSI colors.
- noxterm256: Enforce no xterm256 color support, regardless of TTYPE. - xterm256: Enforce xterm256 colors, regardless of TTYPE.
- nocolor: Strip all Color, regardless of ansi/xterm256 setting. - noxterm256: Enforce no xterm256 color support, regardless of TTYPE.
- raw: Pass string through without any ansi processing - nocolor: Strip all Color, regardless of ansi/xterm256 setting.
(i.e. include Evennia ansi markers but do not - raw: Pass string through without any ansi processing
convert them into ansi tokens) (i.e. include Evennia ansi markers but do not
- echo: Turn on/off line echo on the client. Turn convert them into ansi tokens)
off line echo for client, for example for password. - echo: Turn on/off line echo on the client. Turn
Note that it must be actively turned back on again! off line echo for client, for example for password.
Note that it must be actively turned back on again!
""" """
text = args[0] if args else "" text = args[0] if args else ""

View file

@ -10,15 +10,15 @@ how and if they are handled. Examples of OOB instructions could be to
instruct the client to play sounds or to update a graphical health instruct the client to play sounds or to update a graphical health
bar. bar.
> Note that in Evennia's Web client, all send commands are "OOB Note that in Evennia's Web client, all send commands are "OOB
commands", (including the "text" one), there is no equivalence to commands", (including the "text" one), there is no equivalence to
MSDP/GMCP for the webclient since it doesn't need it. MSDP/GMCP for the webclient since it doesn't need it.
This implements the following telnet OOB communication protocols: This implements the following telnet OOB communication protocols:
- MSDP (Mud Server Data Protocol), as per
http://tintin.sourceforge.net/msdp/ - MSDP (Mud Server Data Protocol), as per http://tintin.sourceforge.net/msdp/
- GMCP (Generic Mud Communication Protocol) as per - GMCP (Generic Mud Communication Protocol) as per
http://www.ironrealms.com/rapture/manual/files/FeatGMCP-txt.html#Generic_MUD_Communication_Protocol%28GMCP%29 http://www.ironrealms.com/rapture/manual/files/FeatGMCP-txt.html#Generic_MUD_Communication_Protocol%28GMCP%29
Following the lead of KaVir's protocol snippet, we first check if Following the lead of KaVir's protocol snippet, we first check if
client supports MSDP and if not, we fallback to GMCP with a MSDP client supports MSDP and if not, we fallback to GMCP with a MSDP
@ -156,13 +156,14 @@ class TelnetOOB(object):
Notes: Notes:
The output of this encoding will be The output of this encoding will be
MSDP structures on these forms: MSDP structures on these forms:
::
[cmdname, [], {}] -> VAR cmdname VAL "" [cmdname, [], {}] -> VAR cmdname VAL ""
[cmdname, [arg], {}] -> VAR cmdname VAL arg [cmdname, [arg], {}] -> VAR cmdname VAL arg
[cmdname, [args],{}] -> VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE [cmdname, [args],{}] -> VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE
[cmdname, [], {kwargs}] -> VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE [cmdname, [], {kwargs}] -> VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE
[cmdname, [args], {kwargs}] -> VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE [cmdname, [args], {kwargs}] -> VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE
VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE
Further nesting is not supported, so if an array argument Further nesting is not supported, so if an array argument
consists of an array (for example), that array will be consists of an array (for example), that array will be
@ -230,16 +231,18 @@ class TelnetOOB(object):
to have adopted). A cmdname without Package will end to have adopted). A cmdname without Package will end
up in the Core package, while Core package names will up in the Core package, while Core package names will
be stripped on the Evennia side. be stripped on the Evennia side.
::
[cmd.name, [], {}] -> Cmd.Name [cmd.name, [], {}] -> Cmd.Name
[cmd.name, [arg], {}] -> Cmd.Name arg [cmd.name, [arg], {}] -> Cmd.Name arg
[cmd.name, [args],{}] -> Cmd.Name [args] [cmd.name, [args],{}] -> Cmd.Name [args]
[cmd.name, [], {kwargs}] -> Cmd.Name {kwargs} [cmd.name, [], {kwargs}] -> Cmd.Name {kwargs}
[cmdname, [args, {kwargs}] -> Core.Cmdname [[args],{kwargs}] [cmdname, [args, {kwargs}] -> Core.Cmdname [[args],{kwargs}]
Notes: Notes:
There are also a few default mappings between evennia outputcmds and There are also a few default mappings between evennia outputcmds and GMCP:
GMCP: ::
client_options -> Core.Supports.Get client_options -> Core.Supports.Get
get_inputfuncs -> Core.Commands.Get get_inputfuncs -> Core.Commands.Get
get_value -> Char.Value.Get get_value -> Char.Value.Get
@ -280,12 +283,13 @@ class TelnetOOB(object):
Notes: Notes:
Clients should always send MSDP data on Clients should always send MSDP data on
one of the following forms: one of the following forms:
::
cmdname '' -> [cmdname, [], {}] cmdname '' -> [cmdname, [], {}]
cmdname val -> [cmdname, [val], {}] cmdname val -> [cmdname, [val], {}]
cmdname array -> [cmdname, [array], {}] cmdname array -> [cmdname, [array], {}]
cmdname table -> [cmdname, [], {table}] cmdname table -> [cmdname, [], {table}]
cmdname array cmdname table -> [cmdname, [array], {table}] cmdname array cmdname table -> [cmdname, [array], {table}]
Observe that all MSDP_VARS are used to identify cmdnames, Observe that all MSDP_VARS are used to identify cmdnames,
so if there are multiple arrays with the same cmdname so if there are multiple arrays with the same cmdname
@ -379,12 +383,13 @@ class TelnetOOB(object):
We assume the structure is valid JSON. We assume the structure is valid JSON.
The following is parsed into Evennia's formal structure: The following is parsed into Evennia's formal structure:
::
Core.Name -> [name, [], {}] Core.Name -> [name, [], {}]
Core.Name string -> [name, [string], {}] Core.Name string -> [name, [string], {}]
Core.Name [arg, arg,...] -> [name, [args], {}] Core.Name [arg, arg,...] -> [name, [args], {}]
Core.Name {key:arg, key:arg, ...} -> [name, [], {kwargs}] Core.Name {key:arg, key:arg, ...} -> [name, [], {kwargs}]
Core.Name [[args], {kwargs}] -> [name, [args], {kwargs}] Core.Name [[args], {kwargs}] -> [name, [args], {kwargs}]
""" """
if isinstance(data, list): if isinstance(data, list):

View file

@ -1,5 +1,4 @@
# Dummyrunner
Dummyrunner
This is a test system for stress-testing the server. It will launch numbers This is a test system for stress-testing the server. It will launch numbers
of "dummy players" to connect to the server and do various sequences of actions. of "dummy players" to connect to the server and do various sequences of actions.

View file

@ -6,15 +6,17 @@ the actions available to dummy accounts.
The settings are global variables: The settings are global variables:
TIMESTEP - time in seconds between each 'tick' - TIMESTEP - time in seconds between each 'tick'
CHANCE_OF_ACTION - chance 0-1 of action happening - CHANCE_OF_ACTION - chance 0-1 of action happening
CHANCE_OF_LOGIN - chance 0-1 of login happening - CHANCE_OF_LOGIN - chance 0-1 of login happening
TELNET_PORT - port to use, defaults to settings.TELNET_PORT - TELNET_PORT - port to use, defaults to settings.TELNET_PORT
ACTIONS - see below - ACTIONS - see below
ACTIONS is a tuple ACTIONS is a tuple
```python
(login_func, logout_func, (0.3, func1), (0.1, func2) ... ) (login_func, logout_func, (0.3, func1), (0.1, func2) ... )
```
where the first entry is the function to call on first connect, with a where the first entry is the function to call on first connect, with a
chance of occurring given by CHANCE_OF_LOGIN. This function is usually chance of occurring given by CHANCE_OF_LOGIN. This function is usually
@ -33,15 +35,16 @@ returns a string or a list of command strings to execute. Use the
client object for optionally saving data between actions. client object for optionally saving data between actions.
The client object has the following relevant properties and methods: The client object has the following relevant properties and methods:
key - an optional client key. This is only used for dummyrunner output.
Default is "Dummy-<cid>" - key - an optional client key. This is only used for dummyrunner output.
cid - client id Default is "Dummy-<cid>"
gid - globally unique id, hashed with time stamp - cid - client id
istep - the current step - gid - globally unique id, hashed with time stamp
exits - an empty list. Can be used to store exit names - istep - the current step
objs - an empty list. Can be used to store object names - exits - an empty list. Can be used to store exit names
counter() - returns a unique increasing id, hashed with time stamp - objs - an empty list. Can be used to store object names
to make it unique also between dummyrunner instances. - counter() - returns a unique increasing id, hashed with time stamp
to make it unique also between dummyrunner instances.
The return should either be a single command string or a tuple of The return should either be a single command string or a tuple of
command strings. This list of commands will always be executed every command strings. This list of commands will always be executed every

View file

@ -1,10 +1,10 @@
""" """
This module implements the main Evennia server process, the core of This module implements the main Evennia server process, the core of the game
the game engine. engine.
This module should be started with the 'twistd' executable since it This module should be started with the 'twistd' executable since it sets up all
sets up all the networking features. (this is done automatically the networking features. (this is done automatically by
by evennia/server/server_runner.py). evennia/server/server_runner.py).
""" """
import time import time
@ -401,16 +401,16 @@ class Evennia(object):
Shuts down the server from inside it. Shuts down the server from inside it.
mode - sets the server restart mode. mode - sets the server restart mode.
'reload' - server restarts, no "persistent" scripts - 'reload' - server restarts, no "persistent" scripts
are stopped, at_reload hooks called. are stopped, at_reload hooks called.
'reset' - server restarts, non-persistent scripts stopped, - 'reset' - server restarts, non-persistent scripts stopped,
at_shutdown hooks called but sessions will not at_shutdown hooks called but sessions will not
be disconnected. be disconnected.
'shutdown' - like reset, but server will not auto-restart. - 'shutdown' - like reset, but server will not auto-restart.
_reactor_stopping - this is set if server is stopped by a kill _reactor_stopping - this is set if server is stopped by a kill
command OR this method was already called command OR this method was already called
once - in both cases the reactor is once - in both cases the reactor is
dead/stopping already. dead/stopping already.
""" """
if _reactor_stopping and hasattr(self, "shutdown_complete"): if _reactor_stopping and hasattr(self, "shutdown_complete"):
# this means we have already passed through this method # this means we have already passed through this method

View file

@ -746,6 +746,7 @@ class ServerSessionHandler(SessionHandler):
Args Args
csessid (str): The session hash. csessid (str): The session hash.
Returns: Returns:
sessions (list): The sessions with matching .csessid, if any. sessions (list): The sessions with matching .csessid, if any.