From a4130b21feed60a8ed4b5f6db6a2c651729493dd Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Tue, 25 Mar 2025 23:08:37 -0700 Subject: [PATCH] sort labels by app name --- genlabeldefs.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/genlabeldefs.py b/genlabeldefs.py index f3de957..6b1456a 100755 --- a/genlabeldefs.py +++ b/genlabeldefs.py @@ -2,24 +2,26 @@ import json -collections = [ - ('app-popsky', 'Popsky', 'pop culture hub (app.popsky.*)'), - ('com-shinolabs-pinksea', 'PinkSea', 'oekaki on atproto (com.shinolabs.pinksea.*)'), - ('com-whtwnd', 'WhiteWind', 'markdown blog service (com.whtwnd.*)'), - ('events-smokesignal', 'Smoke Signal', 'manage events and RSVPs (events.smokesignal.*)'), - ('fm-teal', 'teal.fm', 'your music, beautifully tracked (fm.teal.*)'), - ('fyi-unravel-frontpage', 'Frontpage', 'a decentralised and federated link aggregator (fyi.unravel.frontpage.*)'), - ('im-flushing', 'Flushes', 'The Decentralized Toilet Network of Planet Earth & Simulation 12B (im.flushing.*)'), - ('place-stream', 'Streamplace', 'live video on the AT Protocol (place.stream.*)'), - ('sh-tangled', 'Tangled', 'tightly-knit social coding (sh.tangled.*)'), - ('so-sprk', 'Spark', 'short-form video/photo app (so.sprk.*)'), - ('xyz-statusphere', 'Statusphere', 'atproto quick start (xyz.statusphere.*)'), -] +collections = { + 'Popsky': ('app-popsky', 'pop culture hub'), + 'PinkSea': ('com-shinolabs-pinksea', 'oekaki on atproto'), + 'WhiteWind': ('com-whtwnd', 'markdown blog service'), + 'Smoke Signal': ('events-smokesignal', 'manage events and RSVPs'), + 'teal.fm': ('fm-teal', 'your music, beautifully tracked'), + 'Frontpage': ('fyi-unravel-frontpage', 'a decentralised and federated link aggregator'), + 'Flushes': ('im-flushing', 'The Decentralized Toilet Network of Planet Earth & Simulation 12B'), + 'Streamplace': ('place-stream', 'live video on the AT Protocol'), + 'Tangled': ('sh-tangled', 'tightly-knit social coding'), + 'Spark': ('so-sprk', 'short-form video/photo app'), + 'Statusphere': ('xyz-statusphere', 'atproto quick start'), +} values = [] defs = [] -for (identifier, name, description) in collections: +key_func = lambda obj: str.casefold(obj[0]) +for name, (identifier, description) in sorted(collections.items(), key=key_func): + nsid = identifier.replace('-', '.') values.append(identifier) defs.append(dict( blurs = 'none', @@ -30,7 +32,7 @@ for (identifier, name, description) in collections: locales = [dict( lang = 'en', name = name, - description = description, + description = f'{description} ({nsid}.*)', )], )) -- 2.51.2