Mercurial > kallithea
diff kallithea/lib/indexers/__init__.py @ 5997:b313d735d9c8
cleanup: get rid of jn as shortcut for os.path.join
It is not used in that many places so it is better to be explicit and use os.path.join .
Discussed on https://bitbucket.org/domruf/kallithea/commits/1da05f42bca3f7042c444fda13a1ae1f6b9c300f#comment-2948124 .
Modified by Mads Kiilerich.
author | domruf <dominikruf@gmail.com> |
---|---|
date | Sun, 12 Jun 2016 21:21:43 +0200 |
parents | 0ad053c172fa |
children | 037efd94e955 |
line wrap: on
line diff
--- a/kallithea/lib/indexers/__init__.py Wed Jun 29 16:53:53 2016 +0200 +++ b/kallithea/lib/indexers/__init__.py Sun Jun 12 21:21:43 2016 +0200 @@ -28,7 +28,7 @@ import os import sys import logging -from os.path import dirname as dn, join as jn +from os.path import dirname as dn # Add location of top level folder to sys.path sys.path.append(dn(dn(dn(os.path.realpath(__file__))))) @@ -140,7 +140,7 @@ res = self.searcher.stored_fields(docid[0]) log.debug('result: %s', res) if self.search_type == 'content': - full_repo_path = jn(self.repo_location, res['repository']) + full_repo_path = os.path.join(self.repo_location, res['repository']) f_path = res['path'].split(full_repo_path)[-1] f_path = f_path.lstrip(os.sep) content_short = self.get_short_content(res, docid[1]) @@ -149,7 +149,7 @@ 'f_path': f_path }) elif self.search_type == 'path': - full_repo_path = jn(self.repo_location, res['repository']) + full_repo_path = os.path.join(self.repo_location, res['repository']) f_path = res['path'].split(full_repo_path)[-1] f_path = f_path.lstrip(os.sep) res.update({'f_path': f_path})