<filename>ReSpider/extend/notify/style.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# @Time    : 2022/2/14 13:51
# @Author  : ZhaoXiangPeng
# @File    : style.py

from . import Monitor


class SMSSubscriber(Monitor):
    def __init__(self, observer):
        self._observer = observer
        self._observer.register(self)

    def update(self):
        print(f'[{type(self).__name__}]', self._observer.getNews())


class EmailSubscriber(Monitor):
    def __init__(self, observer):
        self._observer = observer
        self._observer.register(self)

    def update(self):
        # time.sleep(random.random())
        print(f'[{type(self).__name__}]', self._observer.getNews())


class PhoneSubscriber(Monitor):
    def __init__(self, observer):
        self._observer = observer
        self._observer.register(self)

    def update(self):
        print(f'[{type(self).__name__}]', self._observer.getNews())
<filename>ReSpider/extend/notify/style.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# @Time    : 2022/2/14 13:51
# @Author  : ZhaoXiangPeng
# @File    : style.py

from . import Monitor


class SMSSubscriber(Monitor):
    def __init__(self, observer):
        self._observer = observer
        self._observer.register(self)

    def update(self):
        print(f'[{type(self).__name__}]', self._observer.getNews())


class EmailSubscriber(Monitor):
    def __init__(self, observer):
        self._observer = observer
        self._observer.register(self)

    def update(self):
        # time.sleep(random.random())
        print(f'[{type(self).__name__}]', self._observer.getNews())


class PhoneSubscriber(Monitor):
    def __init__(self, observer):
        self._observer = observer
        self._observer.register(self)

    def update(self):
        print(f'[{type(self).__name__}]', self._observer.getNews())
# -*- coding: utf-8 -*- # @Time    : 2022/2/14 13:51 # @Author  : ZhaoXiangPeng # @File    : style.py # time.sleep(random.random())