Enable updating the inquisitor source
This commit is contained in:
parent
4ded4ded42
commit
d10b4f9205
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue