Skip to content

Commit

Permalink
type: workaround for pyright bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau authored and sergiusens committed Jun 29, 2023
1 parent 4ce377c commit b3dee09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion snapcraft/commands/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,13 @@ class StoreNamesCommand(BaseCommand):
def run(self, parsed_args):
store_client = store.StoreClientCLI()
snaps = store_client.get_names()
snaps.sort(key=operator.itemgetter(0))

if not snaps:
emit.message("No registered snaps")
else:
tabulated_snaps = tabulate(
sorted(snaps, key=operator.itemgetter(0)),
snaps,
headers=["Name", "Since", "Visibility", "Notes"],
tablefmt="plain",
)
Expand Down
4 changes: 2 additions & 2 deletions snapcraft/commands/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,11 @@ def run(self, parsed_args):
]
for track in snap_channel_map.snap.tracks
]
track_table.sort(key=operator.itemgetter(2)) # Sort by "creation-date".

emit.message(
tabulate(
# Sort by "creation-date".
sorted(track_table, key=operator.itemgetter(2)),
track_table,
headers=["Name", "Status", "Creation-Date", "Version-Pattern"],
tablefmt="plain",
)
Expand Down

0 comments on commit b3dee09

Please sign in to comment.