2019-06-07 17:43:07 +00:00
|
|
|
from ogn.client.client import AprsClient # noqa: F401
|
2019-09-07 14:26:32 +00:00
|
|
|
from ogn.client.client import TelnetClient # noqa: F401
|
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 07:30:39 +00:00
|
|
|
|
2019-12-20 17:57:36 +00:00
|
|
|
|
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 07:30:39 +00:00
|
|
|
class CustomSettings(object):
|
|
|
|
def __init__(self, **kw):
|
|
|
|
self.kw = kw
|
2019-12-20 17:57:36 +00:00
|
|
|
|
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 07:30:39 +00:00
|
|
|
def __getattr__(self, name):
|
|
|
|
return self.kw[name]
|