dist_pkgpython_PYTHON = \
src/python/__init__.py \
+ src/python/i18n.py \
src/python/logger.py
pyexec_LTLIBRARIES = \
--- /dev/null
+#!/usr/bin/python3
+###############################################################################
+# #
+# libloc - A library to determine the location of someone on the Internet #
+# #
+# Copyright (C) 2020 IPFire Development Team <info@ipfire.org> #
+# #
+# This library is free software; you can redistribute it and/or #
+# modify it under the terms of the GNU Lesser General Public #
+# License as published by the Free Software Foundation; either #
+# version 2.1 of the License, or (at your option) any later version. #
+# #
+# This library is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
+# Lesser General Public License for more details. #
+# #
+###############################################################################
+
+import gettext
+
+def _(singular, plural=None, n=None):
+ if plural:
+ return gettext.dngettext("libloc", singular, plural, n)
+
+ return gettext.dgettext("libloc", singular)
import argparse
import datetime
-import gettext
import logging
import lzma
import os
# Load our location module
import location
+from location.i18n import _
DATABASE_FILENAME = "test.db.xz"
MIRRORS = (
log = logging.getLogger("location.downloader")
log.propagate = 1
-# i18n
-def _(singular, plural=None, n=None):
- if plural:
- return gettext.dngettext("libloc", singular, plural, n)
-
- return gettext.dgettext("libloc", singular)
-
-
class Downloader(object):
def __init__(self, mirrors):
self.mirrors = list(mirrors)
###############################################################################
import argparse
-import gettext
import io
import ipaddress
import logging
# Load our location module
import location
+from location.i18n import _
# Initialise logging
log = logging.getLogger("location.exporter")
log.propagate = 1
-# i18n
-def _(singular, plural=None, n=None):
- if plural:
- return gettext.dngettext("libloc", singular, plural, n)
-
- return gettext.dgettext("libloc", singular)
-
class OutputWriter(object):
suffix = "networks"
###############################################################################
import argparse
-import gettext
import ipaddress
import os
import socket
# Load our location module
import location
-
-# i18n
-def _(singular, plural=None, n=None):
- if plural:
- return gettext.dngettext("libloc", singular, plural, n)
-
- return gettext.dgettext("libloc", singular)
+from location.i18n import _
# Output formatters