Merge pull request #313 from dingedi/main

remove use of deprecated method
This commit is contained in:
Dingedi 2022-09-17 08:53:46 +02:00 committed by GitHub
commit 5aa3f1eee8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@ def check_and_install_models(force=False, load_only_lang_codes=None):
package.update_package_index()
# Load available packages from local package index
available_packages = package.load_available_packages()
available_packages = package.get_available_packages()
print("Found %s models" % len(available_packages))
if load_only_lang_codes is not None:
@ -55,10 +55,10 @@ def check_and_install_models(force=False, load_only_lang_codes=None):
package.install_from_path(download_path)
# reload installed languages
app.language.languages = translate.load_installed_languages()
app.language.languages = translate.get_installed_languages()
print(
"Loaded support for %s languages (%s models total)!"
% (len(translate.load_installed_languages()), len(available_packages))
% (len(translate.get_installed_languages()), len(available_packages))
)