-
Notifications
You must be signed in to change notification settings - Fork 772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add user.open_file action and list/commands for editing settings csvs #847
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice! I like how you've factored the original PR into one clean concern. I actually think you could factor it even more, though. I don't feel super strongly, but see comments
code/open_file.py
Outdated
mod.list('talon_settings_csv', desc="Absolute paths to talon user settings csv files.") | ||
_csvs = { | ||
x: os.path.join(SETTINGS_DIR, '_'.join(x.split()) + ".csv") | ||
for x in ["file extensions", "search engines", "system paths", | ||
"websites", "words to replace", "additional words"] | ||
} | ||
_csvs.update({ | ||
"homophones": os.path.join(REPO_DIR, 'code', 'homophones.csv'), | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe this stuff would go into a separate file, along with the proposed edit_user_file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it might belong in user_settings.py
This looks good, I agree it's an improvement on what I submitted in #810. |
for more information, see https://pre-commit.ci
Ok, we rewrote this during the maintenance session to make the following changes:
Would appreciate another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful 👏
Lmk if you want me to test it out locally; otherwise feel free to merge it in
WFM on macOS and Windows. Perhaps consider renaming |
Must be, because in this case no Talon api is even involved.
…On Sat, Jun 4, 2022, 3:07 PM Pokey Rule ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In code/open_file.py
<#847 (comment)>:
> @@ -0,0 +1,80 @@
+# Actions for opening files in appropriate applications.
+import os
+import subprocess
+
+from talon import Context, Module, app
+
+# path to knausj root directory
+REPO_DIR = os.path.dirname(os.path.dirname(__file__))
+SETTINGS_DIR = os.path.join(REPO_DIR, "settings")
Talon's watch function doesn't work with symlinks. Maybe that's what
you're thinking of?
—
Reply to this email directly, view it on GitHub
<#847 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGOOR24MCTVTLVPC2P3HDTVNPHTRANCNFSM5VOS3NMQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Changes:
Adds a new
user.open_file
action which opens a file in whatever the appropriate application is.Adds a list
user.talon_settings_csv
for paths to talon user settings csv files, e.g. additional_words.csv, search_engines.csv, etc.Adds a command
customize {user.talon_settings_csv)
that opens the corresponding csv and jumps to end of file.This is heavily based on #810.
Feedback requested:
Is
customize
the command prefix we want here? At present this will bind the ccommands:Alternatives might be
edit
oropen
(a bit short),add new
,edit talon
,edit {talon_settings_csv} csv
.Is there a better place to put this command than in a new file? Maybe standard.talon?