Update links/paths to new contrib locations

This commit is contained in:
Griatch 2021-12-19 17:04:26 +01:00
parent 7f2b8c81d7
commit 8139fd79c7
61 changed files with 171 additions and 248 deletions

View file

View file

@ -11,7 +11,7 @@ import datetime, gzip, pickle, threading
_SKIP = False
try:
from botocore.exceptions import ClientError
from evennia.contrib.awsstorage import aws_s3_cdn as s3boto3
from .awsstorage import aws_s3_cdn as s3boto3
except ImportError:
_SKIP = True

View file

@ -13,10 +13,11 @@ that will edit any default object offering to change its key and description.
## Install
1. Import the `GenericBuildingCmd` class from this contrib in your `mygame/commands/default_cmdset.py` file:
1. Import the `GenericBuildingCmd` class from this contrib in your
`mygame/commands/default_cmdset.py` file:
```python
from evennia.base_systems.contrib.building_menu import GenericBuildingCmd
from evennia.contrib.base_systems.building_menu import GenericBuildingCmd
```
2. Below, add the command in the `CharacterCmdSet`:

View file

@ -60,7 +60,7 @@ The first thing to do is to create a new module and place a class
inheriting from `BuildingMenu` in it.
```python
from evennia.contrib.building_menu.building_menu import BuildingMenu
from evennia.contrib.base_systems.building_menu.building_menu import BuildingMenu
class RoomBuildingMenu(BuildingMenu):
# ...

View file

@ -160,7 +160,7 @@ class TestBuildingMenu(CommandTest):
"""Test to add sub-menus."""
def open_exit(menu):
menu.open_submenu("evennia.contrib.tests.Submenu", self.exit)
menu.open_submenu("evennia.contrib.base_systems.building_menu.tests.Submenu", self.exit)
return False
self.menu.add_choice("exit", key="x", on_enter=open_exit)

View file

@ -47,7 +47,7 @@ To add the `%c-` "mux/mush" style, add the following to your settings file, then
reboot both Server and Portal:
```python
from evennia.contrib import color_markups
from evennia.contrib.base_systems import color_markups
COLOR_ANSI_EXTRA_MAP = color_markups.MUX_COLOR_ANSI_EXTRA_MAP
COLOR_XTERM256_EXTRA_FG = color_markups.MUX_COLOR_XTERM256_EXTRA_FG
COLOR_XTERM256_EXTRA_BG = color_markups.MUX_COLOR_XTERM256_EXTRA_BG

View file

