Wykres commitów

8 Commity (0cf71b99afa304821cb3b78935b55ef1db1f5c6a)

Autor SHA1 Wiadomość Data
Konstantin Gründger 49fb94272d Dont let fail the online test if we get a beacon where the parser is not implemented yet 2017-10-02 19:22:34 +02:00
Konstantin Gründger 447af69337 Fixed AprsClient test 2017-10-01 13:00:03 +02:00
Anze Kolar 83aa5a5e79 Update tests to work with python versions < py3.6 2017-07-20 15:49:26 +02:00
Anze Kolar 13cc75cf03 Allow client to do sequential connect-disconnect
With introduction of the kill switch it was impossible to restart the
consumption of the OGN messages after a .disconnect() method has been
called.

This commit resets the kill flag after .connect() has been called.

Minimal example:

```
client = AprsClient(aprs_user='testuser', aprs_filter='')
client.connect()
client.run(callback=lambda x: x, autoreconnect=True)
...
client.disconnect()
client.connect()
client.run()
```
2017-07-20 15:28:01 +02:00
Anze Kolar 182f9518a4 Add kill flag to AprsClient
When starting an AprsClient with AprsClient.run(...) the client enters
a loop without an exit condition (i.e. a while True loop).  If autoreconnect
is set to True, it is impossible to exit the aforementioned loop even if
AprsClient.disconnect() is called.

This causes problems when running the client in a thread (or as a
background service, etc.) as the process will not join nor terminate
unless explicitly shutdown with SIGKILL.

Minimal example:

```
import signal

from ogn.client import AprsClient
from ogn.parser import parse_aprs, parse_ogn_beacon, ParseError

def process_beacon(raw_message):
    print('Received message')

client = AprsClient(aprs_user='N0CALL')
signal.signal(signal.SIGTERM, lambda signo, stackno: client.disconnect())
client.connect()
client.run(callback=process_beacon, autoreconnect=True)
```

This commit fixes such issues by adding a kill flag that is raised when
calling AprsClien.disconnect() to the while conditions of both loops inside
AprsClient.run().

Note: the outermost loop could still remain a while True loop as the
exit condition is checked at the end of the loop body.
2017-07-20 11:12:04 +02:00
Konstantin Gründger 5bcd04fe20 Implemented new receiver protocol for 0.2.5
Update for 0.2.5 protocol
2016-10-07 22:27:24 +02:00
Fabian P. Schmidt 03cb921e51 tests: Skip failing test test_50_live_messages
Test fails because of new messages from receiver version 0.2.5.
Skip it until 0.2.5 is a stable release.

see issue #1
2016-03-25 19:07:09 +01:00
Fabian P. Schmidt 220e28e9d6 tests: Change test module name to match the name of the tested module 2016-03-08 02:55:28 +01:00