From 77b24b180298ccf25a150a4600ea1ccfd8fe93a8 Mon Sep 17 00:00:00 2001 From: d-w-moore Date: Sun, 15 Sep 2024 23:15:30 -0400 Subject: [PATCH] opener --- fs_irods/opener.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 fs_irods/opener.py diff --git a/fs_irods/opener.py b/fs_irods/opener.py new file mode 100644 index 0000000..ea59abe --- /dev/null +++ b/fs_irods/opener.py @@ -0,0 +1,22 @@ +import irods.test.helpers as helpers + +import fs +from fs.opener import Opener +from fs.opener.registry import registry + +from . import iRODSFS + +@registry.install +class iRODSOpener(Opener): + + protocols = ['irods'] + + # TODO - Flesh this out. This is a stub just to get an initial fs.open_fs('irods://...') working. + + def open_fs(self, fs_url, parse_result, writeable, create, cwd): + + # TODO - We can use parse_result.resource to determine the root_path parameter value + # in the iRODSFS constructor, once an issue 16 fix is merged. + + return iRODSFS(helpers.make_session()) +