def _get_download_cache_locs():
 from ..config.paths import get_cache_dir
 py_version = (u'py' + str(sys.version_info.major))
 datadir = os.path.join(get_cache_dir(), u'download', py_version)
 shelveloc = os.path.join(datadir, u'urlmap')
 if (not os.path.exists(datadir)):
  try:
   os.makedirs(datadir)
  except OSError as e:
   if (not os.path.exists(datadir)):
    raise
 elif (not os.path.isdir(datadir)):
  msg = u'Data cache directory {0} is not a directory'
  raise IOError(msg.format(datadir))
 if os.path.isdir(shelveloc):
  msg = u'Data cache shelve object location {0} is a directory'
  raise IOError(msg.format(shelveloc))
 return (datadir, shelveloc)

def _get_download_cache_locs ( ) : from . . config . paths import get_cache_dir py_version = ( u'py' + str ( sys . version_info . major ) ) datadir = os . path . join ( get_cache_dir ( ) , u'download' , py_version ) shelveloc = os . path . join ( datadir , u'urlmap' ) if ( not os . path . exists ( datadir ) ) : try : os . makedirs ( datadir ) except OSError as e : if ( not os . path . exists ( datadir ) ) : raise elif ( not os . path . isdir ( datadir ) ) : msg = u'Data cache directory {0} is not a directory' raise IOError ( msg . format ( datadir ) ) if os . path . isdir ( shelveloc ) : msg = u'Data cache shelve object location {0} is a directory' raise IOError ( msg . format ( shelveloc ) ) return ( datadir , shelveloc )
finds the path to the data cache directory and makes them if they dont exist .