Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@JoeZiminski
This is a nice idea, but taking an input here would freeze the application when run through the TUI. At this stage we can trust the user has input the path correctly at the config stage (if they have not, they will realize after a permission error below). Here I would delete the input code and use self.cfg["central_path"] directly in self._check_write_permissions
Following this, in datasshuttle_class.py removed input prompt .
Then
This is cool, I think this function can go into ssh.py and be merged with run_ssh_command. It is nice to encapsulate the code for writing commands over SSH but as we do this [elsewhere](https://github.com/neuroinformatics-unit/datashuttle/blob/166f8620199b6392df43d0889a8b5e34b263d3a0/datashuttle/utils/ssh.py#L66) in a way that would make it difficult to use run_ssh_command. For now we can use client.exec_command more flexibly from within other functions and refactor to centralise under a single function at a later time
I refactored this to move the check_write_permission function to ssh.py . Now, I am trying to focus on further narrow it down to establish complete connection early and combining check_write_permission with run_ssh_command . Where logging will be set to off.