Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hack: allow users to safely provide their own quests in a well accessible place #1240

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions eosclubhouse/libquest.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,14 @@ def _get_episode_quests_classes(class_):
def get_matching_quests(class_, tag):
for subclass in class_._get_episode_quests_classes():
if tag in subclass.get_tags():
# bail out early if the quest script contains any errors
# and log it accordingly
try:
subclass()
except Exception as e:
logger.error('Error loading quest: {0}'.format(e))
continue

if subclass not in class_._quest_instances:
class_._quest_instances[subclass] = subclass()
yield class_._quest_instances[subclass]
Expand Down
2 changes: 1 addition & 1 deletion eosclubhouse/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


def get_alternative_quests_dir():
return os.path.join(GLib.get_user_data_dir(), 'quests')
return os.path.join(GLib.get_home_dir(), 'quests')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the idea of having this folder in the user home. It could simplify the content creation for the user, but the app loose the control over that folder, because we don't know what the user can add there.



class _CircleList(list):
Expand Down