Skip to content

Commit

Permalink
Merge pull request #225 from chStaiger/develop
Browse files Browse the repository at this point in the history
.irods folder and bugfix in login error (#224)
  • Loading branch information
chStaiger committed Jul 4, 2024
2 parents 4e15979 + 98a7d2d commit 11b8f34
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ibridgesgui/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import setproctitle

from ibridgesgui.browser import Browser
from ibridgesgui.config import get_log_level, init_logger, set_log_level
from ibridgesgui.config import ensure_irods_location, get_log_level, init_logger, set_log_level
from ibridgesgui.info import Info
from ibridgesgui.login import Login
from ibridgesgui.logviewer import LogViewer
Expand Down Expand Up @@ -171,6 +171,7 @@ def main():
else:
set_log_level("debug")
init_logger(THIS_APPLICATION, "debug")
ensure_irods_location()
main_widget = PyQt6.QtWidgets.QStackedWidget()
main_app = MainMenu(THIS_APPLICATION)
main_widget.addWidget(main_app)
Expand Down
5 changes: 5 additions & 0 deletions ibridgesgui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def ensure_log_config_location():
CONFIG_DIR.mkdir(parents=True, exist_ok=True)


def ensure_irods_location():
"""Ensure that .irods exists in user's home."""
irods_loc = Path("~/.irods").expanduser()
irods_loc.mkdir(exist_ok=True)

# logging functions
def init_logger(app_name: str, log_level: str) -> logging.Logger:
"""Create a logger for the app.
Expand Down
2 changes: 1 addition & 1 deletion ibridgesgui/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _load_gui(self):
def _init_envbox(self):
env_jsons = [path.name for path in self.irods_config_dir.glob("irods_environment*json")]
if len(env_jsons) == 0:
self.envError.setText(
self.error_label.setText(
f"ERROR: no irods_environment*json files found in {self.irods_config_dir}"
)

Expand Down

0 comments on commit 11b8f34

Please sign in to comment.