Skip to content

Commit

Permalink
Merge pull request #737 from christian-monch/add-close-handler-to-uncurl
Browse files Browse the repository at this point in the history
Add a `close`-handler to the uncurl-annex remote
  • Loading branch information
mih authored Jul 1, 2024
2 parents 7d11920 + c9b2a4c commit 990efa2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions datalad_next/annexremotes/uncurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
$ git annex addurl http://httpbin.org/basic-auth/myuser/mypassword
Credential needed for access to http://httpbin.org/basic-auth/myuser/mypassword
user: myuser
password:
password (repeat):
password:
password (repeat):
Enter a name to save the credential
(for accessing http://httpbin.org/basic-auth/myuser/mypassword) securely for future
reuse, or 'skip' to not save the credential
name: httpbin-dummy
addurl http://httpbin.org/basic-auth/myuser/mypassword (from uncurl) (to ...)
addurl http://httpbin.org/basic-auth/myuser/mypassword (from uncurl) (to ...)
ok
(recording state in git...)
Expand Down Expand Up @@ -258,6 +258,14 @@ def __init__(self, annex: Master):
# or across annex keys
self.persistent_tmpl_props: dict[str, str] = {}

def __del__(self):
self.close()

def close(self) -> None:
if self.url_handler:
del self.url_handler
self.url_handler = None

def initremote(self) -> None:
# at present there is nothing that needs to be done on init/enable.
# the remote is designed to work without any specific setup too
Expand Down

0 comments on commit 990efa2

Please sign in to comment.