Skip to content

Commit

Permalink
Forgot to load --third-party
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcCote committed Feb 20, 2019
1 parent 89ba254 commit 2502512
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/tw-make
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ def exit_listing_challenges(challenge=None):
def _maybe_load_third_party_module():
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("--third-party")
parser.add_argument("--silent", action="store_true")
args, _ = parser.parse_known_args()
if args.third_party:
if not args.silent:
print("Importing challenges from {}.".format(args.third_party))
import importlib.machinery
importlib.machinery.SourceFileLoader("tw_custom_challenge", args.third_party).load_module()

Expand All @@ -50,7 +53,7 @@ def parse_args():
help="Display an overview of the generated game.")
general_group.add_argument("--save-overview", action="store_true",
help="Save the overview image of the generated game alongside the game as a PNG file.")
general_group.add_argument("--third-party",
general_group.add_argument("--third-party", metavar="PATH",
help="Load third-party module. Useful to register new custom challenges on-the-fly.")
general_group.add_argument("-f", "--force", action="store_true")
general_group.add_argument("--list", action="store_true",
Expand Down Expand Up @@ -93,8 +96,6 @@ def parse_args():
quest_group.add_argument("--quest-breadth", type=int, metavar="BREADTH",
help="Nb. of subquests the quests will have. It is a shorthand"
" for '--quest-min-breadth N --quest-max-breadth N'.")
# quest_group.add_argument("--quest-depth", type=int, metavar="DEPTH",
# help="Nb. of actions the subquests will have.")

quest_group_advanced = custom_parser.add_argument_group('Quest settings (advanced)')
quest_group_advanced.add_argument("--quest-min-length", type=int, default=1, metavar="LENGTH",
Expand Down Expand Up @@ -133,8 +134,9 @@ def parse_args():


if __name__ == "__main__":
_maybe_load_third_party_module()
args, (parser, custom_parser, challenge_parsers) = parse_args()

if args.seed is None:
args.seed = np.random.randint(65635)

Expand Down

0 comments on commit 2502512

Please sign in to comment.