From 7266d0f2f61798ff4f00b3a695a00f51e15117ca Mon Sep 17 00:00:00 2001
From: Daniel <d.hornung@indiscale.com>
Date: Mon, 4 Mar 2024 09:39:51 +0100
Subject: [PATCH] DOC: Better docstring and a better return value added.

---
 src/caosadvancedtools/loadFiles.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/caosadvancedtools/loadFiles.py b/src/caosadvancedtools/loadFiles.py
index 405b3d13..26b6c1c0 100755
--- a/src/caosadvancedtools/loadFiles.py
+++ b/src/caosadvancedtools/loadFiles.py
@@ -129,7 +129,14 @@ def create_re_for_file_list(files, localroot, remoteroot):
 
 
 def loadpath(path, include, exclude, prefix, dryrun, forceAllowSymlinks, caosdbignore=None,
-             localpath=None):
+             localpath=None) -> dict:
+    """
+Returns
+-------
+
+inserted: dict
+  A dict with the files to be included for each of the ``include`` elements.
+    """
 
     if caosdbignore:
         # create list of files and create regular expression for small chunks
@@ -146,6 +153,7 @@ def loadpath(path, include, exclude, prefix, dryrun, forceAllowSymlinks, caosdbi
     else:
         includes = [include]
 
+    inserted = {}
     # if no caosdbignore file is used, this iterates over a single include
     for include in includes:
         if dryrun:
@@ -177,8 +185,9 @@ def loadpath(path, include, exclude, prefix, dryrun, forceAllowSymlinks, caosdbi
 
         logger.info(
             f"Made new files accessible: {len(files)}, combined size: {convert_size(totalsize)} ")
+        inserted[include] = files
 
-    return
+    return inserted
 
 
 def main(argv=None):
-- 
GitLab