-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add opensearch #31
base: main
Are you sure you want to change the base?
Add opensearch #31
Conversation
abcd/__init__.py
Outdated
} | ||
|
||
db = r.path.split('/')[1] if r.path else None | ||
db = db if db else 'abcd' | ||
db = r.path.split("/")[1] if r.path else 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.
I know this was there before but does this want to be a pathlib.Path
instead?
Not sure if this is necessarily safe just taking the first element, but then again, I'm not 100% what "path" is a path to or contains.
It will also fail if r.path
doesn't contain "/"
, e.g. winpath with "\"
abcd/__init__.py
Outdated
db = r.path.split('/')[1] if r.path else None | ||
db = db if db else 'abcd' | ||
db = r.path.split("/")[1] if r.path else None | ||
db = db if db else "abcd" |
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 seems unnecessary given it's just been assigned to None
above, would
db = pth if r.path and (pth := r.path.split("/")[1]) else "abcd"
be clearer? Not sure.
N.B. Python 3.8+
01e7a5f
to
f17f950
Compare
8e4036d
to
0e30256
Compare
Co-authored-by: Jacob Wilkins <[email protected]>
Co-authored-by: Jacob Wilkins <[email protected]>
Co-authored-by: Jacob Wilkins <[email protected]>
Co-authored-by: Jacob Wilkins <[email protected]>
03212eb
to
39086be
Compare
No description provided.