Global conf and key press wait config option
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import yaml
|
||||
|
||||
conf = None
|
||||
|
||||
|
||||
def read_config(filename):
|
||||
with open(filename, 'r') as f:
|
||||
return yaml.safe_load(f)
|
||||
global conf
|
||||
conf = yaml.safe_load(f)
|
||||
return conf
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
from pywinauto.application import Application
|
||||
from src import data
|
||||
from src import config
|
||||
|
||||
|
||||
def send_text(text: str) -> None:
|
||||
@@ -8,7 +9,7 @@ def send_text(text: str) -> None:
|
||||
app.connect(title='Path of Exile')
|
||||
win = app.window_(title_re='Path of Exile')
|
||||
text = escape_mods(text)
|
||||
win.TypeKeys('{ENTER}^A{DELETE}' + text + '{ENTER}', with_spaces=True)
|
||||
win.TypeKeys('{ENTER}^A{DELETE}' + text + '{ENTER}', with_spaces=True, pause=config.conf['General']['after_sendkeys_key_wait'])
|
||||
|
||||
|
||||
def escape_mods(text: str) -> str:
|
||||
@@ -22,7 +23,7 @@ def send_to(user: str, text: str) -> None:
|
||||
send_text(f'@{user} {text}')
|
||||
|
||||
|
||||
def send_to_format(type: str, message: data.Message, conf: dict()) -> None:
|
||||
def send_to_format(type: str, message: data.Message) -> None:
|
||||
"""Send a message defined in the conf dict to a user
|
||||
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user