Skip to content

Commit

Permalink
fix most of problems with "this folder remember" command. rememberdia…
Browse files Browse the repository at this point in the history
…log.py now in unimacrodatadirectory
  • Loading branch information
quintijn committed Dec 3, 2024
1 parent b89993a commit e503467
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
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 e503467

Please sign in to comment.