X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=turbot%2Fhunt.py;h=97712982fd32aa7afb4367a7b65ce0838f3c910f;hb=5e7ee7c20f71996cedd04586d7139250c6704c0d;hp=c2e59e2be937c4577e7696f80b01fce51356e05d;hpb=29c36d3057c5602c5a4b6fb0e48f454db01ddd9d;p=turbot diff --git a/turbot/hunt.py b/turbot/hunt.py index c2e59e2..9771298 100644 --- a/turbot/hunt.py +++ b/turbot/hunt.py @@ -1,4 +1,6 @@ -from turbot.blocks import section_block, text_block, divider_block +from turbot.blocks import ( + section_block, text_block, divider_block, accessory_block, button_block +) from turbot.round import round_blocks from turbot.puzzle import puzzle_blocks, puzzle_matches_all from turbot.channel import channel_url @@ -54,8 +56,9 @@ def hunt_blocks(turb, hunt, puzzle_status='unsolved', search_terms=[], all of these terms will be included in the result. A match will be considered on any of puzzle title, round title, puzzle URL, puzzle - state or solution string. Terms can include - regular expression syntax. + state, puzzle type, tags, or solution + string. Terms can include regular expression + syntax. limit_to_rounds: A list of rounds. If provided only the given rounds will be included in the output. Note: @@ -109,12 +112,18 @@ def hunt_blocks(turb, hunt, puzzle_status='unsolved', search_terms=[], hunt_text += " matching {}".format(" AND ".join(quoted_terms)) blocks = [ - section_block(text_block(hunt_text)), + accessory_block( + section_block(text_block(hunt_text)), + button_block("✏", "edit_hunt", hunt_id) + ) ] if not len(puzzles): + text = "No puzzles found." + if puzzle_status != 'all': + text += ' (Consider searching for "all" puzzles?)' blocks += [ - section_block(text_block("No puzzles found.")) + section_block(text_block(text)) ] # Construct blocks for each round