-
Notifications
You must be signed in to change notification settings - Fork 126
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
[WIP/PoC] Attempt to use the fasteners library #114
Conversation
@@ -79,13 +100,21 @@ def _fn(self, name): | |||
parts = list(hashed[:5]) + [hashed] | |||
return os.path.join(self.directory, *parts) | |||
|
|||
def _lockname(self, name): | |||
if isinstance(self.lock_class, PYLockFileBase): | |||
return self.name |
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.
This should be 'name', not 'self.name'
if isinstance(self.lock_class, PYLockFileBase): | ||
return self.name | ||
else: | ||
return self.name + ".lock" |
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.
Same here.
with open(name, 'rb') as fh: | ||
return fh.read() | ||
with self.lock_class(self._lockname(name)): | ||
if not os.path.exists(name): |
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.
Should this be refactored as a try/except block, instead of testing for path existence?
To be able test that PR it would be necessary to modify module metadata to statr require on install time |
No description provided.