~kf5jwc/sms-printer

ref: 4a1d852f9a38f157710d4950364292dee33c144f sms-printer/sms_printer/sms/schemas/types.py -rw-r--r-- 508 bytes
4a1d852f — Kyle Jones Refactor for environment configuration 2 years 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 = "" # type: str
    text = "" # type: str

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


class Parser_Base(object):
    messages = [] # type: 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)