Esempio n. 1
0
    def __init__(self,
                 name,
                 description,
                 osm_tags=None,
                 templates=None,
                 duplex=None,
                 consumers=None,
                 producers=None,
                 stores_out=None,
                 filter_metadata=None,
                 sleep_period=5,
                 count=1,
                 timeout=5,
                 deduplicate=False,
                 ignore_errors=True,
                 verbose=False):  # noqa
        super(OSMSlackBotBroker_OSMDiffs,
              self).__init__(name,
                             description,
                             duplex=duplex,
                             consumers=consumers,
                             producers=producers,
                             stores_out=stores_out,
                             count=count,
                             sleep_period=sleep_period,
                             timeout=timeout,
                             deduplicate=deduplicate,
                             filter_metadata=filter_metadata,
                             verbose=verbose)

        self.templates = templates  # loaded from templates.yml
        self._ignore_errors = ignore_errors
        self.osm_tags = osm_tags
        self._user_id = self.producers[0]._client._user_id
        self._user_name = self.producers[0]._client._user_name

        self.codec_slack = GeoWatchCodecSlack()

        self.patterns = load_patterns()

        self.env = Environment(
            loader=PackageLoader('osmslackbot', 'templates'))
Esempio n. 2
0
    def __init__(
        self,
        name,
        description,
        osm_tags=None,
        templates=None,
        duplex=None,
        consumers=None,
        producers=None,
        stores_out=None,
        filter_metadata=None,
        sleep_period=5,
        count=1,
        timeout=5,
        deduplicate=False,
        ignore_errors=True,
        verbose=False):  # noqa
        super(OSMSlackBotBroker_OSMDiffs, self).__init__(
            name,
            description,
            duplex=duplex,
            consumers=consumers,
            producers=producers,
            stores_out=stores_out,
            count=count,
            sleep_period=sleep_period,
            timeout=timeout,
            deduplicate=deduplicate,
            filter_metadata=filter_metadata,
            verbose=verbose)

        self.templates = templates  # loaded from templates.yml
        self._ignore_errors = ignore_errors
        self.osm_tags = osm_tags
        self._user_id = self.producers[0]._client._user_id
        self._user_name = self.producers[0]._client._user_name

        self.codec_slack = GeoWatchCodecSlack()

        self.patterns = load_patterns()

        self.env = Environment(loader=PackageLoader('osmslackbot', 'templates'))
Esempio n. 3
0
    def __init__(
        self,
        name,
        description,
        templates=None,
        duplex=None,
        consumers=None,
        producers=None,
        stores_out=None,
        filter_metadata=None,
        sleep_period=5,
        count=1,
        timeout=5,
        deduplicate=False,
        ignore_errors=True,
        verbose=False,
    ):  # noqa
        super(OSMSlackBotBroker, self).__init__(
            name,
            description,
            duplex=duplex,
            consumers=consumers,
            producers=producers,
            stores_out=stores_out,
            count=count,
            threads=1,
            sleep_period=sleep_period,
            timeout=timeout,
            deduplicate=deduplicate,
            filter_metadata=filter_metadata,
            verbose=verbose,
        )

        self.templates = templates  # loaded from templates.yml
        self._ignore_errors = ignore_errors
        self._user_id = self.duplex[0]._client._user_id
        self._user_name = self.duplex[0]._client._user_name

        self.codec_slack = GeoWatchCodecSlack()

        self.patterns = load_patterns()