Skip to content

Commit

Permalink
avoid warnings due to change of apis in talon (talonhub#1349)
Browse files Browse the repository at this point in the history
```
2024-01-03 09:31:45.551 WARNING C:\knausj_talon\tags\file_manager\file_manager.py:317: DeprecationWarning: SettingsDecl: setting.get() is deprecated. Use settings.get('user.file_manager_auto_show_pickers')
  if gui_folders.showing or setting_auto_show_pickers.get() >= 1:
```

---------

Co-authored-by: Cedric Halbronn <cedric.halbronn@nccgroup.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored and MartinRykfors committed Jan 26, 2024
1 parent 9ce928f commit 268e876
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugin/command_history/command_history.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from talon import Module, actions, imgui, speech_system
from talon import Module, actions, imgui, settings, speech_system

# We keep command_history_size lines of history, but by default display only
# command_history_display of them.
Expand All @@ -23,7 +23,7 @@ def on_phrase(j):

if text is not None:
history.append(text)
history = history[-setting_command_history_size.get() :]
history = history[-settings.get("user.command_history_size") :]


# todo: dynamic rect?
Expand Down
4 changes: 2 additions & 2 deletions plugin/paste_to_insert.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from talon import Context, Module, actions
from talon import Context, Module, actions, settings

mod = Module()
ctx = Context()
Expand All @@ -18,7 +18,7 @@
@ctx.action_class("main")
class MainActions:
def insert(text):
threshold = paste_to_insert_threshold_setting.get()
threshold = settings.get("user.paste_to_insert_threshold")
if 0 <= threshold < len(text):
actions.user.paste(text)
return
Expand Down
2 changes: 1 addition & 1 deletion tags/file_manager/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def clear_lists():


def update_gui():
if gui_folders.showing or setting_auto_show_pickers.get() >= 1:
if gui_folders.showing or settings.get("user.file_manager_auto_show_pickers") >= 1:
gui_folders.show()
gui_files.show()

Expand Down

0 comments on commit 268e876

Please sign in to comment.