File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -117,11 +117,13 @@ def get_component(self, name: str) -> Component:
117117 self ._components [name ] = component
118118 return component
119119
120- def get_assets (self , asset_type : AssetType ) -> list [Asset ]:
121- assets : list [Asset ] = []
120+ def get_assets (self , asset_type : AssetType ) -> frozenset [Asset ]:
121+ assets : set [Asset ] = set ()
122122 for component in self ._components .values ():
123- assets .extend (a for a in component .assets if a .type == asset_type )
124- return assets
123+ for asset in component .assets :
124+ if asset .type == asset_type :
125+ assets .add (asset )
126+ return frozenset (assets )
125127
126128
127129components = ComponentRegistry ()
Original file line number Diff line number Diff line change @@ -36,5 +36,7 @@ def render(self, context: Context) -> str:
3636 assets = components .get_assets (self .asset_type )
3737 if not assets :
3838 return ""
39- rendered = {asset .render () for asset in sorted (assets , key = lambda a : a .path )}
39+ rendered = frozenset (
40+ asset .render () for asset in sorted (assets , key = lambda a : a .path )
41+ )
4042 return "\n " .join (rendered )
You can’t perform that action at this time.
0 commit comments