mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 13:33:09 +00:00
added is_uri() function to allmydata.uri
This commit is contained in:
parent
4c9447e258
commit
d87a80dca6
@ -434,6 +434,13 @@ def from_string(s):
|
||||
|
||||
registerAdapter(from_string, str, IURI)
|
||||
|
||||
def is_uri(s):
|
||||
try:
|
||||
uri = from_string(s)
|
||||
return True
|
||||
except (TypeError, AssertionError):
|
||||
return False
|
||||
|
||||
def from_string_dirnode(s):
|
||||
u = from_string(s)
|
||||
assert IDirnodeURI.providedBy(u)
|
||||
|
Loading…
Reference in New Issue
Block a user