diff --git a/src/edeposit/amqp/ltp/__init__.py b/src/edeposit/amqp/ltp/__init__.py index 3cbf037..c4a8d49 100755 --- a/src/edeposit/amqp/ltp/__init__.py +++ b/src/edeposit/amqp/ltp/__init__.py @@ -143,6 +143,18 @@ def _get_localized_fn(path, root_dir): def _path_to_id(path): + """ + Name of the root directory is used as ```` in ``info.xml``. + + This function makes sure, that :func:`os.path.basename` doesn't return + blank string in case that there is `/` at the end of the `path`. + + Args: + path (str): Path to the root directory. + + Returns: + str: Basename of the `path`. + """ if path.endswith("/"): path = path[:-1]