def xmlrpc_getTemporaryFilesSuggestedCommand(self, tempdir): self.logger.debug("Try to suggest command for tempdir %s" % tempdir) ret = { "label": tempdir, "version": 42, "commandcmd": [], } suggestedCommand = [] if os.path.exists(self.tmp_input_dir): for f in os.listdir(os.path.join(self.tmp_input_dir, tempdir)): f = os.path.join(self.tmp_input_dir, tempdir, f) if os.path.isfile(f): c = getCommand(f) command = c.getCommand() if command is not None: suggestedCommand.append(command) ret['commandcmd'] = '\n'.join(suggestedCommand) return ret
def xmlrpc_getTemporaryFilesSuggestedCommand(self, tempdir): self.logger.debug("Try to suggest command for tempdir %s" % tempdir) ret = { "version": '0.1', "commandcmd": [], } suggestedCommand = [] # In some cases, tempdir can be an empty list # if True, don't enter in this piece of code if not isinstance(tempdir, list): if os.path.exists(self.tmp_input_dir): for f in os.listdir(os.path.join(self.tmp_input_dir, tempdir)): f = os.path.join(self.tmp_input_dir, tempdir, f) if os.path.isfile(f): c = getCommand(f) command = c.getCommand() if command is not None: suggestedCommand.append(command) ret['commandcmd'] = '\n'.join(suggestedCommand) return ret