From 305bbe4d5e61e13be92267876531a61b1f3f80b5 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 9 Nov 2022 18:48:42 +0100 Subject: [PATCH] Update api docs --- docs/source/Coding/Changelog.md | 13 +++++++++++++ docs/source/Components/EvForm.md | 2 +- docs/source/Components/EvTable.md | 2 +- docs/source/Contribs/Contrib-Color-Markups.md | 4 ++-- docs/source/Contribs/Contrib-Custom-Gametime.md | 2 +- docs/source/Howtos/Command-Cooldown.md | 4 ++-- docs/source/Setup/Settings-Default.md | 8 ++++---- 7 files changed, 24 insertions(+), 11 deletions(-) diff --git a/docs/source/Coding/Changelog.md b/docs/source/Coding/Changelog.md index 2e27e93ed5..4f0286b25f 100644 --- a/docs/source/Coding/Changelog.md +++ b/docs/source/Coding/Changelog.md @@ -205,6 +205,19 @@ Up requirements to Django 4.0+, Twisted 22+, Python 3.9 or 3.10 - Make setting `MAX_NR_CHARACTERS` interact better with the new settings above. - Allow `$search` funcparser func to search tags and to accept kwargs for more powerful searches passed into the regular search functions. +- `spawner.spawn` and linked methods now has a kwarg `protfunc_raise_errors` + (default True) to disable strict errors on malformed/not-found protfuncs +- Improve search performance when having many DB-based prototypes via caching. +- Remove the `return_parents` kwarg of `evennia.prototypes.spawner.spawn` since it + was inefficient and unused. +- Made all id fields BigAutoField for all databases. (owllex) +- `EvForm` refactored. New `literals` mapping, for literal mappings into the + main template (e.g. for single-character replacements). +- `EvForm` `cells` kwarg now accepts `EvCells` with custom formatting options + (mainly for custom align/valign). `EvCells` now makes use of `utils.justify`. +- `utils.justify` now supports `align="a"` (absolute alignments. This keeps + the given left indent but crops/fills to the width. Used in EvCells. +- `EvTable` now supports passing `EvColumn`s as a list directly, (`EvTable(table=[colA,colB])`) ## Evennia 0.9.5 diff --git a/docs/source/Components/EvForm.md b/docs/source/Components/EvForm.md index 84d369cfcc..93372cce65 100644 --- a/docs/source/Components/EvForm.md +++ b/docs/source/Components/EvForm.md @@ -1,3 +1,3 @@ # EvForm -[Docstring in evennia/utils/evform.py](api:evennia.utils.evform) \ No newline at end of file +[Docstring in evennia/utils/evform.py](evennia.utils.evform) \ No newline at end of file diff --git a/docs/source/Components/EvTable.md b/docs/source/Components/EvTable.md index 3797808e13..18f8f64128 100644 --- a/docs/source/Components/EvTable.md +++ b/docs/source/Components/EvTable.md @@ -1,3 +1,3 @@ # EvTable -[Docstring in evennia/utils/evtable.py](api:evennia.utils.evtable) \ No newline at end of file +[Docstring in evennia/utils/evtable.py](evennia.utils.evtable) \ No newline at end of file diff --git a/docs/source/Contribs/Contrib-Color-Markups.md b/docs/source/Contribs/Contrib-Color-Markups.md index e56eab0d0f..6991c4c979 100644 --- a/docs/source/Contribs/Contrib-Color-Markups.md +++ b/docs/source/Contribs/Contrib-Color-Markups.md @@ -41,7 +41,7 @@ COLOR_XTERM256_EXTRA_FG = color_markups.CURLY_COLOR_XTERM256_EXTRA_FG COLOR_XTERM256_EXTRA_BG = color_markups.CURLY_COLOR_XTERM256_EXTRA_BG COLOR_XTERM256_EXTRA_GFG = color_markups.CURLY_COLOR_XTERM256_EXTRA_GFG COLOR_XTERM256_EXTRA_GBG = color_markups.CURLY_COLOR_XTERM256_EXTRA_GBG -COLOR_ANSI_BRIGHT_BG_EXTRA_MAP = color_markups.CURLY_COLOR_ANSI_BRIGHT_BG_EXTRA_MAP +COLOR_ANSI_XTERM256_BRIGHT_BG_EXTRA_MAP = color_markups.CURLY_COLOR_ANSI_XTERM256_BRIGHT_BG_EXTRA_MAP ``` To add the `%c-` "mux/mush" style, add the following to your settings file, then @@ -54,7 +54,7 @@ COLOR_XTERM256_EXTRA_FG = color_markups.MUX_COLOR_XTERM256_EXTRA_FG COLOR_XTERM256_EXTRA_BG = color_markups.MUX_COLOR_XTERM256_EXTRA_BG COLOR_XTERM256_EXTRA_GFG = color_markups.MUX_COLOR_XTERM256_EXTRA_GFG COLOR_XTERM256_EXTRA_GBG = color_markups.MUX_COLOR_XTERM256_EXTRA_GBG -COLOR_ANSI_BRIGHT_BGS_EXTRA_MAP = color_markups.CURLY_COLOR_ANSI_BRIGHT_BGS_EXTRA_MAP +COLOR_ANSI_XTERM256_BRIGHT_BG_EXTRA_MAP = color_markups.MUX_COLOR_ANSI_XTERM256_BRIGHT_BG_EXTRA_MAP ``` diff --git a/docs/source/Contribs/Contrib-Custom-Gametime.md b/docs/source/Contribs/Contrib-Custom-Gametime.md index 3314b4b9e1..309ea9370b 100644 --- a/docs/source/Contribs/Contrib-Custom-Gametime.md +++ b/docs/source/Contribs/Contrib-Custom-Gametime.md @@ -1,4 +1,4 @@ -# Custom gametime +# Custom gameime Contrib by vlgeoff, 2017 - based on Griatch's core original diff --git a/docs/source/Howtos/Command-Cooldown.md b/docs/source/Howtos/Command-Cooldown.md index 0b04840cc8..d7c6263fb8 100644 --- a/docs/source/Howtos/Command-Cooldown.md +++ b/docs/source/Howtos/Command-Cooldown.md @@ -13,7 +13,7 @@ combine if you want to echo some message to the user after the cooldown ends. ## The Cooldown Contrib -The [Cooldown contrib](Contribs/Contrib-Cooldowns) is a ready-made solution for +The [Cooldown contrib](../Contribs/Contrib-Cooldowns.md) is a ready-made solution for command cooldowns you can use. It implements a _handler_ on the object to conveniently manage and store the cooldowns in a similar manner exemplified in this tutorial. @@ -73,7 +73,7 @@ forgotten. ## Persistent cooldown To make a cooldown _persistent_ (so it survives a server reload), just -use the same technique, but use [Attributes](Attributes) (that is, `.db` instead +use the same technique, but use [Attributes](../Components/Attributes.md) (that is, `.db` instead of `.ndb` storage to save the last-cast time. ## Make a cooldown-aware command parent diff --git a/docs/source/Setup/Settings-Default.md b/docs/source/Setup/Settings-Default.md index 0cc21d3be7..9fc52a20b5 100644 --- a/docs/source/Setup/Settings-Default.md +++ b/docs/source/Setup/Settings-Default.md @@ -320,8 +320,10 @@ ATTRIBUTE_STORED_MODEL_RENAME = [ (("players", "playerdb"), ("accounts", "accountdb")), (("typeclasses", "defaultplayer"), ("typeclasses", "defaultaccount")), ] -# Default type of autofield (required by Django) -DEFAULT_AUTO_FIELD = "django.db.models.AutoField" +# Default type of autofield (required by Django), which defines the type of +# primary key fields for all tables. This type is guaranteed to be at least a +# 64-bit integer. +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" ###################################################################### # Evennia webclient options @@ -604,8 +606,6 @@ OPTIONS_ACCOUNT_DEFAULT = { "footer_text_color": ("Text inside Footer Lines.", "Color", "n"), "footer_fill": ("Fill for Footer Lines.", "Text", "="), "column_names_color": ("Table column header text.", "Color", "w"), - "help_category_color": ("Help category names.", "Color", "n"), - "help_entry_color": ("Help entry names.", "Color", "n"), "timezone": ("Timezone for dates.", "Timezone", "UTC"), } # Modules holding Option classes, responsible for serializing the option and