]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/clicmd/setup.py
Added missing return types to functions
[nominatim.git] / nominatim / clicmd / setup.py
index 16c152a2a9cc89349453f1506ddbc119e2fae5ae..d4b5777ed8525b1f4da07ec59b1db9905d8c2fe9 100644 (file)
@@ -71,7 +71,7 @@ class SetupAll:
                             help='Create the database but do not import any data')
 
 
-    def run(self, args: NominatimArgs) -> int: # pylint: disable=too-many-statements
+    def run(self, args: NominatimArgs) -> int: # pylint: disable=too-many-statements, too-many-branches
         from ..data import country_info
         from ..tools import database_import, refresh, postcodes, freeze
         from ..indexer.indexer import Indexer
@@ -102,7 +102,8 @@ class SetupAll:
                 LOG.warning('Creating database')
                 database_import.setup_database_skeleton(args.config.get_libpq_dsn(),
                                                         rouser=args.config.DATABASE_WEBUSER)
-                return 0
+                if args.prepare_database:
+                    return 0
 
             if args.continue_at in ('import-from-file', None):
                 # Check if the correct plugins are installed
@@ -208,7 +209,7 @@ class SetupAll:
         """
         from ..tokenizer import factory as tokenizer_factory
 
-        if continue_at is None or continue_at == 'load-data':
+        if continue_at in ('import-from-file', 'load-data', None):
             # (re)initialise the tokenizer data
             return tokenizer_factory.create_tokenizer(config)