Merge branch 'master' of https://github.com/evennia/evennia into bug_1704
This commit is contained in:
commit
290a6155e5
7 changed files with 103 additions and 5 deletions
7
CONTRIBUTING.md
Normal file
7
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Contributing to Evennia
|
||||||
|
|
||||||
|
Evennia utilizes GitHub for issue tracking and contributions:
|
||||||
|
|
||||||
|
- Reporting Issues issues/bugs and making feature requests can be done [in the issue tracker](https://github.com/evennia/evennia/issues).
|
||||||
|
- Evennia's documentation is a [wiki](https://github.com/evennia/evennia/wiki) that everyone can contribute to. Further
|
||||||
|
instructions and details about contributing is found [here](https://github.com/evennia/evennia/wiki/Contributing).
|
||||||
|
|
@ -744,7 +744,7 @@ hole
|
||||||
the remains of the castle. There is also a standing archway
|
the remains of the castle. There is also a standing archway
|
||||||
offering passage to a path along the old |wsouth|nern inner wall.
|
offering passage to a path along the old |wsouth|nern inner wall.
|
||||||
#
|
#
|
||||||
@detail portoculis;fall;fallen;grating =
|
@detail portcullis;fall;fallen;grating =
|
||||||
This heavy iron grating used to block off the inner part of the gate house, now it has fallen
|
This heavy iron grating used to block off the inner part of the gate house, now it has fallen
|
||||||
to the ground together with the stone archway that once help it up.
|
to the ground together with the stone archway that once help it up.
|
||||||
#
|
#
|
||||||
|
|
@ -786,7 +786,7 @@ archway
|
||||||
The buildings make a half-circle along the main wall, here and there
|
The buildings make a half-circle along the main wall, here and there
|
||||||
broken by falling stone and rubble. At one end (the |wnorth|nern) of
|
broken by falling stone and rubble. At one end (the |wnorth|nern) of
|
||||||
this half-circle is the entrance to the castle, the ruined
|
this half-circle is the entrance to the castle, the ruined
|
||||||
gatehoue. |wEast|nwards from here is some sort of open courtyard.
|
gatehouse. |wEast|nwards from here is some sort of open courtyard.
|
||||||
|
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
|
@ -808,7 +808,7 @@ archway
|
||||||
Previously one could probably continue past the obelisk and eastward
|
Previously one could probably continue past the obelisk and eastward
|
||||||
into the castle keep itself, but that way is now completely blocked
|
into the castle keep itself, but that way is now completely blocked
|
||||||
by fallen rubble. To the |wwest|n is the gatehouse and entrance to
|
by fallen rubble. To the |wwest|n is the gatehouse and entrance to
|
||||||
the castle, whereas |wsouth|nwards the collumns make way for a wide
|
the castle, whereas |wsouth|nwards the columns make way for a wide
|
||||||
open courtyard.
|
open courtyard.
|
||||||
#
|
#
|
||||||
@set here/tutorial_info =
|
@set here/tutorial_info =
|
||||||
|
|
|
||||||
|
|
@ -421,7 +421,7 @@ class IRCBotFactory(protocol.ReconnectingClientFactory):
|
||||||
|
|
||||||
def clientConnectionLost(self, connector, reason):
|
def clientConnectionLost(self, connector, reason):
|
||||||
"""
|
"""
|
||||||
Called when Client looses connection.
|
Called when Client loses connection.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
connector (Connection): Represents the connection.
|
connector (Connection): Represents the connection.
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ HTTP_LOG_FILE = os.path.join(LOG_DIR, 'http_requests.log')
|
||||||
LOCKWARNING_LOG_FILE = os.path.join(LOG_DIR, 'lockwarnings.log')
|
LOCKWARNING_LOG_FILE = os.path.join(LOG_DIR, 'lockwarnings.log')
|
||||||
# Rotate log files when server and/or portal stops. This will keep log
|
# Rotate log files when server and/or portal stops. This will keep log
|
||||||
# file sizes down. Turn off to get ever growing log files and never
|
# file sizes down. Turn off to get ever growing log files and never
|
||||||
# loose log info.
|
# lose log info.
|
||||||
CYCLE_LOGFILES = True
|
CYCLE_LOGFILES = True
|
||||||
# Number of lines to append to rotating channel logs when they rotate
|
# Number of lines to append to rotating channel logs when they rotate
|
||||||
CHANNEL_LOG_NUM_TAIL_LINES = 20
|
CHANNEL_LOG_NUM_TAIL_LINES = 20
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,12 @@ def create_script(typeclass=None, key=None, obj=None, account=None, locks=None,
|
||||||
# at_first_save hook on the typeclass, where the _createdict
|
# at_first_save hook on the typeclass, where the _createdict
|
||||||
# can be used.
|
# can be used.
|
||||||
new_script.save()
|
new_script.save()
|
||||||
|
|
||||||
|
if not new_script.id:
|
||||||
|
# this happens in the case of having a repeating script with `repeats=1` and
|
||||||
|
# `start_delay=False` - the script will run once and immediately stop before save is over.
|
||||||
|
return None
|
||||||
|
|
||||||
return new_script
|
return new_script
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -397,6 +397,11 @@ class SharedMemoryModel(with_metaclass(SharedMemoryModelBase, Model)):
|
||||||
super(SharedMemoryModel, cls).save(*args, **kwargs)
|
super(SharedMemoryModel, cls).save(*args, **kwargs)
|
||||||
callFromThread(_save_callback, self, *args, **kwargs)
|
callFromThread(_save_callback, self, *args, **kwargs)
|
||||||
|
|
||||||
|
if not self.pk:
|
||||||
|
# this can happen if some of the startup methods immediately
|
||||||
|
# delete the object (an example are Scripts that start and die immediately)
|
||||||
|
return
|
||||||
|
|
||||||
# update field-update hooks and eventual OOB watchers
|
# update field-update hooks and eventual OOB watchers
|
||||||
new = False
|
new = False
|
||||||
if "update_fields" in kwargs and kwargs["update_fields"]:
|
if "update_fields" in kwargs and kwargs["update_fields"]:
|
||||||
|
|
@ -421,6 +426,7 @@ class SharedMemoryModel(with_metaclass(SharedMemoryModelBase, Model)):
|
||||||
# fieldtracker = "_oob_at_%s_postsave" % fieldname
|
# fieldtracker = "_oob_at_%s_postsave" % fieldname
|
||||||
# if hasattr(self, fieldtracker):
|
# if hasattr(self, fieldtracker):
|
||||||
# _GA(self, fieldtracker)(fieldname)
|
# _GA(self, fieldtracker)(fieldname)
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class WeakSharedMemoryModelBase(SharedMemoryModelBase):
|
class WeakSharedMemoryModelBase(SharedMemoryModelBase):
|
||||||
|
|
|
||||||
79
evennia/utils/tests/test_create_functions.py
Normal file
79
evennia/utils/tests/test_create_functions.py
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
"""
|
||||||
|
Tests of create functions
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
from evennia.utils.test_resources import EvenniaTest
|
||||||
|
from evennia.scripts.scripts import DefaultScript
|
||||||
|
from evennia.utils import create
|
||||||
|
|
||||||
|
|
||||||
|
class TestCreateScript(EvenniaTest):
|
||||||
|
|
||||||
|
def test_create_script(self):
|
||||||
|
class TestScriptA(DefaultScript):
|
||||||
|
def at_script_creation(self):
|
||||||
|
self.key = 'test_script'
|
||||||
|
self.interval = 10
|
||||||
|
self.persistent = False
|
||||||
|
|
||||||
|
script = create.create_script(TestScriptA, key='test_script')
|
||||||
|
assert script is not None
|
||||||
|
assert script.interval == 10
|
||||||
|
assert script.key == 'test_script'
|
||||||
|
script.stop()
|
||||||
|
|
||||||
|
def test_create_script_w_repeats_equal_1(self):
|
||||||
|
class TestScriptB(DefaultScript):
|
||||||
|
def at_script_creation(self):
|
||||||
|
self.key = 'test_script'
|
||||||
|
self.interval = 10
|
||||||
|
self.repeats = 1
|
||||||
|
self.persistent = False
|
||||||
|
|
||||||
|
# script is already stopped (interval=1, start_delay=False)
|
||||||
|
script = create.create_script(TestScriptB, key='test_script')
|
||||||
|
assert script is None
|
||||||
|
|
||||||
|
def test_create_script_w_repeats_equal_1_persisted(self):
|
||||||
|
class TestScriptB1(DefaultScript):
|
||||||
|
def at_script_creation(self):
|
||||||
|
self.key = 'test_script'
|
||||||
|
self.interval = 10
|
||||||
|
self.repeats = 1
|
||||||
|
self.persistent = True
|
||||||
|
|
||||||
|
# script is already stopped (interval=1, start_delay=False)
|
||||||
|
script = create.create_script(TestScriptB1, key='test_script')
|
||||||
|
assert script is None
|
||||||
|
|
||||||
|
def test_create_script_w_repeats_equal_2(self):
|
||||||
|
class TestScriptC(DefaultScript):
|
||||||
|
def at_script_creation(self):
|
||||||
|
self.key = 'test_script'
|
||||||
|
self.interval = 10
|
||||||
|
self.repeats = 2
|
||||||
|
self.persistent = False
|
||||||
|
|
||||||
|
script = create.create_script(TestScriptC, key='test_script')
|
||||||
|
assert script is not None
|
||||||
|
assert script.interval == 10
|
||||||
|
assert script.repeats == 2
|
||||||
|
assert script.key == 'test_script'
|
||||||
|
script.stop()
|
||||||
|
|
||||||
|
def test_create_script_w_repeats_equal_1_and_delayed(self):
|
||||||
|
class TestScriptD(DefaultScript):
|
||||||
|
def at_script_creation(self):
|
||||||
|
self.key = 'test_script'
|
||||||
|
self.interval = 10
|
||||||
|
self.start_delay = True
|
||||||
|
self.repeats = 1
|
||||||
|
self.persistent = False
|
||||||
|
|
||||||
|
script = create.create_script(TestScriptD, key='test_script')
|
||||||
|
assert script is not None
|
||||||
|
assert script.interval == 10
|
||||||
|
assert script.repeats == 1
|
||||||
|
assert script.key == 'test_script'
|
||||||
|
script.stop()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue