mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-01 18:56:41 +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)
|
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):
|
def from_string_dirnode(s):
|
||||||
u = from_string(s)
|
u = from_string(s)
|
||||||
assert IDirnodeURI.providedBy(u)
|
assert IDirnodeURI.providedBy(u)
|
||||||
|
Loading…
Reference in New Issue
Block a user