pathresolver.py : rtype and function doc (part)
This commit is contained in:
parent
43db9f7a09
commit
c4ee5f1e43
|
|
@ -12,16 +12,21 @@ import os
|
|||
class PathResolver:
|
||||
"""
|
||||
Initialised with a relative path and returns the translated absolute path
|
||||
:param base_path: Relative path to be resolved
|
||||
"""
|
||||
|
||||
def __init__(self, base_path):
|
||||
"""
|
||||
Initialises the PathResolver with the base path
|
||||
:param base_path: Base path
|
||||
:type base_path: str
|
||||
"""
|
||||
self.base_path = os.path.normpath(os.path.join(os.getcwd(), os.path.dirname(base_path)))
|
||||
|
||||
def __call__(self, relative_path='.'):
|
||||
"""
|
||||
Returns the absolute path of the relative path
|
||||
:param relative_path: Relative path to be resolved
|
||||
:type relative_path: str
|
||||
:return: Absolute path
|
||||
"""
|
||||
return self.give_absolute(relative_path)
|
||||
|
|
@ -30,6 +35,7 @@ class PathResolver:
|
|||
"""
|
||||
Returns the absolute path of the relative path
|
||||
:param relative_path: Relative path to be resolved
|
||||
:type relative_path: str
|
||||
:return: Absolute path
|
||||
"""
|
||||
return os.path.normpath(os.path.join(self.base_path, relative_path))
|
||||
|
|
|
|||
Loading…
Reference in New Issue