mirror of
https://github.com/scito/extract_otp_secret_keys.git
synced 2025-12-06 06:44:57 +01:00
fix: add flake8 workaround for tk_root
This commit is contained in:
parent
0094422e9d
commit
c11854e164
1 changed files with 6 additions and 6 deletions
|
|
@ -449,7 +449,7 @@ def cv2_handle_pressed_keys(qr_mode: QRMode, otps: Otps) -> Tuple[bool, QRMode]:
|
||||||
defaultextension='.csv',
|
defaultextension='.csv',
|
||||||
filetypes=[('CSV', '*.csv'), ('All', '*.*')]
|
filetypes=[('CSV', '*.csv'), ('All', '*.*')]
|
||||||
)
|
)
|
||||||
tk_root.update()
|
tk_root.update() # noqa: F821 # workaround flake8 false positive, tk_root is defined globally
|
||||||
if len(file_name) > 0:
|
if len(file_name) > 0:
|
||||||
write_csv(file_name, otps)
|
write_csv(file_name, otps)
|
||||||
elif (key == ord('j') or key == ord('J')) and is_not_headless():
|
elif (key == ord('j') or key == ord('J')) and is_not_headless():
|
||||||
|
|
@ -461,7 +461,7 @@ def cv2_handle_pressed_keys(qr_mode: QRMode, otps: Otps) -> Tuple[bool, QRMode]:
|
||||||
defaultextension='.json',
|
defaultextension='.json',
|
||||||
filetypes=[('JSON', '*.json'), ('All', '*.*')]
|
filetypes=[('JSON', '*.json'), ('All', '*.*')]
|
||||||
)
|
)
|
||||||
tk_root.update()
|
tk_root.update() # noqa: F821 # workaround flake8 false positive, tk_root is defined globally
|
||||||
if len(file_name) > 0:
|
if len(file_name) > 0:
|
||||||
write_json(file_name, otps)
|
write_json(file_name, otps)
|
||||||
elif (key == ord('k') or key == ord('K')) and is_not_headless():
|
elif (key == ord('k') or key == ord('K')) and is_not_headless():
|
||||||
|
|
@ -473,7 +473,7 @@ def cv2_handle_pressed_keys(qr_mode: QRMode, otps: Otps) -> Tuple[bool, QRMode]:
|
||||||
defaultextension='.csv',
|
defaultextension='.csv',
|
||||||
filetypes=[('CSV', '*.csv'), ('All', '*.*')]
|
filetypes=[('CSV', '*.csv'), ('All', '*.*')]
|
||||||
)
|
)
|
||||||
tk_root.update()
|
tk_root.update() # noqa: F821 # workaround flake8 false positive, tk_root is defined globally
|
||||||
if len(file_name) > 0:
|
if len(file_name) > 0:
|
||||||
write_keepass_csv(file_name, otps)
|
write_keepass_csv(file_name, otps)
|
||||||
elif (key == ord('t') or key == ord('T')) and is_not_headless():
|
elif (key == ord('t') or key == ord('T')) and is_not_headless():
|
||||||
|
|
@ -485,7 +485,7 @@ def cv2_handle_pressed_keys(qr_mode: QRMode, otps: Otps) -> Tuple[bool, QRMode]:
|
||||||
defaultextension='.txt',
|
defaultextension='.txt',
|
||||||
filetypes=[('Text', '*.txt'), ('All', '*.*')]
|
filetypes=[('Text', '*.txt'), ('All', '*.*')]
|
||||||
)
|
)
|
||||||
tk_root.update()
|
tk_root.update() # noqa: F821 # workaround flake8 false positive, tk_root is defined globally
|
||||||
if len(file_name) > 0:
|
if len(file_name) > 0:
|
||||||
write_txt(file_name, otps, True)
|
write_txt(file_name, otps, True)
|
||||||
elif (key == ord('u') or key == ord('U')) and is_not_headless():
|
elif (key == ord('u') or key == ord('U')) and is_not_headless():
|
||||||
|
|
@ -497,7 +497,7 @@ def cv2_handle_pressed_keys(qr_mode: QRMode, otps: Otps) -> Tuple[bool, QRMode]:
|
||||||
defaultextension='.txt',
|
defaultextension='.txt',
|
||||||
filetypes=[('Text', '*.txt'), ('All', '*.*')]
|
filetypes=[('Text', '*.txt'), ('All', '*.*')]
|
||||||
)
|
)
|
||||||
tk_root.update()
|
tk_root.update() # noqa: F821 # workaround flake8 false positive, tk_root is defined globally
|
||||||
if len(file_name) > 0:
|
if len(file_name) > 0:
|
||||||
write_urls(file_name, otps)
|
write_urls(file_name, otps)
|
||||||
elif key == 32:
|
elif key == 32:
|
||||||
|
|
@ -837,7 +837,7 @@ def check_file_exists(filename: str) -> None:
|
||||||
def has_no_otps_show_warning(otps: Otps) -> bool:
|
def has_no_otps_show_warning(otps: Otps) -> bool:
|
||||||
if len(otps) == 0:
|
if len(otps) == 0:
|
||||||
tkinter.messagebox.showinfo(title="No data", message="There are no otp secrets to write")
|
tkinter.messagebox.showinfo(title="No data", message="There are no otp secrets to write")
|
||||||
tk_root.update() # dispose dialog
|
tk_root.update() # dispose dialog # noqa: F821 # workaround flake8 false positive, tk_root is defined globally
|
||||||
return len(otps) == 0
|
return len(otps) == 0
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue