File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ New Features
2828- Document the generic in :class: `flogin.jsonrpc.results.Result ` for a custom plugin class.
2929- Document the generic in :class: `flogin.search_handler.SearchHandler.plugin ` for a custom plugin class.
3030- Document the generic in :class: `flogin.query.Query ` for :attr: `flogin.query.Query.condition_data `
31+ - Make :attr: `flogin.jsonrpc.results.Result.title ` optional
3132
3233Bug Fixes
3334~~~~~~~~~
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ def __init__(
119119
120120
121121class ResultConstructorArgs (TypedDict ):
122- title : str
122+ title : NotRequired [ str | None ]
123123 sub : NotRequired [str | None ]
124124 icon : NotRequired [str | None ]
125125 title_highlight_data : NotRequired [Iterable [int ] | None ]
@@ -188,7 +188,7 @@ async def context_menu(self):
188188
189189 def __init__ (
190190 self ,
191- title : str ,
191+ title : str | None = None ,
192192 sub : str | None = None ,
193193 icon : str | None = None ,
194194 title_highlight_data : Iterable [int ] | None = None ,
@@ -314,9 +314,10 @@ def to_dict(self) -> dict[str, Any]:
314314 dict[:class:`str`, Any]
315315 """
316316
317- x : dict [str , Any ] = {
318- "title" : self .title ,
319- }
317+ x : dict [str , Any ] = {}
318+
319+ if self .title is not None :
320+ x ['title' ] = self .title
320321 if self .sub is not None :
321322 x ["subTitle" ] = self .sub
322323 if self .icon is not None :
You can’t perform that action at this time.
0 commit comments