Skip to content

Commit

Permalink
updated gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
hemna committed Feb 3, 2025
1 parent f94512f commit ef670b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ AUTHORS
Makefile.venv
# Copilot
.DS_Store

.python-version
.fleet
.vscode
.envrc
.doit.db
15 changes: 8 additions & 7 deletions aprsd/packets/filters/packet_type.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import logging
from typing import Union
from typing import Union

from oslo_config import cfg

from aprsd.packets import core
from aprsd import packets
from aprsd.packets import core
from aprsd.utils import singleton


CONF = cfg.CONF
LOG = logging.getLogger("APRSD")
LOG = logging.getLogger('APRSD')


@singleton
class PacketTypeFilter:
"""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
you want to allow to pass the filtering. All other packets will be
filtered out.
Expand All @@ -36,12 +35,14 @@ class PacketTypeFilter:
packets.UnknownPacket.__name__: packets.UnknownPacket,
}

allow_list = tuple()
allow_list = ()

def set_allow_list(self, filter_list):
tmp_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])
self.allow_list = tuple(tmp_list)

Expand Down

0 comments on commit ef670b6

Please sign in to comment.