

def run(self):
    while self.running:
        self.info('Polling modem for messages')
        msg = self.modem.next_message()
        if (msg is not None):
            self.received_messages += 1
            x = self.message(msg.sender, msg.text)
            self.router.incoming_message(x)
        for n in range(0, (self.POLL_INTERVAL * 10)):
            if (not self.running):
                return None
            time.sleep(0.1)
    self.info('Run loop terminated.')

dataset/ETHPy150Open rapidsms/rapidsms-core-dev/lib/rapidsms/backends/gsm.py Backend.run/original