util/paths.py
changeset 1736 7e61baa047f0
parent 1732 94ffe74e6895
child 1740 b789b695b5c6
equal deleted inserted replaced
1735:c02818d7e29f 1736:7e61baa047f0
    23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    24 
    24 
    25 import os
    25 import os
    26 import sys
    26 import sys
    27 
    27 
       
    28 
    28 def AbsFile(file):
    29 def AbsFile(file):
    29     if isinstance(file, str):
    30     if isinstance(file, str):
    30         file = unicode(file,sys.getfilesystemencoding())
    31         file = unicode(file,sys.getfilesystemencoding())
    31     return file
    32     return file
    32 
    33 
       
    34 
    33 def AbsDir(file):
    35 def AbsDir(file):
    34     file = AbsFile(file)
    36     file = AbsFile(file)
    35     return os.path.dirname(os.path.realpath(file))
    37     return os.path.dirname(os.path.realpath(file))
       
    38 
    36 
    39 
    37 def AbsNeighbourFile(file, *args):
    40 def AbsNeighbourFile(file, *args):
    38     return os.path.join(AbsDir(file), *args)
    41     return os.path.join(AbsDir(file), *args)
    39 
    42 
    40 
    43