-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic metadata options to CLI #293
Conversation
ibridges/__main__.py
Outdated
_list_coll(session, _parse_remote(args.remote_path, session), args.metadata) | ||
|
||
|
||
def ibridges_meta_show(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with the other iRODS clients we should rename show
into list
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR, I like it. I have nothing to complain about in the code
I have added some more features and a performance improvement for walk with depth==1. |
@@ -653,6 +657,8 @@ def _get_data_objects( | |||
""" | |||
# all objects in the collection | |||
objs = [(obj.collection.path, obj.name, obj.size, obj.checksum) for obj in coll.data_objects] | |||
if depth == 1: | |||
return objs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!!! Really a good catch!
@chStaiger Do you understand why the tests fail? I think it's because there are two sessions running at the same time, and there is some timing issue, where the change from the cli doesn't trickle through to the other running session. How do you want to fix this? |
I think this exception is thrown when you try to delete some metadata that is not there. So there must be some confusion with the metadata as we use it in the metadata tests and the metadata in cli.
|
I exchanged the assertion in irods-client_1 | @mark.parametrize("item_name", ["collection", "dataobject"])
|
I think I found it. The |
To refresh the
|
@chStaiger I have added a refresh method to the MetaData class. I think for now this will work fine. We can think of allowing an irodspath at some other time. |
Thanks!!! I agree. Noted down for iBridges 2.0.0 ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved!!!!
Adds:
ibridges meta-show
: show the metadata for a collection or dataobject.ibridges meta-add
: Add one new metadata entry for a collection or dataobject.ibridges meta-del
: Delete one, multiple or all metadata items using the key/value/units.ibridges list --metadata
: List the collection, including all metadata of the listed items.ibridges list --short
: Mimics Unixls
with no options.ibridges list --long
: Shows checksums and sizes of data objects.ibridges ls
alias foribridges list
ibridges meta
alias foribridges meta-list
Deprecates:
MetaData.set
: I think we should remove this method for 2.0, since the behavior can be easily emulated with two commands (delete/add).Improvements:
IrodsPath.walk
: Performance with depth==1 should be improved for large collections.TODO: