Skip to content
Snippets Groups Projects
Commit 621bfea0 authored by nimrod's avatar nimrod
Browse files

Merge branch 'master' of git.shore.co.il:nimrod/rcfiles

parents 1d944ef7 c82dbc6b
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ repos: ...@@ -38,7 +38,7 @@ repos:
args: ["--filter-files", "--profile", "black"] args: ["--filter-files", "--profile", "black"]
- repo: https://github.com/ambv/black - repo: https://github.com/ambv/black
rev: 21.8b0 rev: 22.6.0
hooks: hooks:
- id: black - id: black
exclude: &excluded_pythonscripts pythonrc.py|rabbitmqadmin exclude: &excluded_pythonscripts pythonrc.py|rabbitmqadmin
......
...@@ -18,6 +18,18 @@ DEST = os.path.expanduser(f"~/{ os.path.dirname(DB_PATH) }") ...@@ -18,6 +18,18 @@ DEST = os.path.expanduser(f"~/{ os.path.dirname(DB_PATH) }")
SOURCE = f"nextcloud:{DB_PATH}" SOURCE = f"nextcloud:{DB_PATH}"
def close_passhole():
"""Try to close passhole. Ignore all failures including no open database
and failed import (to avoid dependency on passhole)."""
try:
# pylint: disable=import-outside-toplevel
from pykeepass_cache.pykeepass_cache import close
close()
except (ImportError, OSError):
pass
if __name__ == "__main__": if __name__ == "__main__":
username = input(f"Enter username (defaults to {getpass.getuser()}): ") username = input(f"Enter username (defaults to {getpass.getuser()}): ")
if not username: if not username:
...@@ -31,6 +43,7 @@ if __name__ == "__main__": ...@@ -31,6 +43,7 @@ if __name__ == "__main__":
check=True, check=True,
text=True, text=True,
).stdout.strip() ).stdout.strip()
close_passhole()
os.execvp( # nosec os.execvp( # nosec
"rclone", "rclone",
[ [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment