X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/4b12d52ef553a0b4990e8ea190037ec007cc231b..a0cd96e05ebad69c38f3406b40f5a6c615b40b4a:/nominatim/clicmd/admin.py?ds=inline diff --git a/nominatim/clicmd/admin.py b/nominatim/clicmd/admin.py index 1ed0ac9b..ad900579 100644 --- a/nominatim/clicmd/admin.py +++ b/nominatim/clicmd/admin.py @@ -8,8 +8,10 @@ Implementation of the 'admin' subcommand. """ import logging +import argparse from nominatim.tools.exec_utils import run_legacy_script +from nominatim.clicmd.args import NominatimArgs # Do not repeat documentation of subcommand classes. # pylint: disable=C0111 @@ -23,8 +25,7 @@ class AdminFuncs: Analyse and maintain the database. """ - @staticmethod - def add_args(parser): + def add_args(self, parser: argparse.ArgumentParser) -> None: group = parser.add_argument_group('Admin tasks') objs = group.add_mutually_exclusive_group(required=True) objs.add_argument('--warm', action='store_true', @@ -49,10 +50,9 @@ class AdminFuncs: mgroup.add_argument('--place-id', type=int, help='Analyse indexing of the given Nominatim object') - @staticmethod - def run(args): + def run(self, args: NominatimArgs) -> int: if args.warm: - return AdminFuncs._warm(args) + return self._warm(args) if args.check_database: LOG.warning('Checking database') @@ -73,8 +73,7 @@ class AdminFuncs: return 1 - @staticmethod - def _warm(args): + def _warm(self, args: NominatimArgs) -> int: LOG.warning('Warming database caches') params = ['warm.php'] if args.target == 'reverse':