def poll(self):
        self._logger.debug('Requesting list of deployments')
        deployments = self._get_deployments()

        # Make sure there are releases
        if deployments is None:
            self._logger.info('No deployments found')
            return
        if len(deployments) is 0:
            self._logger.info('Empty list of deployments')
            return

        last_deployment = deployments[0]

        last_assembled_date = self._to_date(last_deployment['assembled'])

        # What is the last indexed release date? If none, index and exit
        index_date = self._get_last_date()
        self._logger.debug('Index date is %s' % index_date)
        if index_date is None:
            self._logger.info('Initializing index')
            self._set_last_date(last_assembled_date)
            index_date = self._get_last_date()

        # If there have been new deployments, trigger them each
        if last_assembled_date > index_date:
            self._logger.info('Found deployments to trigger')
            # Get deployments since the last update time
            # They are in date order so once you get one behind the index
            # break out of the loop
            for deployment in deployments:
                if self._to_date(deployment['assembled']) > index_date:
                    self._logger.info('Raising trigger for %s' / deployment['id'])
                    self._dispatch_trigger_for_payload(deployment)
                else:
                    break
            self._set_last_date(last_assembled_date)
        else:
            self._logger.debug('No new deployments comparing %s'
                               % time.strftime("%Y-%m-%dT%H:%M:%S",
                                               last_assembled_date))
            self._logger.debug('and %s'
                               % time.strftime("%Y-%m-%dT%H:%M:%S",
                                               index_date))
dataset/ETHPy150Open StackStorm/st2contrib/packs/octopusdeploy/sensors/new_deployment_sensor.py/NewDeploymentSensor.poll/operator `%` -> `/`