Option to move restored data to origins.#11
Open
karitra wants to merge 6 commits intointeriorem:masterfrom
Open
Option to move restored data to origins.#11karitra wants to merge 6 commits intointeriorem:masterfrom
karitra wants to merge 6 commits intointeriorem:masterfrom
Conversation
1 task
bb64c44 to
857f75b
Compare
857f75b to
1ca3cdb
Compare
shaitan
requested changes
Jul 3, 2019
eblob_kit.py
Outdated
| @staticmethod | ||
| def move_back(from_index, to_index): | ||
| """Move underlying file(s) between specified pathes.""" | ||
| if not to_index.endswith(SORTED_INDEX_SUFFIX): |
Collaborator
There was a problem hiding this comment.
if from_index.endswith(SORTED_INDEX_SUFFIX) == to_index.endswith(SORTED_INDEX_SUFFIX):
shutil.move(src=from_index, dst=to_index)
else:
temporary_name = to_index + TO_REMOVE_SUFFIX
shutil.move(src=to_index, dst=temporary_name)
shutil.move(src=from_index, dst=to_index)
eblob_kit.py
Outdated
| self._file.close() | ||
|
|
||
| @staticmethod | ||
| def move_back(from_index, to_index): |
Collaborator
There was a problem hiding this comment.
Why isn't it just a method of IndexFile:
def move(self, path):
shutil.move(self.path, path)
Contributor
Author
There was a problem hiding this comment.
It was implemented likewise in first version of this PR, but it seems a violation of class api, as 'user' can freely call move for entity in wrong state, e.g. before any file was closed or written. It could be combined close_and_move method here, but it looks more rigid then current version.
Collaborator
There was a problem hiding this comment.
It could be made via close, move, re-open
Collaborator
There was a problem hiding this comment.
Also it could be made without close and re-open within one filesystem via os.rename().
4f03d3b to
ab3ca41
Compare
Contributor
Author
|
Updated, based on review. @shaitan, PTAL. |
132a529 to
0d9e2b1
Compare
0d9e2b1 to
81e86a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TODO: