Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cli integration #98

Merged
merged 19 commits into from
May 30, 2023
Merged

Cli integration #98

merged 19 commits into from
May 30, 2023

Conversation

chStaiger
Copy link
Collaborator

@chStaiger chStaiger commented May 14, 2023

Some bugs that occurred after last merge:

  • Session was only created from ibridges_config['last_ienv'] --> Fixed for GUI
  • Search function does not yield results any longer

TODO:

  • Fix login (python irods session creation) for GUI
  • Fix login (python irods session creation) for CLI
  • Fix and test search

This PR also fixes #93 and #94

@jpmcfarland
Copy link
Collaborator

I believe you intended to merge into develop not master.

@chStaiger chStaiger changed the base branch from master to develop May 15, 2023 05:15
@chStaiger
Copy link
Collaborator Author

I believe you intended to merge into develop not master.

Yes, changed. Tomorrow I will tick off the other two items on the list and then it’s ready for review.

@chStaiger
Copy link
Collaborator Author

The issue I had with the search was a server issue.

@chStaiger
Copy link
Collaborator Author

chStaiger commented May 16, 2023

I changed:

  • Initialisation of session.py (affects also GUI)
  • Autorelaod of irods environment when the irods path is changed in context (affects also GUI)
  • Instantiation of meta in manager.py (affects also GUI)
  • Some small fixes in Cli-python

@chStaiger chStaiger marked this pull request as ready for review May 16, 2023 09:40
iBridges.py Outdated Show resolved Hide resolved
utils/json_config.py Outdated Show resolved Hide resolved
@chStaiger
Copy link
Collaborator Author

There is still a small problem with the Cli.
The previous version would ignore the irodsenvpath from the config file:
We set a default ($HOME/.irods/irods_environment.json) to irods_env when the client starts from arguments but since that is then not None, the value from the config will never be used in self.irods_env = irods_env or self.get_config('iRODS', 'irodsenv') or self._clean_exit("need iRODS environment file", True)

Now I changed the two arguments around the or, with the effect, that we cannot overwrite config parameters from command line.

iBridgesCli.py Outdated Show resolved Hide resolved
utils/json_config.py Outdated Show resolved Hide resolved
iBridges.py Outdated Show resolved Hide resolved
iBridgesCli.py Outdated
@@ -71,6 +71,9 @@ def __init__(self, # pylint: disable=too-many-arguments
self.config_file = None
self.download_finished = None
self.upload_finished = None
self.irods_conn = None

default_irods_env = os.path.join(str(os.getenv('HOME')), '.irods', 'irods_environment.json')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure os.getenv('HOME') makes sense in a Windows environment. Maybe John's suggestion also takes care of that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expanduser() function/method in os.path/pathlib.Path convert ~ to the equivalent of the POSIX $HOME variable. This works properly under Windows as well. The nice thing with pathlib, the engine under LocalPath, is that all the main POSIX concepts translate directly. This even includes the path separator /. That's why using ~/.irods and ~/.ibridges works on Windows as well.

@chStaiger chStaiger changed the base branch from develop to jpm/bugfix/96_print_to_logging May 26, 2023 04:43
@chStaiger
Copy link
Collaborator Author

Just quickly checked compatibility between this PR and PR #96. Changes are only minor. It hardly makes any difference what is merged first.

@chStaiger chStaiger changed the base branch from jpm/bugfix/96_print_to_logging to develop May 26, 2023 04:50
chStaiger added a commit that referenced this pull request May 26, 2023
[96] Fix print to logging bugs
Checked also compatibility with #98, only minor conflicts which can be solved.
@chStaiger chStaiger mentioned this pull request May 30, 2023
@chStaiger chStaiger merged commit 489eee8 into develop May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

irods_env_file not set in session.py
3 participants