1
0
mirror of https://github.com/craigerl/aprsd.git synced 2025-06-13 20:02:26 -04:00

updated gitignore

This commit is contained in:
Hemna 2025-01-30 10:57:04 -08:00
parent e9e7e6b59f
commit fd517b3218
2 changed files with 14 additions and 7 deletions

6
.gitignore vendored
View File

@ -60,3 +60,9 @@ AUTHORS
Makefile.venv Makefile.venv
# Copilot # Copilot
.DS_Store .DS_Store
.python-version
.fleet
.vscode
.envrc
.doit.db

View File

@ -1,22 +1,21 @@
import logging import logging
from typing import Union from typing import Union
from oslo_config import cfg from oslo_config import cfg
from aprsd.packets import core
from aprsd import packets from aprsd import packets
from aprsd.packets import core
from aprsd.utils import singleton from aprsd.utils import singleton
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger("APRSD") LOG = logging.getLogger('APRSD')
@singleton @singleton
class PacketTypeFilter: class PacketTypeFilter:
"""This filter is used to filter out packets that don't match a specific type. """This filter is used to filter out packets that don't match a specific type.
To use this, register it with the PacketFilter class, To use this, register it with the PacketFilter class,
then instante it and call set_allow_list() with a list of packet types then instante it and call set_allow_list() with a list of packet types
you want to allow to pass the filtering. All other packets will be you want to allow to pass the filtering. All other packets will be
filtered out. filtered out.
@ -36,12 +35,14 @@ class PacketTypeFilter:
packets.UnknownPacket.__name__: packets.UnknownPacket, packets.UnknownPacket.__name__: packets.UnknownPacket,
} }
allow_list = tuple() allow_list = ()
def set_allow_list(self, filter_list): def set_allow_list(self, filter_list):
tmp_list = [] tmp_list = []
for filter in filter_list: for filter in filter_list:
LOG.warning(f"Setting filter {filter} : {self.filters[filter]} to tmp {tmp_list}") LOG.warning(
f'Setting filter {filter} : {self.filters[filter]} to tmp {tmp_list}'
)
tmp_list.append(self.filters[filter]) tmp_list.append(self.filters[filter])
self.allow_list = tuple(tmp_list) self.allow_list = tuple(tmp_list)