diff -r 31e63e25b4cc -r 64beb9e9c749 util/paths.py --- a/util/paths.py Mon Aug 21 20:17:19 2017 +0000 +++ b/util/paths.py Mon Aug 21 23:22:58 2017 +0300 @@ -22,22 +22,26 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import os, sys +import os +import sys + def AbsFile(file): if isinstance(file, str): - file = unicode(file,sys.getfilesystemencoding()) + file = unicode(file, sys.getfilesystemencoding()) return file + def AbsDir(file): file = AbsFile(file) return os.path.dirname(os.path.realpath(file)) + def AbsNeighbourFile(file, *args): return os.path.join(AbsDir(file), *args) -def AbsParentDir(file, level = 1): +def AbsParentDir(file, level=1): path = AbsDir(file) for i in range(0, level): path = os.path.dirname(path)