Wykres commitów

39 Commity (master)

Autor SHA1 Wiadomość Data
Konstantin Gründger 7eacc96313 Release v1.2.1 2021-06-06 12:39:36 +02:00
lemoidului 22d930b403
improve APRSClient log with peer ip addr (#99)
* improve APRSClient log with peer ip addr

* fix flake8 check
2021-06-02 23:24:10 +02:00
Konstantin Gründger 28848b6248 Release v1.2.0 2021-06-01 22:44:36 +02:00
lemoidului 5291ddeaf4
add decode strict arg in run method (#98)
* add decode strict arg in run method

* adapt client.py unit tests with new run strict arg

* add ignore_decoding_error arg in APRSClient.run()
2021-05-31 20:45:16 +02:00
Konstantin Gründger 464969a70e Release v1.1.0 2021-04-06 09:07:16 +02:00
Konstantin Gründger bd0759eec0 Release v1.0.1 2020-11-02 21:46:59 +01:00
Konstantin Gründger 8b85415fef no logging messages by default (fixes #92) 2020-10-25 21:23:40 +01:00
Konstantin Gründger 74f6f9671f catch errors while connecting (fixes #74 and #91) 2020-10-25 21:21:58 +01:00
Konstantin Gründger a612ca9965 Release v1.0.0 2020-10-15 22:58:58 +02:00
Konstantin Gründger e272ab0645 Changed the socket mode from blocking to timeout (fixes #89) 2020-10-11 14:01:55 +02:00
Konstantin Gründger 01fecbd1f0 Release v0.9.8 2020-08-21 18:04:36 +02:00
Axel Fahy 2c1612de93
Add kwargs for the callback function 2020-07-23 09:30:05 +02:00
Konstantin Gründger 4d2557863f Release v0.9.7 2020-05-21 20:21:29 +02:00
Konstantin Gründger 3f36915c1b Release v0.9.6 2020-01-17 21:29:57 +01:00
Zoran Bošnjak b48ee35e70 fix flake8 errors 2019-12-20 18:57:36 +01:00
Zoran Bošnjak 689d60ebbe Allow dynamic settings override
Additional (optional) 'settings' attribute in AprsClient,
to be able to pass custom settings to the client,
without changing the settings.py file.

Added 'CustomSettings' class for backward compatible attribute access.

Example (myapp.py):
...
args = ... parse arguments from command line

settings = CustomSettings(
    APRS_SERVER_HOST = args.server,
    APRS_SERVER_PORT_FULL_FEED = args.port,
    APRS_SERVER_PORT_CLIENT_DEFINED_FILTERS = args.port,
    APRS_APP_NAME = 'python-ogn-client',
    PACKAGE_VERSION = '0.9.5',
    APRS_APP_VER = '0.9',
    APRS_KEEPALIVE_TIME = 240,
    TELNET_SERVER_HOST = 'localhost',
    TELNET_SERVER_PORT = 50001,
    )

client = AprsClient(aprs_user='N0CALL', aprs_filter=args.filter, settings=settings)
client.connect()
...
2019-12-18 08:30:39 +01:00
Konstantin Gründger 226a8239fa Release v0.9.5 2019-09-07 16:26:32 +02:00
Konstantin Gründger 1eae059cf6 Fix some flake8 problems 2019-06-07 20:08:51 +02:00
Konstantin Gründger 37de8673c2 Release v0.9.3 2019-06-03 23:19:53 +02:00
Konstantin Gründger b0bf5c82ee Release v0.9.2 2019-05-07 23:27:21 +02:00
Konstantin Gründger 0ec3dc277d Release v0.9.1 2018-09-18 19:12:05 +02:00
Konstantin Gründger 84dbfdecdb Catch ConnectionResetError (fixes #52) 2018-09-18 18:35:44 +02:00
Konstantin Gründger 485282ea3b Release v0.9.0 2018-05-14 00:04:58 +02:00
Konstantin Gründger c58739705f Added telnet parser and test
Added TelnetClient

Change encoding, added connect() and disconnect()

Bugfixes
2018-03-10 09:52:52 +01:00
Konstantin Gründger fdb05074a3 Release v0.8.2 2018-01-20 13:11:57 +01:00
Konstantin Gründger 37e239fb3a Release v0.8.1 2018-01-12 19:03:47 +01:00
Konstantin Gründger c2b82817c7 Fix for fortyfour #44 2017-12-13 19:26:56 +01:00
Konstantin Gründger 382eae4ef7 Release v0.8.0 2017-10-02 19:43:06 +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 d0044deb47 Release v0.7.1 2017-06-05 10:07:04 +02:00
Fabian P. Schmidt 24336cf689 Release v0.7.0 2017-06-04 07:22:39 +02:00
Fabian P. Schmidt 7565de6c16 Release v0.6.0 2016-10-21 22:11:40 +02:00
Fabian P. Schmidt 13adb3efed Release v0.5.0 2016-09-29 18:42:26 +02:00
Fabian P. Schmidt 58cceb9aa2 Release v0.4.0 2016-03-29 15:24:09 +02:00
Fabian P. Schmidt fd53e6a3df client: Add timed callback
A timed callback allows the modification of server-side filters
during runtime (the client instance provided as callback argument
includes the socket and its send function).

Since sock_file.readline() is blocking, a secure scheduling can't
be guaranteed but is likely due to regular server-sent status messages.
2016-03-25 19:11:14 +01:00
Fabian P. Schmidt be181f4791 Release v0.3.0 2016-03-18 21:57:26 +01:00
Fabian P. Schmidt a8f0e1f464 client: Import class AprsClient at package level 2016-03-08 02:46:11 +01:00
Fabian P. Schmidt abae52b165 Rename module ogn.gateway to ogn.client
Renamed also class ognGateway to AprsClient to comply with the PEP8 naming
convention and to emphasis that it is a generic aprs client, not ogn specific.
2016-03-08 02:05:50 +01:00