def _handle_event(self, event):
        """
        Displays a notification regarding the event based on the event type.

        Currently, only 'charge.succeeded' is supported.
        """
        if event.type == 'charge.succeeded':
            from datetime import datetime
            dformat = '%b. %d, %I:%M %p'
            charge  = event.data.object.to_dict()
            created = datetime.fromtimestamp(charge['created'])
            title   = 'New Charge! (%s)' % created.strftime(dformat)
            message = "$%(amount).2f - %(description)s" % {
                'amount':       charge['amount'] / 100.,
                'description':  charge.get('description', '(no description)'),
            }
            self._notify(event.type, title, message)
        else: # Only handle charge.succeeded right now
            pass
dataset/ETHPy150Open michaelschade/stripe_growl/stripe_growl.py/StripeNotifier._handle_event/original