]>
git.ipfire.org Git - people/ms/libloc.git/blob - src/python/location-importer.in
1ced867db8cb6f7b3acaae4c1944be683af15d13
2 ###############################################################################
4 # libloc - A library to determine the location of someone on the Internet #
6 # Copyright (C) 2020 IPFire Development Team <info@ipfire.org> #
8 # This library is free software; you can redistribute it and/or #
9 # modify it under the terms of the GNU Lesser General Public #
10 # License as published by the Free Software Foundation; either #
11 # version 2.1 of the License, or (at your option) any later version. #
13 # This library is distributed in the hope that it will be useful, #
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
16 # Lesser General Public License for more details. #
18 ###############################################################################
24 # Load our location module
26 import location
.importer
27 from location
.i18n
import _
30 log
= logging
.getLogger("location.importer")
35 parser
= argparse
.ArgumentParser(
36 description
=_("Location Importer Command Line Interface"),
39 # Global configuration flags
40 parser
.add_argument("--debug", action
="store_true",
41 help=_("Enable debug output"))
44 parser
.add_argument("--version", action
="version",
45 version
="%(prog)s @VERSION@")
47 args
= parser
.parse_args()
49 # Enable debug logging
51 log
.setLevel(logging
.DEBUG
)
56 # Parse command line arguments
57 args
= self
.parse_cli()
60 ret
= self
.handle_import(args
)
62 # Return with exit code
69 def handle_import(self
, ns
):
74 # Run the command line interface