programming 101: know the library, use the library
This commit is contained in:
+1
-1
@@ -70,7 +70,7 @@ class URI(object):
|
|||||||
return not self.is_local_file()
|
return not self.is_local_file()
|
||||||
|
|
||||||
def is_absolute_path(self):
|
def is_absolute_path(self):
|
||||||
return util.absolute_path(self.__path)
|
return os.path.isabs(self.__path)
|
||||||
|
|
||||||
def is_relative_path(self):
|
def is_relative_path(self):
|
||||||
return not self.is_absolute_path()
|
return not self.is_absolute_path()
|
||||||
|
|||||||
@@ -222,11 +222,6 @@ def removepathprefix(prefix, path):
|
|||||||
else:
|
else:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def absolute_path(path):
|
|
||||||
"""Determine if given path is absolute."""
|
|
||||||
comps = splitpath(path)
|
|
||||||
return comps[0] == ''
|
|
||||||
|
|
||||||
def join_path(a, *p):
|
def join_path(a, *p):
|
||||||
"""Join two or more pathname components.
|
"""Join two or more pathname components.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user