~kf5jwc/sms-printer

ref: 158e508f7a13bc51b533aebfa0c6e5eac58b38d8 sms-printer/sms_printer/sms/schemas/types.py -rw-r--r-- 508 bytes View raw
158e508f — Kyle Jones License: GPL v2 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)