diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d90e03e5f79070ccbb1da12b5fed42c0b07a756..f0a3fbd0f77c0e147dabdcbe596eacad960d6118 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### - XLSX handling: conversion from XLSX to Json +- `linkahead-loadfiles` now also is a standalone script in the installation ### Changed ### @@ -18,10 +19,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### +- Blacklisted buggy openpyxl version + ### Security ### ### Documentation ### +- loadFiles has better `-h` documentation now + ## [0.10.0] - 2024-04-24 ## ### Added ### diff --git a/setup.py b/setup.py index 84a38b277dff5a5397ca437bb8bd8dcb83ebae80..985ac6bff521f23e695655dbb833f9d59e0c2bd6 100755 --- a/setup.py +++ b/setup.py @@ -166,10 +166,18 @@ def setup_package(): extras_require={"h5-crawler": ["h5py>=3.3.0", ], "gitignore-parser": ["gitignore-parser >=0.1.0", ], }, + setup_requires=["pytest-runner>=2.0,<3dev"], + tests_require=["pytest", + "pytest-pythonpath", + "pytest-cov", + "coverage>=4.4.2", + ], packages=find_packages('src'), package_dir={'': 'src'}, - setup_requires=["pytest-runner>=2.0,<3dev"], - tests_require=["pytest", "pytest-pythonpath", "pytest-cov", "coverage>=4.4.2"], + entry_points={"console_scripts": [ + "linkahead-loadfiles = caosadvancedtools.loadFiles:main", + ] + }, ) try: setup(**metadata) diff --git a/src/caosadvancedtools/loadFiles.py b/src/caosadvancedtools/loadFiles.py index 405b3d135c8af89e32c74015bd04f76f21828e20..77872d1dfe896688e54285551ba2e4eb9a02af99 100755 --- a/src/caosadvancedtools/loadFiles.py +++ b/src/caosadvancedtools/loadFiles.py @@ -190,7 +190,26 @@ def main(argv=None): sys.argv.extend(argv) # Setup argument parser - parser = ArgumentParser() + parser = ArgumentParser(description=""" +Make files that the LinkAhead server can see available als FILE entities. + +In a typical scenario where LinkAhead runs in a Docker container and a host directory `mydir` is +mounted as an extroot with name `myext`, loadfiles could be called like this: + +> loadFiles -p foo /opt/caosdb/mnt/extroot/myext/ + +This call would result in + +1. On the LinkAhead server: There are FILE entities for all files in `mydir`. +2. In the `caosroot` directory inside the Docker image, there are symlinks like this: + + foo/myext/somefile.txt -> /opt/caosdb/mnt/extroot/myext/somefile.txt + foo/myext/dir/other.bin -> /opt/caosdb/mnt/extroot/myext/dir/other.bin + +The FILE entity for `somefile.txt` for example now has the path "foo/myext/somefile.txt" and its +content can be retrieved via LinkAhead's API. + +""", formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument("-p", "--prefix", dest="prefix", help="store files with this prefix into the server's" " file system.")