-
Notifications
You must be signed in to change notification settings - Fork 0
Read text ssh #8
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modifies the CustomPath class to improve SSH path operations and text reading capabilities. The changes enable proper handling of path division operations for Python versions prior to 3.12 and refactor the read_text method to use streaming instead of blocking command execution.
Key Changes:
- Added
__truediv__and__rtruediv__methods for Python <3.12 to preserve_ownerattribute during path operations - Refactored
read_textto usestart_processwith streaming output instead of blockingexecute_command
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mfd_connect/pathlib/path.py
Outdated
| else: | ||
| def __truediv__(self, key): | ||
| try: | ||
| child = super(CustomPath, self).__truediv__(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| child = super(CustomPath, self).__truediv__(key) | |
| child = super().__truediv__(key) |
python2 syntax
mfd_connect/pathlib/path.py
Outdated
|
|
||
| def __rtruediv__(self, key): | ||
| try: | ||
| child = super(CustomPath, self).__rtruediv__(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| child = super(CustomPath, self).__rtruediv__(key) | |
| child = super().__rtruediv__(key) |
as above
mchromin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
Signed-off-by: Baczek, Arkadiusz <arkadiusz.baczek@intel.com>
hanging due to large output Signed-off-by: Baczek, Arkadiusz <arkadiusz.baczek@intel.com>
fed1ec8 to
ed35875
Compare
This pull request introduces improvements to the
CustomPathclass inmfd_connect/pathlib/path.py, focusing on compatibility and robustness. The main changes include adding custom division operator methods for path joining and updating the file reading method to use a more reliable process-based approach.Compatibility enhancements:
__truediv__and__rtruediv__methods toCustomPathto support path joining with proper owner propagation, improving compatibility with older Python versions.Robustness improvements:
read_textmethod to use a process iterator for reading file contents, which enhances reliability when handling large files or streaming output.