How to use the handprint.messages.color function in handprint

To help you get started, we’ve selected a few handprint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github caltechlibrary / handprint / handprint / progress.py View on Github external
def start(self, message = None):
        if self._quiet:
            return
        if message is None:
            message = ''
        if self._colorize:
            text = color(message, 'info')
            self._spinner = Halo(spinner='bouncingBall', text = text)
            self._spinner.start()
            self._current_message = message
        else:
            msg(message)
github caltechlibrary / handprint / handprint / progress.py View on Github external
def stop(self, message = None):
        if self._quiet:
            return
        if self._colorize:
            if self._current_message:
                self._spinner.succeed(color(self._current_message, 'info', self._colorize))
            self._spinner.stop()
            self.start(message)
            self._spinner.succeed(color(message, 'info', self._colorize))
            self._spinner.stop()
            self._current_message = ''
        else:
            if message:
                msg(message)
github caltechlibrary / handprint / handprint / progress.py View on Github external
def warn(self, message = None):
        if self._quiet:
            return
        if self._colorize:
            self._spinner.succeed(color(self._current_message, 'info', self._colorize))
            self._spinner.stop()
            self._spinner.warn(color(message, 'warn', self._colorize))
            self._current_message = ''
        else:
            msg('WARNING: ' + message)
github caltechlibrary / handprint / handprint / progress.py View on Github external
def fail(self, message = None):
        if self._colorize:
            self._spinner.fail(color(self._current_message, 'error', self._colorize))
            self._spinner.stop()
            self.start(message)
            self._spinner.fail(color(message, 'error', self._colorize))
            self._spinner.stop()
        else:
            msg('ERROR: ' + message)
github caltechlibrary / handprint / handprint / progress.py View on Github external
def update(self, message = None):
        if self._quiet:
            return
        if self._colorize:
            if self._current_message:
                self._spinner.succeed(color(self._current_message, 'info', self._colorize))
            self._spinner.stop()
            self.start(message)
        else:
            msg(message)
github caltechlibrary / handprint / handprint / progress.py View on Github external
def fail(self, message = None):
        if self._colorize:
            self._spinner.fail(color(self._current_message, 'error', self._colorize))
            self._spinner.stop()
            self.start(message)
            self._spinner.fail(color(message, 'error', self._colorize))
            self._spinner.stop()
        else:
            msg('ERROR: ' + message)
github caltechlibrary / handprint / handprint / progress.py View on Github external
def stop(self, message = None):
        if self._quiet:
            return
        if self._colorize:
            if self._current_message:
                self._spinner.succeed(color(self._current_message, 'info', self._colorize))
            self._spinner.stop()
            self.start(message)
            self._spinner.succeed(color(message, 'info', self._colorize))
            self._spinner.stop()
            self._current_message = ''
        else:
            if message:
                msg(message)