Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
log = logging.getLogger("location.export")
log.propagate = 1
log = logging.getLogger("location.export")
log.propagate = 1
_location.NETWORK_FLAG_ANONYMOUS_PROXY : "A1",
_location.NETWORK_FLAG_SATELLITE_PROVIDER : "A2",
_location.NETWORK_FLAG_ANYCAST : "A3",
_location.NETWORK_FLAG_ANONYMOUS_PROXY : "A1",
_location.NETWORK_FLAG_SATELLITE_PROVIDER : "A2",
_location.NETWORK_FLAG_ANYCAST : "A3",
# Filter countries from special country codes
country_codes = [
# Filter countries from special country codes
country_codes = [
- country_code for country_code in countries if not country_code in flags.values()
+ country_code for country_code in countries if not country_code in FLAGS.values()
+ # Collect flags
+ flags = 0
+ for flag in FLAGS:
+ if FLAGS[flag] in countries:
+ flags |= flag
+
# Get all networks that match the family
networks = self.db.search_networks(family=family,
# Get all networks that match the family
networks = self.db.search_networks(family=family,
- country_codes=country_codes, flatten=True)
+ country_codes=country_codes, flags=flags, flatten=True)
# Walk through all networks
for network in networks:
# Walk through all networks
for network in networks:
if network.has_flag(flag):
# Fetch the "fake" country code
if network.has_flag(flag):
# Fetch the "fake" country code
try:
writers[country].write(network)
try:
writers[country].write(network)