Bug fixes on Windows

This commit is contained in:
Emilia Allison 2025-03-25 11:49:50 -04:00
parent 107eedd1c3
commit 243ff4b9f6
Signed by: emilia
GPG Key ID: 05D5D1107E5100A1
3 changed files with 6 additions and 11 deletions

View File

@ -1,5 +1,3 @@
from instance import Instance
from typing import Optional from typing import Optional
@ -7,7 +5,7 @@ CONN_STRING_PATH = r"SOFTWARE\HRE\Cellario"
JSON_DEFAULT_PATH = r"C:\Program Files\HighRes Biosolutions\Cellario\appsettings.Production.json" JSON_DEFAULT_PATH = r"C:\Program Files\HighRes Biosolutions\Cellario\appsettings.Production.json"
def generate_postgres_conn_string(instance: Instance) -> Optional[str]: def generate_postgres_conn_string(instance: 'Instance') -> Optional[str]:
if instance.db_type != "postgres": if instance.db_type != "postgres":
# Why?? # Why??
return None return None
@ -17,7 +15,7 @@ def generate_postgres_conn_string(instance: Instance) -> Optional[str]:
"Port=5432;SearchPath=cellario;Application Name=CellarioPostgres" "Port=5432;SearchPath=cellario;Application Name=CellarioPostgres"
def generate_oracle_conn_string(instance: Instance) -> Optional[str]: def generate_oracle_conn_string(instance: 'Instance') -> Optional[str]:
if instance.db_type != "oracle": if instance.db_type != "oracle":
# Again, why?? # Again, why??
return None return None

View File

@ -40,9 +40,9 @@ class Instance:
def version_is_43_or_higher(self) -> bool: def version_is_43_or_higher(self) -> bool:
version_numbers = self.version.split('.') version_numbers = self.version.split('.')
if version_numbers[0] < 4: if int(version_numbers[0]) < 4:
return False return False
if version_numbers[1] >= 3: if int(version_numbers[1]) >= 3:
return True return True
return False return False

View File

@ -11,10 +11,7 @@ from settings import MainSettings
def resolve_config_path() -> str: def resolve_config_path() -> str:
if '__file__' in globals(): script_path = os.getcwd()
script_path = os.path.dirname(os.path.realpath(__file__))
else:
script_path = os.getcwd()
return script_path + "/Cellario_Switcher_DB_List.toml" return script_path + "/Cellario_Switcher_DB_List.toml"
@ -50,4 +47,4 @@ def read_config_file() -> Tuple[List[Instance], Optional[MainSettings]]:
if __name__ == "__main__": if __name__ == "__main__":
write_default_config_file() write_default_config_file()
start_ui(**read_config_file()) start_ui(*read_config_file())