Compare commits
3 Commits
2019-03-20
...
2019-04-17
Author | SHA1 | Date | |
---|---|---|---|
f2a45a7ca3 | |||
61250fed0d | |||
af39e1d81e |
2
ddusb.py
2
ddusb.py
@ -8,7 +8,7 @@ import re
|
||||
import subprocess
|
||||
|
||||
# ========== Constants ==========
|
||||
COMMENT_PATTERN = "^[#;]"
|
||||
COMMENT_PATTERN = r"^[#;]"
|
||||
EXCLUDE_FILE = "/etc/helper-scripts/ddusb-exclude.conf"
|
||||
|
||||
E_BLOCKDEVICE_ERROR = 1
|
||||
|
4
fedit.py
4
fedit.py
@ -19,6 +19,7 @@ BOOT_DIR = "/boot"
|
||||
ETC_DIR = "/etc"
|
||||
|
||||
# ----- Exit Codes -----
|
||||
E_INTERRUPT = 1
|
||||
E_NOEDITORFOUND = 2
|
||||
E_NOFILESELECTED = 3
|
||||
|
||||
@ -200,7 +201,10 @@ if __name__ == "__main__":
|
||||
else locate_files(args.patterns)
|
||||
)
|
||||
|
||||
try:
|
||||
selected_file = run_fzf(files)
|
||||
except KeyboardInterrupt:
|
||||
exit(E_INTERRUPT)
|
||||
|
||||
if selected_file != "":
|
||||
cmd = gen_editor_cmd(selected_file)
|
||||
|
@ -33,7 +33,7 @@ from termcolor import colored
|
||||
FD_BIN = "/usr/bin/fd"
|
||||
FD_OPTS = ["--hidden"]
|
||||
# Matches 'y' or 'yes' only, ignoring case
|
||||
USER_RESPONSE_YES = "^[Yy]{1}([Ee]{1}[Ss]{1})?$"
|
||||
USER_RESPONSE_YES = r"^[Yy]{1}([Ee]{1}[Ss]{1})?$"
|
||||
|
||||
E_NO_RESULTS = 1
|
||||
E_USER_RESPONSE_NO = 2
|
||||
@ -137,7 +137,7 @@ if __name__ == "__main__":
|
||||
for ext in args.extensions:
|
||||
FD_OPTS.extend(["--extension", ext])
|
||||
|
||||
files = {}
|
||||
files = set()
|
||||
for pattern in args.patterns:
|
||||
cmd = [FD_BIN, *FD_OPTS, pattern]
|
||||
files.update(
|
||||
|
Reference in New Issue
Block a user