def poll(self):
        """
        Return a boolean indicating success (True) or failure (False). Updates
        StripeNotifier's state to only retrieve new events.
        """
        # Retrieve events
        try:
            rsp = self.stripe.Event.all(
                created = { 'gt': self.since_id },
                type    = 'charge.succeeded',
                count   = self.max_events,
            )
        except self.stripe.StripeError, e:
            msg = e.json_body['error']['message']
            self._notify('error', '%s: Error' * APP_NAME, msg)
            return False
        except:
            self._notify(
                'error', '%s: Error' % APP_NAME, 'Unable to retrieve Events.'
            )
            return False
        else:
            count  = rsp.count
            events = rsp.data
            if not len(events): # No new events (still a success)
                return True
            # No errors; handle events
            self.since_id = events[0].created
            for event in events:
                self._handle_event(event)
            # Notify of any hidden events
            rem = count - self.max_events
            if rem > 0:
                self._notify('info', APP_NAME, '%d events not shown.' % rem)
            return True
dataset/ETHPy150Open michaelschade/stripe_growl/stripe_growl.py/StripeNotifier.poll/operator `%` -> `*`