diff --git a/docs/Makefile b/docs/Makefile index d5bcc02000..37f7b3a781 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,5 +1,8 @@ # Makefile to control Evennia documentation building. # 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 # from the environment for the first two. @@ -7,12 +10,9 @@ SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build SPHINXMULTIVERSION ?= sphinx-multiversion 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 -SPHINXAPIDOCEXCLUDE = ../*/migrations/* ../evennia/game_template/* -SOURCEDIR = source -BUILDDIR = build -AUTODOCDIR = $(SOURCEDIR)/api +SPHINXAPIDOCEXCLUDE = ../*/migrations/* ../evennia/game_template/* ../*/*/tests/* EVDIR ?= $(realpath ../evennia) EVGAMEDIR ?= $(realpath ../../gamedir) diff --git a/docs/source/_templates/package.rst_t b/docs/source/_templates/package.rst_t new file mode 100644 index 0000000000..fde7151fc5 --- /dev/null +++ b/docs/source/_templates/package.rst_t @@ -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 %} diff --git a/docs/source/api/evennia-api.rst b/docs/source/api/evennia-api.rst index 346ade5719..27caffe4e4 100644 --- a/docs/source/api/evennia-api.rst +++ b/docs/source/api/evennia-api.rst @@ -2,6 +2,6 @@ evennia ======= .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia diff --git a/docs/source/api/evennia.accounts.rst b/docs/source/api/evennia.accounts.rst index 8d1eee50bb..63a7edbc79 100644 --- a/docs/source/api/evennia.accounts.rst +++ b/docs/source/api/evennia.accounts.rst @@ -6,11 +6,11 @@ evennia.accounts :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.accounts.accounts evennia.accounts.admin diff --git a/docs/source/api/evennia.commands.default.rst b/docs/source/api/evennia.commands.default.rst index 733185d49d..596d5e56d9 100644 --- a/docs/source/api/evennia.commands.default.rst +++ b/docs/source/api/evennia.commands.default.rst @@ -6,11 +6,11 @@ evennia.commands.default :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.commands.default.account evennia.commands.default.admin diff --git a/docs/source/api/evennia.commands.rst b/docs/source/api/evennia.commands.rst index 9d2088cd48..43419d4ff4 100644 --- a/docs/source/api/evennia.commands.rst +++ b/docs/source/api/evennia.commands.rst @@ -6,19 +6,11 @@ evennia.commands :undoc-members: :show-inheritance: -Subpackages ------------ +Modules +------- .. toctree:: - :maxdepth: 4 - - evennia.commands.default - -Submodules ----------- - -.. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.commands.cmdhandler evennia.commands.cmdparser @@ -26,3 +18,11 @@ Submodules evennia.commands.cmdsethandler evennia.commands.command evennia.commands.tests + +Packages/folders +---------------- + +.. toctree:: + :maxdepth: 6 + + evennia.commands.default diff --git a/docs/source/api/evennia.comms.rst b/docs/source/api/evennia.comms.rst index 378befb756..777560096a 100644 --- a/docs/source/api/evennia.comms.rst +++ b/docs/source/api/evennia.comms.rst @@ -6,11 +6,11 @@ evennia.comms :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.comms.admin evennia.comms.channelhandler diff --git a/docs/source/api/evennia.contrib.awsstorage.rst b/docs/source/api/evennia.contrib.awsstorage.rst index 2ae52ee845..e8f4968378 100644 --- a/docs/source/api/evennia.contrib.awsstorage.rst +++ b/docs/source/api/evennia.contrib.awsstorage.rst @@ -6,11 +6,11 @@ evennia.contrib.awsstorage :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.contrib.awsstorage.aws_s3_cdn evennia.contrib.awsstorage.tests diff --git a/docs/source/api/evennia.contrib.ingame_python.rst b/docs/source/api/evennia.contrib.ingame_python.rst index 80f5bbe925..97d001a4d5 100644 --- a/docs/source/api/evennia.contrib.ingame_python.rst +++ b/docs/source/api/evennia.contrib.ingame_python.rst @@ -6,11 +6,11 @@ evennia.contrib.ingame\_python :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.contrib.ingame_python.callbackhandler evennia.contrib.ingame_python.commands diff --git a/docs/source/api/evennia.contrib.rst b/docs/source/api/evennia.contrib.rst index 1f88841536..3406e880d0 100644 --- a/docs/source/api/evennia.contrib.rst +++ b/docs/source/api/evennia.contrib.rst @@ -6,24 +6,11 @@ evennia.contrib :undoc-members: :show-inheritance: -Subpackages ------------ +Modules +------- .. toctree:: - :maxdepth: 4 - - 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 + :maxdepth: 6 evennia.contrib.barter evennia.contrib.building_menu @@ -54,3 +41,16 @@ Submodules evennia.contrib.tree_select evennia.contrib.unixcommand 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 diff --git a/docs/source/api/evennia.contrib.security.auditing.rst b/docs/source/api/evennia.contrib.security.auditing.rst index b9d1fc13ca..7aac40dfda 100644 --- a/docs/source/api/evennia.contrib.security.auditing.rst +++ b/docs/source/api/evennia.contrib.security.auditing.rst @@ -6,11 +6,11 @@ evennia.contrib.security.auditing :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.contrib.security.auditing.outputs evennia.contrib.security.auditing.server diff --git a/docs/source/api/evennia.contrib.security.rst b/docs/source/api/evennia.contrib.security.rst index 431329fcf2..fd2dcd0bab 100644 --- a/docs/source/api/evennia.contrib.security.rst +++ b/docs/source/api/evennia.contrib.security.rst @@ -6,10 +6,10 @@ evennia.contrib.security :undoc-members: :show-inheritance: -Subpackages ------------ +Packages/folders +---------------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.contrib.security.auditing diff --git a/docs/source/api/evennia.contrib.turnbattle.rst b/docs/source/api/evennia.contrib.turnbattle.rst index 7384b3ab7c..96afa16375 100644 --- a/docs/source/api/evennia.contrib.turnbattle.rst +++ b/docs/source/api/evennia.contrib.turnbattle.rst @@ -6,11 +6,11 @@ evennia.contrib.turnbattle :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.contrib.turnbattle.tb_basic evennia.contrib.turnbattle.tb_equip diff --git a/docs/source/api/evennia.contrib.tutorial_examples.rst b/docs/source/api/evennia.contrib.tutorial_examples.rst index d3618ea325..1fb4f9cb93 100644 --- a/docs/source/api/evennia.contrib.tutorial_examples.rst +++ b/docs/source/api/evennia.contrib.tutorial_examples.rst @@ -6,11 +6,11 @@ evennia.contrib.tutorial\_examples :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.contrib.tutorial_examples.bodyfunctions evennia.contrib.tutorial_examples.cmdset_red_button diff --git a/docs/source/api/evennia.contrib.tutorial_world.rst b/docs/source/api/evennia.contrib.tutorial_world.rst index 3bd191cebe..77d4c42bc2 100644 --- a/docs/source/api/evennia.contrib.tutorial_world.rst +++ b/docs/source/api/evennia.contrib.tutorial_world.rst @@ -6,11 +6,11 @@ evennia.contrib.tutorial\_world :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.contrib.tutorial_world.mob evennia.contrib.tutorial_world.objects diff --git a/docs/source/api/evennia.help.rst b/docs/source/api/evennia.help.rst index b4ac6ec140..f04209b03f 100644 --- a/docs/source/api/evennia.help.rst +++ b/docs/source/api/evennia.help.rst @@ -6,11 +6,11 @@ evennia.help :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.help.admin evennia.help.manager diff --git a/docs/source/api/evennia.locks.rst b/docs/source/api/evennia.locks.rst index 18dafc691f..9b16771f9a 100644 --- a/docs/source/api/evennia.locks.rst +++ b/docs/source/api/evennia.locks.rst @@ -6,11 +6,11 @@ evennia.locks :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.locks.lockfuncs evennia.locks.lockhandler diff --git a/docs/source/api/evennia.objects.rst b/docs/source/api/evennia.objects.rst index 8063232893..971e1e5490 100644 --- a/docs/source/api/evennia.objects.rst +++ b/docs/source/api/evennia.objects.rst @@ -6,11 +6,11 @@ evennia.objects :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.objects.admin evennia.objects.manager diff --git a/docs/source/api/evennia.prototypes.rst b/docs/source/api/evennia.prototypes.rst index 4a471dc562..25a09dcc1f 100644 --- a/docs/source/api/evennia.prototypes.rst +++ b/docs/source/api/evennia.prototypes.rst @@ -6,11 +6,11 @@ evennia.prototypes :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.prototypes.menus evennia.prototypes.protfuncs diff --git a/docs/source/api/evennia.rst b/docs/source/api/evennia.rst index f73b6808e5..3d00e40829 100644 --- a/docs/source/api/evennia.rst +++ b/docs/source/api/evennia.rst @@ -6,11 +6,19 @@ evennia :undoc-members: :show-inheritance: -Subpackages ------------ +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 + + evennia.settings_default + +Packages/folders +---------------- + +.. toctree:: + :maxdepth: 6 evennia.accounts evennia.commands @@ -25,11 +33,3 @@ Subpackages evennia.typeclasses evennia.utils evennia.web - -Submodules ----------- - -.. toctree:: - :maxdepth: 4 - - evennia.settings_default diff --git a/docs/source/api/evennia.scripts.rst b/docs/source/api/evennia.scripts.rst index 0b140af369..2798c346e6 100644 --- a/docs/source/api/evennia.scripts.rst +++ b/docs/source/api/evennia.scripts.rst @@ -6,11 +6,11 @@ evennia.scripts :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.scripts.admin evennia.scripts.manager diff --git a/docs/source/api/evennia.server.game_index_client.rst b/docs/source/api/evennia.server.game_index_client.rst index 050760ce64..ca8a109482 100644 --- a/docs/source/api/evennia.server.game_index_client.rst +++ b/docs/source/api/evennia.server.game_index_client.rst @@ -6,11 +6,11 @@ evennia.server.game\_index\_client :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.server.game_index_client.client evennia.server.game_index_client.service diff --git a/docs/source/api/evennia.server.portal.rst b/docs/source/api/evennia.server.portal.rst index 812ea3ca4a..7bd0dfa937 100644 --- a/docs/source/api/evennia.server.portal.rst +++ b/docs/source/api/evennia.server.portal.rst @@ -6,11 +6,11 @@ evennia.server.portal :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.server.portal.amp evennia.server.portal.amp_server diff --git a/docs/source/api/evennia.server.profiling.rst b/docs/source/api/evennia.server.profiling.rst index 57cccbba34..89068d7204 100644 --- a/docs/source/api/evennia.server.profiling.rst +++ b/docs/source/api/evennia.server.profiling.rst @@ -6,11 +6,11 @@ evennia.server.profiling :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.server.profiling.dummyrunner evennia.server.profiling.dummyrunner_settings diff --git a/docs/source/api/evennia.server.rst b/docs/source/api/evennia.server.rst index 8d006d5f03..71ee526fda 100644 --- a/docs/source/api/evennia.server.rst +++ b/docs/source/api/evennia.server.rst @@ -6,22 +6,11 @@ evennia.server :undoc-members: :show-inheritance: -Subpackages ------------ +Modules +------- .. toctree:: - :maxdepth: 4 - - evennia.server.game_index_client - evennia.server.portal - evennia.server.profiling - evennia.server.tests - -Submodules ----------- - -.. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.server.admin evennia.server.amp_client @@ -40,3 +29,13 @@ Submodules evennia.server.throttle evennia.server.validators evennia.server.webserver + +Packages/folders +---------------- + +.. toctree:: + :maxdepth: 6 + + evennia.server.game_index_client + evennia.server.portal + evennia.server.profiling diff --git a/docs/source/api/evennia.server.tests.rst b/docs/source/api/evennia.server.tests.rst deleted file mode 100644 index b567e6e18f..0000000000 --- a/docs/source/api/evennia.server.tests.rst +++ /dev/null @@ -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 diff --git a/docs/source/api/evennia.server.tests.test_amp_connection.rst b/docs/source/api/evennia.server.tests.test_amp_connection.rst deleted file mode 100644 index 87430e1a02..0000000000 --- a/docs/source/api/evennia.server.tests.test_amp_connection.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.server.tests.test\_amp\_connection -================================================= - -.. automodule:: evennia.server.tests.test_amp_connection - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.server.tests.test_initial_setup.rst b/docs/source/api/evennia.server.tests.test_initial_setup.rst deleted file mode 100644 index 0bb8f23649..0000000000 --- a/docs/source/api/evennia.server.tests.test_initial_setup.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.server.tests.test\_initial\_setup -================================================ - -.. automodule:: evennia.server.tests.test_initial_setup - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.server.tests.test_launcher.rst b/docs/source/api/evennia.server.tests.test_launcher.rst deleted file mode 100644 index d79e2ed0a0..0000000000 --- a/docs/source/api/evennia.server.tests.test_launcher.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.server.tests.test\_launcher -========================================== - -.. automodule:: evennia.server.tests.test_launcher - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.server.tests.test_misc.rst b/docs/source/api/evennia.server.tests.test_misc.rst deleted file mode 100644 index 5ca4ac6eb8..0000000000 --- a/docs/source/api/evennia.server.tests.test_misc.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.server.tests.test\_misc -====================================== - -.. automodule:: evennia.server.tests.test_misc - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.server.tests.test_server.rst b/docs/source/api/evennia.server.tests.test_server.rst deleted file mode 100644 index 057605cd73..0000000000 --- a/docs/source/api/evennia.server.tests.test_server.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.server.tests.test\_server -======================================== - -.. automodule:: evennia.server.tests.test_server - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.server.tests.testrunner.rst b/docs/source/api/evennia.server.tests.testrunner.rst deleted file mode 100644 index 8f2d6f614c..0000000000 --- a/docs/source/api/evennia.server.tests.testrunner.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.server.tests.testrunner -====================================== - -.. automodule:: evennia.server.tests.testrunner - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.typeclasses.rst b/docs/source/api/evennia.typeclasses.rst index 49a1926eae..970dd374c2 100644 --- a/docs/source/api/evennia.typeclasses.rst +++ b/docs/source/api/evennia.typeclasses.rst @@ -6,11 +6,11 @@ evennia.typeclasses :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.typeclasses.admin evennia.typeclasses.attributes diff --git a/docs/source/api/evennia.utils.idmapper.rst b/docs/source/api/evennia.utils.idmapper.rst index f398e4c5f1..85b71586b7 100644 --- a/docs/source/api/evennia.utils.idmapper.rst +++ b/docs/source/api/evennia.utils.idmapper.rst @@ -6,11 +6,11 @@ evennia.utils.idmapper :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.utils.idmapper.manager evennia.utils.idmapper.models diff --git a/docs/source/api/evennia.utils.rst b/docs/source/api/evennia.utils.rst index 9db232257f..4647d2f350 100644 --- a/docs/source/api/evennia.utils.rst +++ b/docs/source/api/evennia.utils.rst @@ -6,20 +6,11 @@ evennia.utils :undoc-members: :show-inheritance: -Subpackages ------------ +Modules +------- .. toctree:: - :maxdepth: 4 - - evennia.utils.idmapper - evennia.utils.tests - -Submodules ----------- - -.. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.utils.ansi evennia.utils.batchprocessors @@ -42,3 +33,11 @@ Submodules evennia.utils.text2html evennia.utils.utils evennia.utils.validatorfuncs + +Packages/folders +---------------- + +.. toctree:: + :maxdepth: 6 + + evennia.utils.idmapper diff --git a/docs/source/api/evennia.utils.tests.data.evform_example.rst b/docs/source/api/evennia.utils.tests.data.evform_example.rst deleted file mode 100644 index 27cfe2f738..0000000000 --- a/docs/source/api/evennia.utils.tests.data.evform_example.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.data.evform\_example -=============================================== - -.. automodule:: evennia.utils.tests.data.evform_example - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.data.prototypes_example.rst b/docs/source/api/evennia.utils.tests.data.prototypes_example.rst deleted file mode 100644 index ec9da9ce9f..0000000000 --- a/docs/source/api/evennia.utils.tests.data.prototypes_example.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.data.prototypes\_example -=================================================== - -.. automodule:: evennia.utils.tests.data.prototypes_example - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.data.rst b/docs/source/api/evennia.utils.tests.data.rst deleted file mode 100644 index d2ce5104bc..0000000000 --- a/docs/source/api/evennia.utils.tests.data.rst +++ /dev/null @@ -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 diff --git a/docs/source/api/evennia.utils.tests.rst b/docs/source/api/evennia.utils.tests.rst deleted file mode 100644 index a863119241..0000000000 --- a/docs/source/api/evennia.utils.tests.rst +++ /dev/null @@ -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 diff --git a/docs/source/api/evennia.utils.tests.test_ansi.rst b/docs/source/api/evennia.utils.tests.test_ansi.rst deleted file mode 100644 index b6c2c5f128..0000000000 --- a/docs/source/api/evennia.utils.tests.test_ansi.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_ansi -===================================== - -.. automodule:: evennia.utils.tests.test_ansi - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.test_batchprocessors.rst b/docs/source/api/evennia.utils.tests.test_batchprocessors.rst deleted file mode 100644 index 24bd0f3258..0000000000 --- a/docs/source/api/evennia.utils.tests.test_batchprocessors.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_batchprocessors -================================================ - -.. automodule:: evennia.utils.tests.test_batchprocessors - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.test_create_functions.rst b/docs/source/api/evennia.utils.tests.test_create_functions.rst deleted file mode 100644 index 73f5dd3d62..0000000000 --- a/docs/source/api/evennia.utils.tests.test_create_functions.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_create\_functions -================================================== - -.. automodule:: evennia.utils.tests.test_create_functions - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.test_eveditor.rst b/docs/source/api/evennia.utils.tests.test_eveditor.rst deleted file mode 100644 index 3461b0faa6..0000000000 --- a/docs/source/api/evennia.utils.tests.test_eveditor.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_eveditor -========================================= - -.. automodule:: evennia.utils.tests.test_eveditor - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.test_evform.rst b/docs/source/api/evennia.utils.tests.test_evform.rst deleted file mode 100644 index 02878c0f49..0000000000 --- a/docs/source/api/evennia.utils.tests.test_evform.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_evform -======================================= - -.. automodule:: evennia.utils.tests.test_evform - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.test_evmenu.rst b/docs/source/api/evennia.utils.tests.test_evmenu.rst deleted file mode 100644 index 166473e78c..0000000000 --- a/docs/source/api/evennia.utils.tests.test_evmenu.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_evmenu -======================================= - -.. automodule:: evennia.utils.tests.test_evmenu - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.test_gametime.rst b/docs/source/api/evennia.utils.tests.test_gametime.rst deleted file mode 100644 index 18b3bcb826..0000000000 --- a/docs/source/api/evennia.utils.tests.test_gametime.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_gametime -========================================= - -.. automodule:: evennia.utils.tests.test_gametime - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.test_tagparsing.rst b/docs/source/api/evennia.utils.tests.test_tagparsing.rst deleted file mode 100644 index 265498a8cc..0000000000 --- a/docs/source/api/evennia.utils.tests.test_tagparsing.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_tagparsing -=========================================== - -.. automodule:: evennia.utils.tests.test_tagparsing - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.test_text2html.rst b/docs/source/api/evennia.utils.tests.test_text2html.rst deleted file mode 100644 index 86c0f8c3bc..0000000000 --- a/docs/source/api/evennia.utils.tests.test_text2html.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_text2html -========================================== - -.. automodule:: evennia.utils.tests.test_text2html - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.test_utils.rst b/docs/source/api/evennia.utils.tests.test_utils.rst deleted file mode 100644 index 0a00d02001..0000000000 --- a/docs/source/api/evennia.utils.tests.test_utils.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_utils -====================================== - -.. automodule:: evennia.utils.tests.test_utils - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.utils.tests.test_validatorfuncs.rst b/docs/source/api/evennia.utils.tests.test_validatorfuncs.rst deleted file mode 100644 index 655b9243d6..0000000000 --- a/docs/source/api/evennia.utils.tests.test_validatorfuncs.rst +++ /dev/null @@ -1,7 +0,0 @@ -evennia.utils.tests.test\_validatorfuncs -=============================================== - -.. automodule:: evennia.utils.tests.test_validatorfuncs - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api/evennia.web.api.rst b/docs/source/api/evennia.web.api.rst index 6f891368e7..cf64b9f778 100644 --- a/docs/source/api/evennia.web.api.rst +++ b/docs/source/api/evennia.web.api.rst @@ -6,11 +6,11 @@ evennia.web.api :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.web.api.filters evennia.web.api.permissions diff --git a/docs/source/api/evennia.web.rst b/docs/source/api/evennia.web.rst index be30bafce5..7a536d97b0 100644 --- a/docs/source/api/evennia.web.rst +++ b/docs/source/api/evennia.web.rst @@ -6,21 +6,21 @@ evennia.web :undoc-members: :show-inheritance: -Subpackages ------------ +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 + + evennia.web.urls + +Packages/folders +---------------- + +.. toctree:: + :maxdepth: 6 evennia.web.api evennia.web.utils evennia.web.webclient evennia.web.website - -Submodules ----------- - -.. toctree:: - :maxdepth: 4 - - evennia.web.urls diff --git a/docs/source/api/evennia.web.utils.rst b/docs/source/api/evennia.web.utils.rst index 0bf5dafeb7..7b0888f9bd 100644 --- a/docs/source/api/evennia.web.utils.rst +++ b/docs/source/api/evennia.web.utils.rst @@ -6,11 +6,11 @@ evennia.web.utils :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.web.utils.backends evennia.web.utils.general_context diff --git a/docs/source/api/evennia.web.webclient.rst b/docs/source/api/evennia.web.webclient.rst index f576964a66..7d41ba63f6 100644 --- a/docs/source/api/evennia.web.webclient.rst +++ b/docs/source/api/evennia.web.webclient.rst @@ -6,11 +6,11 @@ evennia.web.webclient :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.web.webclient.urls evennia.web.webclient.views diff --git a/docs/source/api/evennia.web.website.rst b/docs/source/api/evennia.web.website.rst index c1595fbd10..49c51de624 100644 --- a/docs/source/api/evennia.web.website.rst +++ b/docs/source/api/evennia.web.website.rst @@ -6,21 +6,21 @@ evennia.web.website :undoc-members: :show-inheritance: -Subpackages ------------ +Modules +------- .. toctree:: - :maxdepth: 4 - - evennia.web.website.templatetags - -Submodules ----------- - -.. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.web.website.forms evennia.web.website.tests evennia.web.website.urls evennia.web.website.views + +Packages/folders +---------------- + +.. toctree:: + :maxdepth: 6 + + evennia.web.website.templatetags diff --git a/docs/source/api/evennia.web.website.templatetags.rst b/docs/source/api/evennia.web.website.templatetags.rst index 1bcaba8c51..ad420e1efc 100644 --- a/docs/source/api/evennia.web.website.templatetags.rst +++ b/docs/source/api/evennia.web.website.templatetags.rst @@ -6,10 +6,10 @@ evennia.web.website.templatetags :undoc-members: :show-inheritance: -Submodules ----------- +Modules +------- .. toctree:: - :maxdepth: 4 + :maxdepth: 6 evennia.web.website.templatetags.addclass diff --git a/docs/source/conf.py b/docs/source/conf.py index e1784b3c53..31944b430d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -211,7 +211,7 @@ if not _no_autodoc: if _no_autodoc: exclude_patterns = ["api/*"] else: - exclude_patterns = ["api/*migrations.rst", "api/*tests.rst"] + exclude_patterns = ["api/*migrations.rst"] autodoc_default_options = { "members": True, @@ -219,6 +219,7 @@ autodoc_default_options = { "show-inheritance": True, "special-members": "__init__", "enable_eval_rst": True, + # "inherited_members": True } autodoc_member_order = "bysource" diff --git a/evennia/server/portal/ssh.py b/evennia/server/portal/ssh.py index f7286cdb18..5300691c76 100644 --- a/evennia/server/portal/ssh.py +++ b/evennia/server/portal/ssh.py @@ -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 are considered. Keyword args: - options (dict): Send-option flags - - mxp: Enforce MXP link support. - - ansi: Enforce no ANSI colors. - - xterm256: Enforce xterm256 colors, regardless of TTYPE setting. - - nocolor: Strip all colors. - - raw: Pass string through without any ansi processing - (i.e. include Evennia ansi markers but do not - convert them into ansi tokens) - - echo: Turn on/off line echo on the client. Turn - off line echo for client, for example for password. - Note that it must be actively turned back on again! + options (dict): Send-option flags (booleans) + + - mxp: enforce mxp link support. + - ansi: enforce no ansi colors. + - xterm256: enforce xterm256 colors, regardless of ttype setting. + - nocolor: strip all colors. + - raw: pass string through without any ansi processing + (i.e. include evennia ansi markers but do not + convert them into ansi tokens) + - echo: turn on/off line echo on the client. turn + 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 diff --git a/evennia/server/portal/telnet.py b/evennia/server/portal/telnet.py index ee5176d11d..a6a8263dda 100644 --- a/evennia/server/portal/telnet.py +++ b/evennia/server/portal/telnet.py @@ -386,17 +386,18 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, _BASE_SESSION_CLASS): are considered. Keyword args: options (dict): Send-option flags - - mxp: Enforce MXP link support. - - ansi: Enforce no ANSI colors. - - xterm256: Enforce xterm256 colors, regardless of TTYPE. - - noxterm256: Enforce no xterm256 color support, regardless of TTYPE. - - nocolor: Strip all Color, regardless of ansi/xterm256 setting. - - raw: Pass string through without any ansi processing - (i.e. include Evennia ansi markers but do not - convert them into ansi tokens) - - echo: Turn on/off line echo on the client. Turn - off line echo for client, for example for password. - Note that it must be actively turned back on again! + + - mxp: Enforce MXP link support. + - ansi: Enforce no ANSI colors. + - xterm256: Enforce xterm256 colors, regardless of TTYPE. + - noxterm256: Enforce no xterm256 color support, regardless of TTYPE. + - nocolor: Strip all Color, regardless of ansi/xterm256 setting. + - raw: Pass string through without any ansi processing + (i.e. include Evennia ansi markers but do not + convert them into ansi tokens) + - echo: Turn on/off line echo on the client. Turn + 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 "" diff --git a/evennia/server/portal/telnet_oob.py b/evennia/server/portal/telnet_oob.py index 7931dcb2a4..0523109f80 100644 --- a/evennia/server/portal/telnet_oob.py +++ b/evennia/server/portal/telnet_oob.py @@ -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 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 MSDP/GMCP for the webclient since it doesn't need it. 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 - 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 client supports MSDP and if not, we fallback to GMCP with a MSDP @@ -156,13 +156,14 @@ class TelnetOOB(object): Notes: The output of this encoding will be MSDP structures on these forms: + :: - [cmdname, [], {}] -> VAR cmdname VAL "" - [cmdname, [arg], {}] -> VAR cmdname VAL arg - [cmdname, [args],{}] -> VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE - [cmdname, [], {kwargs}] -> VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE - [cmdname, [args], {kwargs}] -> VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE - VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE + [cmdname, [], {}] -> VAR cmdname VAL "" + [cmdname, [arg], {}] -> VAR cmdname VAL arg + [cmdname, [args],{}] -> VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE + [cmdname, [], {kwargs}] -> VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE + [cmdname, [args], {kwargs}] -> VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE + VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE Further nesting is not supported, so if an array argument 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 up in the Core package, while Core package names will be stripped on the Evennia side. + :: - [cmd.name, [], {}] -> Cmd.Name - [cmd.name, [arg], {}] -> Cmd.Name arg - [cmd.name, [args],{}] -> Cmd.Name [args] - [cmd.name, [], {kwargs}] -> Cmd.Name {kwargs} - [cmdname, [args, {kwargs}] -> Core.Cmdname [[args],{kwargs}] + [cmd.name, [], {}] -> Cmd.Name + [cmd.name, [arg], {}] -> Cmd.Name arg + [cmd.name, [args],{}] -> Cmd.Name [args] + [cmd.name, [], {kwargs}] -> Cmd.Name {kwargs} + [cmdname, [args, {kwargs}] -> Core.Cmdname [[args],{kwargs}] Notes: - There are also a few default mappings between evennia outputcmds and - GMCP: + There are also a few default mappings between evennia outputcmds and GMCP: + :: + client_options -> Core.Supports.Get get_inputfuncs -> Core.Commands.Get get_value -> Char.Value.Get @@ -280,12 +283,13 @@ class TelnetOOB(object): Notes: Clients should always send MSDP data on one of the following forms: + :: - cmdname '' -> [cmdname, [], {}] - cmdname val -> [cmdname, [val], {}] - cmdname array -> [cmdname, [array], {}] - cmdname table -> [cmdname, [], {table}] - cmdname array cmdname table -> [cmdname, [array], {table}] + cmdname '' -> [cmdname, [], {}] + cmdname val -> [cmdname, [val], {}] + cmdname array -> [cmdname, [array], {}] + cmdname table -> [cmdname, [], {table}] + cmdname array cmdname table -> [cmdname, [array], {table}] Observe that all MSDP_VARS are used to identify cmdnames, so if there are multiple arrays with the same cmdname @@ -379,12 +383,13 @@ class TelnetOOB(object): We assume the structure is valid JSON. The following is parsed into Evennia's formal structure: + :: - Core.Name -> [name, [], {}] - Core.Name string -> [name, [string], {}] - Core.Name [arg, arg,...] -> [name, [args], {}] - Core.Name {key:arg, key:arg, ...} -> [name, [], {kwargs}] - Core.Name [[args], {kwargs}] -> [name, [args], {kwargs}] + Core.Name -> [name, [], {}] + Core.Name string -> [name, [string], {}] + Core.Name [arg, arg,...] -> [name, [args], {}] + Core.Name {key:arg, key:arg, ...} -> [name, [], {kwargs}] + Core.Name [[args], {kwargs}] -> [name, [args], {kwargs}] """ if isinstance(data, list): diff --git a/evennia/server/profiling/README.txt b/evennia/server/profiling/README.md similarity index 93% rename from evennia/server/profiling/README.txt rename to evennia/server/profiling/README.md index ce02934687..3d02365d11 100644 --- a/evennia/server/profiling/README.txt +++ b/evennia/server/profiling/README.md @@ -1,5 +1,4 @@ - -Dummyrunner +# Dummyrunner 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. diff --git a/evennia/server/profiling/dummyrunner_settings.py b/evennia/server/profiling/dummyrunner_settings.py index 69f417f56c..c14327f735 100644 --- a/evennia/server/profiling/dummyrunner_settings.py +++ b/evennia/server/profiling/dummyrunner_settings.py @@ -6,15 +6,17 @@ the actions available to dummy accounts. The settings are global variables: -TIMESTEP - time in seconds between each 'tick' -CHANCE_OF_ACTION - chance 0-1 of action happening -CHANCE_OF_LOGIN - chance 0-1 of login happening -TELNET_PORT - port to use, defaults to settings.TELNET_PORT -ACTIONS - see below +- TIMESTEP - time in seconds between each 'tick' +- CHANCE_OF_ACTION - chance 0-1 of action happening +- CHANCE_OF_LOGIN - chance 0-1 of login happening +- TELNET_PORT - port to use, defaults to settings.TELNET_PORT +- ACTIONS - see below ACTIONS is a tuple +```python (login_func, logout_func, (0.3, func1), (0.1, func2) ... ) +``` 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 @@ -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. 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 - client id - gid - globally unique id, hashed with time stamp - istep - the current step - exits - an empty list. Can be used to store exit names - objs - an empty list. Can be used to store object names - counter() - returns a unique increasing id, hashed with time stamp - to make it unique also between dummyrunner instances. + +- key - an optional client key. This is only used for dummyrunner output. + Default is "Dummy-" +- cid - client id +- gid - globally unique id, hashed with time stamp +- istep - the current step +- exits - an empty list. Can be used to store exit names +- objs - an empty list. Can be used to store object names +- 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 command strings. This list of commands will always be executed every diff --git a/evennia/server/server.py b/evennia/server/server.py index a1b70820ea..c70deab119 100644 --- a/evennia/server/server.py +++ b/evennia/server/server.py @@ -1,10 +1,10 @@ """ -This module implements the main Evennia server process, the core of -the game engine. +This module implements the main Evennia server process, the core of the game +engine. -This module should be started with the 'twistd' executable since it -sets up all the networking features. (this is done automatically -by evennia/server/server_runner.py). +This module should be started with the 'twistd' executable since it sets up all +the networking features. (this is done automatically by +evennia/server/server_runner.py). """ import time @@ -401,16 +401,16 @@ class Evennia(object): Shuts down the server from inside it. mode - sets the server restart mode. - 'reload' - server restarts, no "persistent" scripts - are stopped, at_reload hooks called. - 'reset' - server restarts, non-persistent scripts stopped, - at_shutdown hooks called but sessions will not - be disconnected. - 'shutdown' - like reset, but server will not auto-restart. + - 'reload' - server restarts, no "persistent" scripts + are stopped, at_reload hooks called. + - 'reset' - server restarts, non-persistent scripts stopped, + at_shutdown hooks called but sessions will not + be disconnected. + - 'shutdown' - like reset, but server will not auto-restart. _reactor_stopping - this is set if server is stopped by a kill - command OR this method was already called - once - in both cases the reactor is - dead/stopping already. + command OR this method was already called + once - in both cases the reactor is + dead/stopping already. """ if _reactor_stopping and hasattr(self, "shutdown_complete"): # this means we have already passed through this method diff --git a/evennia/server/sessionhandler.py b/evennia/server/sessionhandler.py index 330e15988a..141aaefd66 100644 --- a/evennia/server/sessionhandler.py +++ b/evennia/server/sessionhandler.py @@ -746,6 +746,7 @@ class ServerSessionHandler(SessionHandler): Args csessid (str): The session hash. + Returns: sessions (list): The sessions with matching .csessid, if any.