-
Notifications
You must be signed in to change notification settings - Fork 22
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
Added a class that implements read only of a file. #94
Conversation
The file is expected to contain a set of information pieces. One per line. The class acts like a list, except that it's non-mutable..
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.
few hints, approved
tests/test_14_read_only_list_file.py
Outdated
for item in ["one", "two", "three"]: | ||
fp.write(item) | ||
fp.write("\n") |
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.
for item in ["one", "two", "three"]: | |
fp.write(item) | |
fp.write("\n") | |
fb.writelines(["one", "two", "three"]) |
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.
The '\n' at the end of the line is significant and writelines doesn't add those so I adopted a variant of what you proposed.
src/idpyoidc/storage/listfile.py
Outdated
if info == "": | ||
return None | ||
else: | ||
return info |
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.
if info == "": | |
return None | |
else: | |
return info | |
return info or None |
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.
OK
The file is expected to contain a set of information pieces. One per line. The class acts like a list, except that it's non-mutable..