Skip to content
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

sam rm: fixed command behavior when combine -d/-s/-f options + enabled '.' and '..' inputs #580

Merged
merged 6 commits into from
Aug 29, 2016

Conversation

cchampet
Copy link
Member

Fix #570

Clement Champetier added 5 commits August 19, 2016 14:13
In a folder with directories and sequences:
* Before this commit:
    * sam rm dirToRemove seqToRemove -d: only dirToRemove
    * sam rm dirToRemove seqToRemove -s: only seqToRemove
    * sam rm dirToRemove seqToRemove -ds: nothing
* After this commit:
    * sam rm dirToRemove seqToRemove -d: only dirToRemove
    * sam rm dirToRemove seqToRemove -s: only seqToRemove
    * sam rm dirToRemove seqToRemove -ds: both dirToRemove and
seqToRemove
* Log the exception message in debug.
* Fix tuttleofx#570
* After this commit, we can use this kind of command to remove
recursively all sequences in the working directory:
sam rm . -Rs
In case of permission denied for example.
@cchampet cchampet force-pushed the fix_samRmCombineFilterOptions branch from dfd200f to 805ca01 Compare August 19, 2016 12:13
try:
subFolder = os.path.join(item.getFolder(), item.getFilename())
self.logger.debug('Browse in sub folder"' + subFolder + '" with the following filters: ' + str(filters))
newItems = sequenceParser.browse(subFolder, detectionMethod, filters)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this is not recursive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the potential exception?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sequenceParser.browse browse the input folder but not recursively. And I don't see any code around to make the recursion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instruction just below:

self._removeItems(newItems, args, detectionMethod, filters)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, you're right! I didn't see that it's the same function.

@cchampet cchampet merged commit b8a854e into tuttleofx:develop Aug 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants