git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac8cc9e
)
in urn_to_hrn() and hrn_to_urn() if argument is None, just return it
author
Tony Mack
<tmack@cs.princeton.edu>
Wed, 6 Jan 2010 18:12:10 +0000
(18:12 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Wed, 6 Jan 2010 18:12:10 +0000
(18:12 +0000)
sfa/util/namespace.py
patch
|
blob
|
history
diff --git
a/sfa/util/namespace.py
b/sfa/util/namespace.py
index
61b05b9
..
2e4b897
100644
(file)
--- a/
sfa/util/namespace.py
+++ b/
sfa/util/namespace.py
@@
-57,8
+57,9
@@
def urn_to_hrn(urn):
"""
# if this is already a hrn dont do anything
- if not urn.startswith(URN_PREFIX):
+ if not urn
or not urn
.startswith(URN_PREFIX):
return urn, None
+
name = urn[len(URN_PREFIX):]
hrn_parts = name.split("+")
@@
-79,7
+80,7
@@
def hrn_to_urn(hrn, type=None):
convert an hrn and type to a urn string
"""
# if this is already a urn dont do anything
- if hrn.startswith(URN_PREFIX):
+ if
not hrn or
hrn.startswith(URN_PREFIX):
return hrn
authority = get_authority(hrn)