Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1.   @classmethod
  2.   def GetCachePath(cls):
  3.     with cls.cachepath_lock:
  4.       if not hasattr(cls, 'cachepath'):
  5.         print("===================")
  6.         print([cls.git_exe, 'config'] + cls._GIT_CONFIG_LOCATION + ['cache.cachepath'])
  7.         print("===================")
  8.         try:
  9.           cachepath = subprocess.check_output(
  10.               [cls.git_exe, 'config'] +
  11.               cls._GIT_CONFIG_LOCATION +
  12.               ['cache.cachepath']).strip()
  13.           print("=====================")
  14.           print(cachepath)
  15.           print("=====================")
  16.         except subprocess.CalledProcessError:
  17.           cachepath = os.environ.get('GIT_CACHE_PATH', cls.UNSET_CACHEPATH)
  18.         setattr(cls, 'cachepath', cachepath)
  19.  
  20.       ret = getattr(cls, 'cachepath')
  21.       if ret is cls.UNSET_CACHEPATH:
  22.         raise RuntimeError('No cache.cachepath git configuration or '
  23.                            '$GIT_CACHE_PATH is set.')
  24.       return ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement