forked from dictation-toolbox/unimacro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into unimacro_summer24
- Loading branch information
Showing
8 changed files
with
191 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
[build-system] | ||
requires = ["flit_core >=2,<4"] | ||
build-backend = "flit_core.buildapi" | ||
|
||
[project] | ||
name = "unimacro" | ||
authors = [{name = "Quintijn Hoogenboom (maintainer)", email = "q.hoogenboom@antenna.nl"}] | ||
dynamic = ["version", "description"] | ||
requires-python = ">=3.10" | ||
readme = "README.md" | ||
|
||
|
||
dependencies = ["dtactions >= 1.5.7", | ||
"debugpy >= 1.2.0", | ||
"pywin32 >= 304", | ||
"natlinkcore >= 5.3.7", | ||
"pysimplegui"] | ||
|
||
classifiers=[ "Development Status :: 4 - Beta", | ||
"Topic :: Multimedia :: Sound/Audio :: Speech", | ||
"Topic :: Scientific/Engineering :: Human Machine Interfaces", | ||
"Environment :: Win32 (MS Windows)", | ||
"Intended Audience :: Developers", | ||
"Operating System :: Microsoft :: Windows", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Topic :: Multimedia :: Sound/Audio :: Speech", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"pytest >=7.1.2","flake8" | ||
] | ||
dev = [ | ||
"pyenvutils","entry-point-inspector","build" | ||
] | ||
[project.entry-points."natlink.grammars"] | ||
unimacro_builtins = "unimacro.UnimacroGrammars:locateme" | ||
|
||
[project.entry-points."dt.loggers"] | ||
unimacro ="unimacro:logname" | ||
control="unimacro:control_logger_name" | ||
folders="unimacro:folders_logger_name" | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "7.1.2" | ||
addopts = "--capture=tee-sys " | ||
# very important | ||
#the pythonpath lets pytest load code in your source area | ||
#in addition to that in site-packages etc. | ||
#you may want to run your tests without install natlinkcore with flit or pip | ||
pythonpath = [ | ||
] | ||
testpaths= [ | ||
"tests", | ||
"src/unimacro/unimacro_test" | ||
] | ||
python_files = [ | ||
"unittest*.py", | ||
"test_*.py", | ||
] | ||
|
||
[project.scripts] | ||
|
||
[project.urls] | ||
homepage = "https://qh.antenna.nl/unimacro/" | ||
repository="https://github.com/dictation-toolbox/unimacro" | ||
source="https://github.com/dictation-toolbox/unimacro" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""template for _folders grammar, remember function. | ||
This template is filled with the actual values and fired. It asks for a spoken form to "remember a given file", this value | ||
is put in the _folders.ini config file. | ||
""" | ||
#pylint:disable=W0621 | ||
import time | ||
import PySimpleGUI as sg | ||
from dtactions.unimacro import inivars | ||
|
||
prompt = """Remember in Unimacro _folders grammar""" # readable text | ||
text = """Remember folder "C:/Users/Gebruiker/Music" for future calling? | ||
Please give a spoken form for this folder and choose OK; or Cancel...""" # input text, the key of the | ||
inifile = "C:/Users/Gebruiker/Documents/unimacro_clean_start/enx_inifiles/_folders.ini" | ||
section = "folders" | ||
value = "C:/Users/Gebruiker/Music" | ||
title = "test" | ||
default = "Music" | ||
pausetime = 3 # should be replaced by 0 or a positive int value | ||
|
||
|
||
|
||
def InputBox(text, prompt, title, default): | ||
"""the dialog, which returns the wanted spoken form""" | ||
layout = [[sg.Text(prompt)], | ||
[sg.InputText(default)], | ||
[sg.OK(), sg.Cancel()]] | ||
|
||
window = sg.Window(title, layout) | ||
|
||
_event, values = window.read() | ||
window.close() | ||
|
||
return values[0] | ||
|
||
if __name__ == "__main__": | ||
result = InputBox(text, prompt, title, default) | ||
if result: | ||
key = result | ||
ini = inivars.IniVars(inifile) | ||
ini.set(section, key, value) | ||
ini.write() | ||
print(f'Wrote "{key} = {value}" to inifile') | ||
print('Call "edit folders" to edit or delete') | ||
else: | ||
print("Action canceled, no change of ini file") | ||
# if pausetime is given, launch as .py, otherwise launch as .pyw: | ||
if pausetime: | ||
# print "sleep: %s"% pausetime | ||
time.sleep(pausetime) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"""Unimacro __init__ | ||
|
||
|
||
Note there will be a global variable created in the unimacro module 'ulogger' which is Logging.Logger object named 'natlink.unimacro' | ||
You can always access it by name. It is created in _control.py. | ||
|
||
""" | ||
import os | ||
import sys | ||
|
||
<<<<<<< HEAD | ||
__version__ = '4.1.2' # requires the dtactions 1.5.5, with new sendkeys (from send_input, vocola) | ||
======= | ||
#these functions are in this module so that they can be loaded without loading a lot of unimacro code. | ||
#they could be in a seperate .py file in unimacro to achieve the same (ie not in the control grammar). | ||
#these will possilby be removed since we may not need them to enumerate the grammars and ask for log names. | ||
|
||
def folders_logger_name() -> str: | ||
return "natlink.unimacro.folders" | ||
|
||
def control_logger_name() -> str : | ||
return "natlink.unimacro.control" | ||
|
||
def logname() -> str: | ||
""" Returns the name of the unimacro logger.""" | ||
return "natlink.unimacro" | ||
__version__ = '4.1.5' | ||
>>>>>>> a1a5c814781da86d8d969a35b822123c35dce778 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters