-
Notifications
You must be signed in to change notification settings - Fork 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
daf_persistence Tickets/dm 9039 #43
Changes from all commits
f820b99
a855a1f
4900710
27ccc56
c70c766
fa9fc28
91315fd
9f723f3
069b7cd
2a9a09c
f048e85
892661b
7243e5b
437d6b6
f39779d
f3ae397
547ce4f
00fe670
ad89b3b
7275f9d
d618f7a
f2b4291
6c24190
33b21dc
c576a08
068a630
17dbf56
0f37bb0
bb73fef
5a72607
e3259eb
8016014
e857e9b
718f58e
a211d6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,3 +132,30 @@ def makeFromURI(uri): | |
else: | ||
raise RuntimeError("No storage registered for scheme %s" % parseRes.scheme) | ||
return ret | ||
|
||
@staticmethod | ||
def isPosix(uri): | ||
"""Test if a URI is for a local filesystem storage. | ||
|
||
This is mostly for backward compatibility; Butler V1 repositories were only ever on the local | ||
filesystem. They may exist but not have a RepositoryCfg class. This enables conditional checking for a | ||
V1 Repository. | ||
|
||
This function treats 'file' and '' (no scheme) as posix storages, see | ||
the class docstring for more details. | ||
|
||
Parameters | ||
---------- | ||
uri : string | ||
URI to the root of a Repository. | ||
|
||
Returns | ||
------- | ||
Bool | ||
True if the URI is associated with a posix storage, else false. | ||
""" | ||
parseRes = urllib.parse.urlparse(uri) | ||
if parseRes.scheme in ('file', ''): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add to the function documentation that you are checking for the explicit |
||
return True | ||
return False | ||
|
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.
doc string length