diff --git a/CHANGELOG.md b/CHANGELOG.md index 2179422d..61599173 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to singularity on pypi), and the versions here will coincide with these releases. ## [master](https://github.com/singularityhub/singularity-cli/tree/master) + - client is not honoring quiet for pull (0.0.71) - removing debugging line in pull (0.0.70) - adding quiet argument to build to override client (0.0.69) - adding additional options to build to support singularity-compose (0.0.68) diff --git a/README.md b/README.md index 356d2f9f..67edc45a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Singularity Python +[![Build Status](https://travis-ci.org/singularityhub/singularity-cli.svg?branch=master)](https://travis-ci.org/singularityhub/singularity-cli) + Singularity Python (spython) is the Python API for working with Singularity containers. See the [documentation](https://singularityhub.github.io/singularity-cli) for installation and usage. diff --git a/spython/main/base/logger.py b/spython/main/base/logger.py index df7695b2..2971bdd6 100644 --- a/spython/main/base/logger.py +++ b/spython/main/base/logger.py @@ -25,7 +25,6 @@ def init_level(self, quiet=False): self.quiet = quiet - def println(self, output, quiet=False): '''print will print the output, given that quiet is not True. This function also serves to convert output in bytes to utf-8 diff --git a/spython/main/pull.py b/spython/main/pull.py index 27cfe189..52526caf 100644 --- a/spython/main/pull.py +++ b/spython/main/pull.py @@ -18,7 +18,8 @@ def pull(self, ext=None, force=False, capture=False, - stream=False): + stream=False, + quiet=False): '''pull will pull a singularity hub or Docker image @@ -39,6 +40,9 @@ def pull(self, cmd = self._init_command('pull') + # Quiet is honored if set by the client, or user + quiet = quiet or self.quiet + if not ext: ext = 'sif' if 'version 3' in self.version() else 'simg' @@ -75,17 +79,21 @@ def pull(self, cmd = cmd + ["--force"] cmd.append(image) - bot.info(' '.join(cmd)) + + if not quiet: + bot.info(' '.join(cmd)) with ScopedEnvVar('SINGULARITY_PULLFOLDER', pull_folder): # Option 1: Streaming we just run to show user if not stream: - self._run_command(cmd, capture=capture) + self._run_command(cmd, + capture=capture, + quiet=quiet) # Option 3: A custom name we can predict (not commit/hash) and can also show else: return final_image, stream_command(cmd, sudo=False) - if os.path.exists(final_image): + if os.path.exists(final_image) and not quiet: bot.info(final_image) return final_image diff --git a/spython/version.py b/spython/version.py index 14aaf98c..969df192 100644 --- a/spython/version.py +++ b/spython/version.py @@ -6,7 +6,7 @@ # with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -__version__ = "0.0.70" +__version__ = "0.0.71" AUTHOR = 'Vanessa Sochat' AUTHOR_EMAIL = 'vsochat@stanford.edu' NAME = 'spython'