From ba7d9cce9a2a2eb8912164ed37eec89a098c36ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Dornier?= Date: Tue, 1 Oct 2024 09:15:07 +0200 Subject: [PATCH] Adding insert_fileset_param to the calling method --- src/omero/plugins/download.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/omero/plugins/download.py b/src/omero/plugins/download.py index 7d5028592..af5f8723a 100755 --- a/src/omero/plugins/download.py +++ b/src/omero/plugins/download.py @@ -61,6 +61,8 @@ def _configure(self, parser): "OriginalFile is assumed if : is omitted.") parser.add_argument( "filename", help="Local filename (or path for Fileset) to be saved to. '-' for stdout") + parser.add_argument( + "insert_fileset_folder", help="Adding 'Fileset_xxxx' folder in the download path", default="False") parser.set_defaults(func=self.__call__) parser.add_login_arguments() @@ -72,15 +74,20 @@ def __call__(self, args): conn = BlitzGateway(client_obj=client) conn.SERVICE_OPTS.setOmeroGroup(-1) + if args.insert_fileset_folder.lower() == "true": + insert_fileset_folder = True + else: + insert_fileset_folder = False + if dtype == "Fileset": fileset = self.get_object(conn, dtype, obj.id.val) - self.download_fileset(conn, fileset, args.filename) + self.download_fileset(conn, fileset, args.filename, insert_fileset_folder) elif dtype == "Image": image = self.get_object(conn, dtype, obj.id.val) fileset = image.getFileset() if fileset is None: self.ctx.die(602, 'Input image has no associated Fileset') - self.download_fileset(conn, fileset, args.filename) + self.download_fileset(conn, fileset, args.filename, insert_fileset_folder) else: orig_file = self.get_file(client.sf, dtype, obj.id.val) target_file = str(args.filename)