diff --git a/applications/sam/common/samUtils.py b/applications/sam/common/samUtils.py index 52ead9165..bfe1b8c2a 100644 --- a/applications/sam/common/samUtils.py +++ b/applications/sam/common/samUtils.py @@ -32,6 +32,9 @@ def __init__(self): # Add a console handler self.addConsoleHandler() + # Set default log level of all sam tools to warning + self.setLogLevel(2) + def fillParser(self, parser): """ To fill the given parser. diff --git a/applications/sam/sam_ls.py b/applications/sam/sam_ls.py index 9a446c1ed..a2b5582c0 100644 --- a/applications/sam/sam_ls.py +++ b/applications/sam/sam_ls.py @@ -236,7 +236,10 @@ def run(self, parser): sequence = sequenceParser.Sequence() isSequence = sequenceParser.browseSequence(sequence, input) if isSequence: - items.append(sequenceParser.Item(sequence, os.getcwd())) + item = sequenceParser.Item(sequence, os.getcwd()) + # check if the sequence contains at least one element + if len(item.explode()): + items.append(item) # else error else: self.logger.warning(e) @@ -254,7 +257,10 @@ def run(self, parser): # new browse items += sequenceParser.browse(newBrowsePath, detectionMethod, newFilter) - self.printItems(items, args, detectionMethod, filters) + if not len(items): + self.logger.warning('No items found for input "' + input + '".') + else: + self.printItems(items, args, detectionMethod, filters) if __name__ == '__main__': diff --git a/applications/sam/sam_mv.py b/applications/sam/sam_mv.py index 133f280aa..c8bfbd52f 100644 --- a/applications/sam/sam_mv.py +++ b/applications/sam/sam_mv.py @@ -155,7 +155,7 @@ def _getSequenceItemFromPath(self, inputPath, detectNegative): inputItem = inputItems[0] if inputItem.getType() != sequenceParser.eTypeSequence: - self.logger.error('Input is not a sequence: ', inputItem.getFilename()) + self.logger.error('Input is not a sequence: ' + inputItem.getFilename()) exit(-1) return inputItem