|
14 | 14 | from zulipterminal.config.keys import (
|
15 | 15 | HELP_CATEGORIES,
|
16 | 16 | KEY_BINDINGS,
|
| 17 | + display_key_for_urwid_key, |
| 18 | + display_keys_for_command, |
17 | 19 | is_command_key,
|
18 |
| - keys_for_command, |
19 | 20 | primary_key_for_command,
|
20 | 21 | )
|
21 | 22 | from zulipterminal.config.markdown_examples import MARKDOWN_ELEMENTS
|
@@ -1225,9 +1226,14 @@ def __init__(self, controller: Any, title: str) -> None:
|
1225 | 1226 | for binding in KEY_BINDINGS.values()
|
1226 | 1227 | if binding["key_category"] == category
|
1227 | 1228 | )
|
1228 |
| - key_bindings = [] |
1229 |
| - for binding in keys_in_category: |
1230 |
| - key_bindings.append((binding["help_text"], ", ".join(binding["keys"]))) |
| 1229 | + key_bindings = [ |
| 1230 | + ( |
| 1231 | + binding["help_text"], |
| 1232 | + ", ".join(map(display_key_for_urwid_key, binding["keys"])), |
| 1233 | + ) |
| 1234 | + for binding in keys_in_category |
| 1235 | + ] |
| 1236 | + |
1231 | 1237 | help_menu_content.append((HELP_CATEGORIES[category], key_bindings))
|
1232 | 1238 |
|
1233 | 1239 | popup_width, column_widths = self.calculate_table_widths(
|
@@ -1379,15 +1385,17 @@ def __init__(self, controller: Any, stream_id: int) -> None:
|
1379 | 1385 | if stream["history_public_to_subscribers"]
|
1380 | 1386 | else "Not Public to Users"
|
1381 | 1387 | )
|
1382 |
| - member_keys = ", ".join(map(repr, keys_for_command("STREAM_MEMBERS"))) |
| 1388 | + member_keys = ", ".join(map(repr, display_keys_for_command("STREAM_MEMBERS"))) |
1383 | 1389 |
|
1384 | 1390 | # FIXME: This field was removed from the subscription data in Zulip 7.5 / ZFL226
|
1385 | 1391 | # We should use the new /streams/{stream_id}/email_address endpoint instead
|
1386 | 1392 | self._stream_email = stream.get("email_address", None)
|
1387 | 1393 | if self._stream_email is None:
|
1388 | 1394 | stream_copy_text = "< Stream email is unavailable >"
|
1389 | 1395 | else:
|
1390 |
| - email_keys = ", ".join(map(repr, keys_for_command("COPY_STREAM_EMAIL"))) |
| 1396 | + email_keys = ", ".join( |
| 1397 | + map(repr, display_keys_for_command("COPY_STREAM_EMAIL")) |
| 1398 | + ) |
1391 | 1399 | stream_copy_text = f"Press {email_keys} to copy Stream email address"
|
1392 | 1400 |
|
1393 | 1401 | weekly_traffic = stream["stream_weekly_traffic"]
|
@@ -1562,14 +1570,14 @@ def __init__(
|
1562 | 1570 | msg["timestamp"], show_seconds=True, show_year=True
|
1563 | 1571 | )
|
1564 | 1572 | view_in_browser_keys = "[{}]".format(
|
1565 |
| - ", ".join(map(str, keys_for_command("VIEW_IN_BROWSER"))) |
| 1573 | + ", ".join(map(str, display_keys_for_command("VIEW_IN_BROWSER"))) |
1566 | 1574 | )
|
1567 | 1575 |
|
1568 | 1576 | full_rendered_message_keys = "[{}]".format(
|
1569 |
| - ", ".join(map(str, keys_for_command("FULL_RENDERED_MESSAGE"))) |
| 1577 | + ", ".join(map(str, display_keys_for_command("FULL_RENDERED_MESSAGE"))) |
1570 | 1578 | )
|
1571 | 1579 | full_raw_message_keys = "[{}]".format(
|
1572 |
| - ", ".join(map(str, keys_for_command("FULL_RAW_MESSAGE"))) |
| 1580 | + ", ".join(map(str, display_keys_for_command("FULL_RAW_MESSAGE"))) |
1573 | 1581 | )
|
1574 | 1582 | msg_info = [
|
1575 | 1583 | (
|
@@ -1601,7 +1609,9 @@ def __init__(
|
1601 | 1609 | if self.show_edit_history_label:
|
1602 | 1610 | msg_info[0][1][0] = ("Date & Time (Original)", date_and_time)
|
1603 | 1611 |
|
1604 |
| - keys = "[{}]".format(", ".join(map(str, keys_for_command("EDIT_HISTORY")))) |
| 1612 | + keys = "[{}]".format( |
| 1613 | + ", ".join(map(str, display_keys_for_command("EDIT_HISTORY"))) |
| 1614 | + ) |
1605 | 1615 | msg_info[1][1].append(("Edit History", keys))
|
1606 | 1616 | # Render the category using the existing table methods if links exist.
|
1607 | 1617 | if message_links:
|
|
0 commit comments