@ -291,7 +291,7 @@ def schedule(callback, repeat=False, **kwargs):
"""
seconds = real_seconds_until(**kwargs)
script = create_script(
"evennia.contrib.custom_gametime.GametimeScript",
"evennia.contrib.base_systems.custom_gametime.GametimeScript",
key="GametimeScript",
desc="A timegame-sensitive script",
interval=seconds,

View file

@ -84,10 +84,10 @@ This is the quick summary. Scroll down for more detailed help on each step.
default to `None`).
3. Add the `call` command.
4. Inherit from the custom typeclasses of the in-game Python system.
- `evennia.contrib.ingame_python.typeclasses.EventCharacter`: to replace `DefaultCharacter`.
- `evennia.contrib.ingame_python.typeclasses.EventExit`: to replace `DefaultExit`.
- `evennia.contrib.ingame_python.typeclasses.EventObject`: to replace `DefaultObject`.
- `evennia.contrib.ingame_python.typeclasses.EventRoom`: to replace `DefaultRoom`.
- `evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter`: to replace `DefaultCharacter`.
- `evennia.contrib.base_systems.ingame_python.typeclasses.EventExit`: to replace `DefaultExit`.
- `evennia.contrib.base_systems.ingame_python.typeclasses.EventObject`: to replace `DefaultObject`.
- `evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom`: to replace `DefaultRoom`.
The following sections describe in details each step of the installation.
@ -181,7 +181,7 @@ this:
```python
from evennia import default_cmds
from evennia.contrib.ingame_python.commands import CmdCallback
from evennia.contrib.base_systems.ingame_python.commands import CmdCallback
class CharacterCmdSet(default_cmds.CharacterCmdSet):
"""
@ -679,8 +679,8 @@ Here, we want to add a "push" event on objects. In your `typeclasses/objects.py
write something like:
```python
from evennia.contrib.ingame_python.utils import register_events
from evennia.contrib.ingame_python.typeclasses import EventObject
from evennia.contrib.base_systems.ingame_python.utils import register_events
from evennia.contrib.base_systems.ingame_python.typeclasses import EventObject
EVENT_PUSH = """
A character push the object.
@ -806,14 +806,15 @@ see a message about a "beautiful ant-hill".
### Adding new eventfuncs
Eventfuncs, like `deny()`, are defined in `contrib/events/eventfuncs.py`. You can add your own
eventfuncs by creating a file named `eventfuncs.py` in your `world` directory. The functions
defined in this file will be added as helpers.
Eventfuncs, like `deny()`, are defined in
`contrib/base_systesm/ingame_python/eventfuncs.py`. You can add your own
eventfuncs by creating a file named `eventfuncs.py` in your `world` directory.
The functions defined in this file will be added as helpers.
You can also decide to create your eventfuncs in another location, or even in several locations. To
do so, edit the `EVENTFUNCS_LOCATION` setting in your `server/conf/settings.py` file, specifying
either a python path or a list of Python paths in which your helper functions are defined. For
instance:
You can also decide to create your eventfuncs in another location, or even in
several locations. To do so, edit the `EVENTFUNCS_LOCATION` setting in your
`server/conf/settings.py` file, specifying either a python path or a list of
Python paths in which your helper functions are defined. For instance:
```python
EVENTFUNCS_LOCATIONS = [

View file

@ -70,7 +70,7 @@ class EventHandler(DefaultScript):
# Generate locals
self.ndb.current_locals = {}
self.ndb.fresh_locals = {}
addresses = ["evennia.contrib.ingame_python.eventfuncs"]
addresses = ["evennia.contrib.base_systems.ingame_python.eventfuncs"]
addresses.extend(getattr(settings, "EVENTFUNCS_LOCATIONS", ["world.eventfuncs"]))
for address in addresses:
if pypath_to_realpath(address):
@ -87,7 +87,7 @@ class EventHandler(DefaultScript):
delay(seconds, complete_task, task_id)
# Place the script in the CallbackHandler
from evennia.contrib.ingame_python import typeclasses
from evennia.contrib.base_systems.ingame_python import typeclasses
CallbackHandler.script = self
DefaultObject.callbacks = typeclasses.EventObject.callbacks

View file

@ -31,18 +31,18 @@ class TestEventHandler(EvenniaTest):
def setUp(self):
"""Create the event handler."""
super().setUp()
self.handler = create_script("evennia.contrib.ingame_python.scripts.EventHandler")
self.handler = create_script("evennia.contrib.base_systems.ingame_python.scripts.EventHandler")
# Copy old events if necessary
if OLD_EVENTS:
self.handler.ndb.events = dict(OLD_EVENTS)
# Alter typeclasses
self.char1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter")
self.char2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter")
self.room1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom")
self.room2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom")
self.exit.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventExit")
self.char1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter")
self.char2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter")
self.room1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom")
self.room2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom")
self.exit.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventExit")
def tearDown(self):
"""Stop the event handler."""
@ -253,18 +253,18 @@ class TestCmdCallback(CommandTest):
def setUp(self):
"""Create the callback handler."""
super().setUp()
self.handler = create_script("evennia.contrib.ingame_python.scripts.EventHandler")
self.handler = create_script("evennia.contrib.base_systems.ingame_python.scripts.EventHandler")
# Copy old events if necessary
if OLD_EVENTS:
self.handler.ndb.events = dict(OLD_EVENTS)
# Alter typeclasses
self.char1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter")
self.char2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter")
self.room1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom")
self.room2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom")
self.exit.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventExit")
self.char1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter")
self.char2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter")
self.room1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom")
self.room2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom")
self.exit.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventExit")
def tearDown(self):
"""Stop the callback handler."""
@ -272,7 +272,7 @@ class TestCmdCallback(CommandTest):
OLD_EVENTS.update(self.handler.ndb.events)
self.handler.delete()
for script in ScriptDB.objects.filter(
db_typeclass_path="evennia.contrib.ingame_python.scripts.TimeEventScript"
db_typeclass_path="evennia.contrib.base_systems.ingame_python.scripts.TimeEventScript"
):
script.delete()
@ -432,18 +432,18 @@ class TestDefaultCallbacks(CommandTest):
def setUp(self):
"""Create the callback handler."""
super().setUp()
self.handler = create_script("evennia.contrib.ingame_python.scripts.EventHandler")
self.handler = create_script("evennia.contrib.base_systems.ingame_python.scripts.EventHandler")
# Copy old events if necessary
if OLD_EVENTS:
self.handler.ndb.events = dict(OLD_EVENTS)
# Alter typeclasses
self.char1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter")
self.char2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventCharacter")
self.room1.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom")
self.room2.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventRoom")
self.exit.swap_typeclass("evennia.contrib.ingame_python.typeclasses.EventExit")
self.char1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter")
self.char2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventCharacter")
self.room1.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom")
self.room2.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventRoom")
self.exit.swap_typeclass("evennia.contrib.base_systems.ingame_python.typeclasses.EventExit")
def tearDown(self):
"""Stop the callback handler."""

View file

@ -173,7 +173,7 @@ def time_event(obj, event_name, number, parameters):
"""
seconds, usual, key = get_next_wait(parameters)
script = create_script(
"evennia.contrib.ingame_python.scripts.TimeEventScript", interval=seconds, obj=obj
"evennia.contrib.base_systems.ingame_python.scripts.TimeEventScript", interval=seconds, obj=obj
)
script.key = key
script.desc = "event on {}".format(key)

View file

@ -8,7 +8,7 @@ sequence instead of requiring you to enter both at once.
To install, add this line to the settings file (`mygame/server/conf/settings.py`):
CMDSET_UNLOGGEDIN = "evennia.base_systems.contrib.menu_login.UnloggedinCmdSet"
CMDSET_UNLOGGEDIN = "evennia.contrib.base_systems.menu_login.UnloggedinCmdSet"
Reload the server and the new connection method will be active. Note that you must
independently change the connection screen to match this login style, by editing
@ -244,7 +244,7 @@ class CmdUnloggedinLook(Command):
"""
EvMenu(
self.caller,
"evennia.contrib.menu_login",
"evennia.contrib.base_systems.menu_login",
startnode="node_enter_username",
auto_look=False,
auto_quit=False,