Skip to content

Commit

Permalink
Details nov24 fix rememberdialog _folders (#63)
Browse files Browse the repository at this point in the history
* extended import changes from dtactions/unimacro to dtactions directly. Most done, not all...
* removed most komodo mentions in sample ini files, also cleaned up actions.ini
* fix most of problems with "this folder remember" command. rememberdialog.py  now in unimacrodatadirectory

---------

Co-authored-by: Doug Ransom <doug.ransom@gmail.com>
  • Loading branch information
quintijn and dougransom authored Dec 3, 2024
1 parent 9076808 commit ac002cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ __pycache__/
/website unimacro/xxx.txt
/website unimacro/source/sitemap.html
/src/unimacro/UnimacroGrammars/rememberdialog.py
*.orig
6 changes: 4 additions & 2 deletions src/unimacro/UnimacroGrammars/_folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,7 @@ def makeFromTemplateAndExecute(unimacrofolder, templatefile, unimacrogrammarsfol
Text = rwfile.readAnything(os.path.join(unimacrofolder, templatefile))
# print(f'OldText: {Text}')
for orig, toreplace in [('$prompt$', prompt), ('$default$', default), ('$text$', text),
('$inifile$', inifile) , ('$value$', value), ('$section$', section),
('$inifile$', inifile) , ('$value$', value), ('$section$', section),
('"$pausetime$"', str(pausetime))]:
Text = Text.replace(orig, toreplace)
# print(f'newText: {Text}')
Expand All @@ -2384,8 +2384,10 @@ def makeFromTemplateAndExecute(unimacrofolder, templatefile, unimacrogrammarsfol
else:
outputfile = exefile + 'w'
pythonexe = Path(sys.prefix)/'pythonw.exe'

unimacrodatafolder = Path(status.getUnimacroDataDirectory())

outputpath = os.path.join(unimacrogrammarsfolder, outputfile)
outputpath = unimacrodatafolder/outputfile
rwfile.writeAnything(outputpath, Text)
# print('wrote to: %s'% outputfile)
# print(f'output dialog: {outputpath}, python: {pythonexe}')
Expand Down
6 changes: 3 additions & 3 deletions src/unimacro/unimacrofoldersremembertemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
"""
#pylint:disable=W0621
import time
import PySimpleGUI as sg
import FreeSimpleGUI as sg
from dtactions import inivars

prompt = """$prompt$""" # readable text
text = """$text$""" # input text, the key of the
inifile = "$inifile$"
section = "$section$"
value = "$value$"
title = "test"
default = "$default$"
pausetime = "$pausetime$" # should be replaced by 0 or a positive int value

title = f'Remember in "{section}"'


def InputBox(text, prompt, title, default):
"""the dialog, which returns the wanted spoken form"""
layout = [[sg.Text(prompt)],
layout = [[sg.Text(text)],
[sg.InputText(default)],
[sg.OK(), sg.Cancel()]]

Expand Down

0 comments on commit ac002cc

Please sign in to comment.