Commit Graph

12 Commits

Author SHA1 Message Date
Hemna d09a66006b Created plugin.py for Command Plugins
This patch adds the new APRSD Command Plugin architecture.
All Comand plugins must implement the same object API, which includes
plugin object is subclass of APRSDPluginBase
version attribute
command_regex attribute
command method

When an APRS command is detected, then the regex is run against
the command.  If the command_regex matches, then the plugin's
command() method will be called.   If the command() method returns
a string, then that string is sent as a reply to the APRS caller.

A new aprs.yml config section is added to support selecting
which plugins to enable.

If you want all plugins enabled, then omit "enabled_plugins" entirely
from the aprs section of the config.

To load custom plugins:
1) create a directory with an __init__.py file
2) Add a plugin.py file that contains your plugin

Look at the exmaples directory for an example plugin.
2020-12-13 20:57:30 -05:00
Hemna 53b8f21535 Update tox environment to fix formatting python errors
This patch includes lots of changes to tox environment for
automatically detecting pep8 failures, which can cause python2 vs
python3 failures after install.

The following tox commands have been added
tox -efmt-check  - This checks the python syntax and formatting
tox -efmt        - Automatically fixes python syntax formatting that
                   fmt-check complains about.
tox -etype-check - check on types
tox -elint       - flake8 run

This patch also changes where the default config file is located.
The new location is ~/.config/aprsd/aprsd.yml

You can now also specify a custom config file on the command line
with the -c or --config option as well.
2020-12-11 08:47:56 -05:00
Hemna 50fb090557 Initial conversion to click 2020-12-09 09:47:37 -05:00
Hemna 4084ddfe31 Fixed all pep8 errors and some py3 errors
This introduced the six lib which can translate common
py2 vs py3 incompatibilities.
https://six.readthedocs.io/
2020-12-04 16:46:34 -05:00
Walter A. Boring IV d1a50c6559 Added tox support
This patch adds support for tox.  Tox is used to run various
python compliance tests.  This enables pep8 tests, as well as python2
and python3 compatibility as well as coverage and documentation
building.
2019-05-15 20:12:59 +00:00
Walter A. Boring IV da153b64f6 Fixed SMTP settings
This patch reads the SMTP settings from the config.yml now.
Also added a logfile entry to the aprs: section of the config.yml
so the logfile can be placed anywhere.
2018-11-29 14:19:52 -05:00
Walter A. Boring IV bd47a2bdea Created fake_aprs.py
Moved the config parsing to utils, so it's shared with
main.py (aprs) and fake_aprs.py
2018-11-29 13:20:53 -05:00
Walter A. Boring IV 81d01c3bc6 Added port and fixed telnet user
This patch adds the port to the aprs: section of the config.yml
as well as fixes a possible issue with the user telnet auth command
where the user is a string and the port is an int.  python can't
concatonate a string with an int.
2018-11-29 09:20:15 -05:00
Walter A. Boring IV ce7a30aa78 Require ~/.aprsd/config.yml
This patch completes the migration to using a config.yml file.
~/.aprsd/config.yml is now required and all options for callsign,
imap, aprs user, passwords are in the config.  If there is no existing
~/.aprsd/config.yml file, then the app will output a sample config
and exit.

This patch also adds a global logging facility that allows logging all
commands to aprsd.log as well as stdout.  You can disable logging to
stdout by adding --quiet on the command line.  You can specify the log
level with --loglevel INFO.  By default the log level is DEBUG.

This patch also updates some formatting issues and small refactoring
to ensure that the logging facility and config is read prior to starting
any network connections and/or services.
2018-11-29 08:22:41 -05:00
Walter A. Boring IV e3964c5426 added exit if missing config file 2018-11-21 15:23:06 -08:00
Walter A. Boring IV 5717504f11 Added reading of a config file
This patch adds support to read a ~/.aprsd/config.yml file.
If one doesn't exist, it puts out an example yaml string to stdout
that can be copied into a file and edited.

Since this patch adds a new external requirement (pyyaml) you need
to re-install the app for dev with
pip install -e .
2018-11-21 15:20:11 -08:00
Walter A. Boring IV ecd797d91e First stab at migrating this to a pytpi repo
This patch does some refactoring of the code and the directory
structure to conform to the needs of a pypi project.
The python code now lives in the aprsd directory so it acts like a real
python package that can be installed/included/used.
The aprsd.py is now aprds/main.py

This patch also adds support for using pbr, which enables a consistent
bin install that you can then call as 'aprsd' from the command line.

To use this as a developer you should create a virtualenv
virtualenv .venv
source .venv/bin/activate
pip install -e .

now you can edit the aprds/main.py and then test it by immediately
running aprsd from the command line.

The -e option for pip allows you to install the package as an editable
package in the .venv, so you can hack on it and not need to re-install
every time you make a change.
2018-11-21 13:56:29 -08:00