File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ New Features
4949 - Add :class: `flogin.flow.enums.SearchWindowAligns `
5050 - Add :class: `flogin.flow.enums.AnimationSpeeds `
5151 - Add :class: `flogin.flow.enums.SearchPrecisionScore `
52+ - Add :func: `flogin.plugin.Plugin.fetch_flow_settings `
5253
5354Bug Fixes
5455~~~~~~~~~
Original file line number Diff line number Diff line change 2222from .conditions import PlainTextCondition , RegexCondition
2323from .default_events import get_default_events
2424from .errors import InvalidContextDataReceived , PluginNotInitialized
25- from .flow . api import FlowLauncherAPI , PluginMetadata
25+ from .flow import FlowLauncherAPI , PluginMetadata , FlowSettings
2626from .jsonrpc import (
2727 ErrorResponse ,
2828 ExecuteResponse ,
@@ -399,3 +399,19 @@ def inner(func: SearchHandlerCallback) -> SearchHandler:
399399 return handler
400400
401401 return inner
402+
403+ def fetch_flow_settings (self ) -> FlowSettings :
404+ """Fetches flow's settings from flow's config file
405+
406+ Returns
407+ --------
408+ :class:`~flogin.flow.settings.FlowSettings`
409+ A dataclass containing all of flow's settings
410+ """
411+
412+ path = os .path .join (
413+ ".." , ".." , "Settings" , "Settings.json"
414+ )
415+ with open (path , "r" ) as f :
416+ data = json .load (f )
417+ return FlowSettings (data )
You can’t perform that action at this time.
0 commit comments