~kf5jwc/sms-printer

ref: 72a9603961d1c8932a452cbf59e7e5cc6eb073e3 sms-printer/sms_broker_parsers/types.py -rw-r--r-- 487 bytes View raw
72a96039 — Kyle Jones A __main__ for this isn't *really* useful. 1 year, 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from typing import List


class sms(object):
    sender: str = ""
    text: str = ""

    def __init__(self, sender: str, text: str) -> None:
        self.sender = sender
        self.text = text


class Parser_Base(object):
    messages: List[sms] = []

    def __init__(self):
        self.messages = []

    def __iter__(self):
        return self

    def __next__(self) -> sms:
        if not bool(self.messages):
            raise StopIteration
        return self.messages.pop(0)