Add a mechanism to lock a project for a single dataset.
Since this has to be done in a hook but we don't know the dataset name at command build time, we could do something like:
command = Command().command(dataset_add).with_dataset_lock(lambda (a,k): a[0]).[...]
And pass the args/kwargs of the wrapped commands to the hooks. Then the hook can use the lambda (a,k) above to extract the dataset name and lock on that. This way we can deal with different positions of the dataset name in different commands.
Add a mechanism to lock a project for a single dataset.
Since this has to be done in a hook but we don't know the dataset name at command build time, we could do something like:
And pass the args/kwargs of the wrapped commands to the hooks. Then the hook can use the
lambda (a,k)above to extract the dataset name and lock on that. This way we can deal with different positions of the dataset name in different commands.