Enable updating the inquisitor source

This commit is contained in:
Tim Van Baak 2020-12-29 20:50:25 -08:00
parent 4ded4ded42
commit d10b4f9205
2 changed files with 11 additions and 2 deletions

View File

@ -22,6 +22,12 @@ USE_NEWEST = (
)
class InquisitorStubSource:
"""A dummy source-like object for clearing out ad-hoc inquisitor items"""
def fetch_new(self, state):
return []
def ensure_cell(name):
"""
Creates a cell in the dungeon. Idempotent.
@ -74,6 +80,9 @@ def load_source(source_name):
Attempts to load the source module with the given name.
Raises an exception on failure.
"""
if source_name == 'inquisitor':
return InquisitorStubSource()
cwd = os.getcwd()
try:
# Push the sources directory.

View File

@ -25,7 +25,7 @@ def on_create(state, item):
with open('dungeon/inquisitor/triggerdemo_create.item', 'w') as f:
json.dump({
'source': 'inquisitor',
'id': 'triggerdemo_create.item',
'id': 'triggerdemo_create',
'title': 'Trigger demo on_create item',
'active': True,
}, f)
@ -35,7 +35,7 @@ def on_delete(state, item):
with open('dungeon/inquisitor/triggerdemo_delete.item', 'w') as f:
json.dump({
'source': 'inquisitor',
'id': 'triggerdemo_delete.item',
'id': 'triggerdemo_delete',
'title': 'Trigger demo on_delete item',
'active': True,
}, f)