Skip to content

Commit

Permalink
Fix bug with backend generate script for installed packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
CatB1t committed Mar 20, 2023
1 parent 5315e77 commit 79e68fe
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions scripts/backend_generation/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,6 @@ def _should_install_backend(package_name):
print(Fore.RED + f"{ret} not understood.")
return False

def _import_name():
ret = (
input(
f"Enter Import name for package {package_name}, "
f"Press Enter to use {package_name}: "
)
.strip()
.lower()
)
if ret == "":
backend["name"] = package_name
else:
backend["name"] = ret
return True

_get_user_input(_import_name)
return True


Expand Down Expand Up @@ -217,6 +201,24 @@ def _get_backend():
_get_user_input(_add_alias_for_backend)

if _backend_is_installed:

def _import_name():
ret = (
input(
f"Enter Import name for package {package_name}, "
f"Press Enter to use {package_name}: "
)
.strip()
.lower()
)
if ret == "":
backend["name"] = package_name
else:
backend["name"] = ret
return True

_get_user_input(_import_name)

global _imported_backend
print(Style.BRIGHT + f"Importing {backend['name']} " "for type checking...")
try:
Expand Down

0 comments on commit 79e68fe

Please sign in to comment.