From 802f8ac21e515ec83b9d339d93cb205b04245c35 Mon Sep 17 00:00:00 2001 From: InspectorCaracal Date: Mon, 26 Dec 2022 10:31:51 -0700 Subject: [PATCH 1/6] fix behavior with two items --- evennia/utils/tests/test_utils.py | 1 + evennia/utils/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/evennia/utils/tests/test_utils.py b/evennia/utils/tests/test_utils.py index c7fe417ccb..cc245a5529 100644 --- a/evennia/utils/tests/test_utils.py +++ b/evennia/utils/tests/test_utils.py @@ -93,6 +93,7 @@ class TestListToString(TestCase): '"1", "2" and "3"', utils.list_to_string([1, 2, 3], endsep="and", addquote=True) ) self.assertEqual("1 and 2", utils.list_to_string([1, 2])) + self.assertEqual("1, 2", utils.list_to_string([1, 2], endsep=",")) class TestMLen(TestCase): diff --git a/evennia/utils/utils.py b/evennia/utils/utils.py index b96338dead..180f8e8b56 100644 --- a/evennia/utils/utils.py +++ b/evennia/utils/utils.py @@ -448,7 +448,7 @@ def iter_to_str(iterable, sep=",", endsep=", and", addquote=False): iterable = tuple(str(val) for val in iterable) if endsep: - if endsep.startswith(sep): + if endsep.startswith(sep) and endsep != sep: # oxford comma alternative endsep = endsep[1:] if len_iter < 3 else endsep elif endsep[0] not in punctuation: From 813411bcbb8e8ecb533a6a33445cf274f70f07ee Mon Sep 17 00:00:00 2001 From: GyroFalc <43814421+GyroFalc@users.noreply.github.com> Date: Fri, 30 Dec 2022 14:54:50 +0100 Subject: [PATCH 2/6] Minor grammar error fix --- docs/source/Components/Typeclasses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/Components/Typeclasses.md b/docs/source/Components/Typeclasses.md index 6152cd6ee9..db61595bfa 100644 --- a/docs/source/Components/Typeclasses.md +++ b/docs/source/Components/Typeclasses.md @@ -315,4 +315,4 @@ The answer is simply **no**. For example, the max dbref value for the default sqlite3 database is `2**64`. If you *created 10 000 new objects every second of every minute of every day of the year it would take about **60 million years** for you to run out of dbref numbers*. That's a database of 140 TeraBytes, just to store the dbrefs, no other data. -If you are still using Evennia at that point and has this concern, get back to us and we can discuss adding dbref reuse then. \ No newline at end of file +If you are still using Evennia at that point and have this concern, get back to us and we can discuss adding dbref reuse then. From ad6c5642751c8a48c155c330f604e85dbaee9265 Mon Sep 17 00:00:00 2001 From: Antrare Date: Mon, 2 Jan 2023 10:12:53 +1100 Subject: [PATCH 3/6] Update fieldfill.py Update fieldfill location in evmenu so that it can find the startnode correctly. --- evennia/contrib/utils/fieldfill/fieldfill.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evennia/contrib/utils/fieldfill/fieldfill.py b/evennia/contrib/utils/fieldfill/fieldfill.py index 174c5e1bd6..6da046ed75 100644 --- a/evennia/contrib/utils/fieldfill/fieldfill.py +++ b/evennia/contrib/utils/fieldfill/fieldfill.py @@ -234,7 +234,7 @@ def init_fill_field( # Initialize menu of selections FieldEvMenu( caller, - "evennia.contrib.utils.fieldfill", + "evennia.contrib.utils.fieldfill.fieldfill", startnode="menunode_fieldfill", auto_look=False, persistent=persistent, From a00a3cf9a158da657dbbd4938142c68951761669 Mon Sep 17 00:00:00 2001 From: 0bviouSquirre1 <41396915+0bviouSquirre1@users.noreply.github.com> Date: Mon, 2 Jan 2023 11:27:15 -0500 Subject: [PATCH 4/6] Update Beginner-Tutorial-Python-basic-introduction.md updated in the actual readme, but in the link it states: > create/drop mirror:contrib.tutorial_examples.mirror.TutorialMirror where in fact it should now say: > create/drop mirror:contrib.tutorials.mirror.TutorialMirror --- .../Part1/Beginner-Tutorial-Python-basic-introduction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Python-basic-introduction.md b/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Python-basic-introduction.md index df7b7124ea..c9a446e52d 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Python-basic-introduction.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Python-basic-introduction.md @@ -425,7 +425,7 @@ the room it is in. On the game command-line, let's create a mirror: - > create/drop mirror:contrib.tutorial_examples.mirror.TutorialMirror + > create/drop mirror:contrib.tutorials.mirror.TutorialMirror ```{sidebar} Creating objects @@ -638,4 +638,4 @@ first function, fixed an error and even searched and talked to a mirror! Being a python inside and outside of the game is an important skill for testing and debugging, but in practice you will be writing most your code in Python modules. -To that end we also created a first new Python module in the `mygame/` game dir, then imported and used it. Now let's look at the rest of the stuff you've got going on inside that `mygame/` folder ... \ No newline at end of file +To that end we also created a first new Python module in the `mygame/` game dir, then imported and used it. Now let's look at the rest of the stuff you've got going on inside that `mygame/` folder ... From b668dd8ef6c45e3edbebf303a3c95713bdf02059 Mon Sep 17 00:00:00 2001 From: 0bviouSquirre1 <41396915+0bviouSquirre1@users.noreply.github.com> Date: Wed, 4 Jan 2023 14:29:52 -0500 Subject: [PATCH 5/6] Update Beginner-Tutorial-Making-A-Sittable-Object.md references to `self.obj` should be just `self`. Changed to reflect such --- .../Part1/Beginner-Tutorial-Making-A-Sittable-Object.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Making-A-Sittable-Object.md b/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Making-A-Sittable-Object.md index 8ad638fa77..7dde275938 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Making-A-Sittable-Object.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Making-A-Sittable-Object.md @@ -72,7 +72,7 @@ class Sittable(Object): f"- {current.key} is already sitting there!") return self.db.sitting = sitter - sitter.db.is_sitting = self.obj + sitter.db.is_sitting = self sitter.msg(f"You sit on {self.key}") ``` @@ -165,7 +165,7 @@ class Sittable(DefaultObject): f"- {current.key} is already sitting there!") return self.db.sitting = sitter - sitter.db.is_sitting = self.obj + sitter.db.is_sitting = self sitter.msg(f"You sit {adjective} {self.key}") def do_stand(self, stander): @@ -663,4 +663,4 @@ In this lesson we built ourselves a chair and even a sofa! Eagle-eyed readers will notice that the `stand` command sitting "on" the chair (variant 1) would work just fine together with the `sit` command sitting "on" the Character (variant 2). There is nothing stopping you from mixing them, or even try a third solution that better fits what you have in mind. -This concludes the first part of the Beginner tutorial! \ No newline at end of file +This concludes the first part of the Beginner tutorial! From c31dbc7a3702f671fc9ec6cd7565b72e86551f67 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 6 Jan 2023 18:13:41 +0100 Subject: [PATCH 6/6] Update docs --- docs/source/Contribs/Contrib-Components.md | 2 +- docs/source/Contribs/Contrib-Crafting.md | 8 ++++---- docs/source/Contribs/Contrib-Ingame-Map-Display.md | 2 +- docs/source/Contribs/Contrib-RPSystem.md | 2 +- docs/source/Contribs/Contrib-Red-Button.md | 2 +- docs/source/Contribs/Contrib-Tutorial-World.md | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/source/Contribs/Contrib-Components.md b/docs/source/Contribs/Contrib-Components.md index 63932e24bf..aa221f860e 100644 --- a/docs/source/Contribs/Contrib-Components.md +++ b/docs/source/Contribs/Contrib-Components.md @@ -30,7 +30,7 @@ class Character(ComponentHolderMixin, DefaultCharacter): Components need to inherit the Component class directly and require a name. ```python -from evennia.contrib.components import Component +from evennia.contrib.base_systems.components import Component class Health(Component): name = "health" diff --git a/docs/source/Contribs/Contrib-Crafting.md b/docs/source/Contribs/Contrib-Crafting.md index 36e9071350..efe8639b0c 100644 --- a/docs/source/Contribs/Contrib-Crafting.md +++ b/docs/source/Contribs/Contrib-Crafting.md @@ -115,7 +115,7 @@ class RecipeBread(CraftingRecipe): ## Adding new recipes A *recipe* is a class inheriting from -`evennia.contrib.crafting.crafting.CraftingRecipe`. This class implements the +`evennia.contrib.game_systems.crafting.CraftingRecipe`. This class implements the most common form of crafting - that using in-game objects. Each recipe is a separate class which gets initialized with the consumables/tools you provide. @@ -137,7 +137,7 @@ example setting: ```python # in mygame/world/myrecipes.py -from evennia.contrib.crafting.crafting import CraftingRecipe +from evennia.contrib.game_systems.crafting import CraftingRecipe class WoodenPuppetRecipe(CraftingRecipe): """A puppet"""" @@ -200,7 +200,7 @@ in-game command: In code we would do ```python -from evennia.contrib.crafting.crafting import craft +from evennia.contrib.game_systems.crafting import craft puppet = craft(crafter, "wooden puppet", knife, wood) ``` @@ -259,7 +259,7 @@ parent class and have your recipes inherit from this. ```python from random import randint -from evennia.contrib.crafting.crafting import CraftingRecipe +from evennia.contrib.game_systems.crafting import CraftingRecipe class SkillRecipe(CraftingRecipe): """A recipe that considers skill""" diff --git a/docs/source/Contribs/Contrib-Ingame-Map-Display.md b/docs/source/Contribs/Contrib-Ingame-Map-Display.md index 905203c864..34fff1c6e6 100644 --- a/docs/source/Contribs/Contrib-Ingame-Map-Display.md +++ b/docs/source/Contribs/Contrib-Ingame-Map-Display.md @@ -21,7 +21,7 @@ Specifically, in `mygame/commands/default_cmdsets.py`: ... from evennia.contrib.grid.ingame_map_display import MapDisplayCmdSet # <--- -class CharacterCmdset(default_cmds.Character_CmdSet): +class CharacterCmdset(default_cmds.CharacterCmdSet): ... def at_cmdset_creation(self): ... diff --git a/docs/source/Contribs/Contrib-RPSystem.md b/docs/source/Contribs/Contrib-RPSystem.md index 4ed4eeb644..693a98a495 100644 --- a/docs/source/Contribs/Contrib-RPSystem.md +++ b/docs/source/Contribs/Contrib-RPSystem.md @@ -166,7 +166,7 @@ This module adds no new commands; embed it in your say/emote/whisper commands. ### Usage: ```python -from evennia.contrib import rplanguage +from evennia.contrib.rpg.rpsystem import rplanguage # need to be done once, here we create the "default" lang rplanguage.add_language() diff --git a/docs/source/Contribs/Contrib-Red-Button.md b/docs/source/Contribs/Contrib-Red-Button.md index b3c30e955e..544b065434 100644 --- a/docs/source/Contribs/Contrib-Red-Button.md +++ b/docs/source/Contribs/Contrib-Red-Button.md @@ -7,7 +7,7 @@ object with its own functionality and state tracking. Create the button with - create/drop button:tutorials.red_button.RedButton + create/drop button:contrib.tutorials.red_button.RedButton Note that you must drop the button before you can see its messages! It's imperative that you press the red button. You know you want to. diff --git a/docs/source/Contribs/Contrib-Tutorial-World.md b/docs/source/Contribs/Contrib-Tutorial-World.md index dee6e663b3..c1c2c8be2e 100644 --- a/docs/source/Contribs/Contrib-Tutorial-World.md +++ b/docs/source/Contribs/Contrib-Tutorial-World.md @@ -17,7 +17,7 @@ Evmenu. Log in as superuser (#1), then run - batchcommand tutorials.tutorial_world.build + batchcommand contrib.tutorials.tutorial_world.build Wait a little while for building to complete and don't run the command again even if it's slow. This builds the world and connect it to Limbo