def hex_to_filename(path, hex):
 if (getattr(path, 'encode', None) is not None):
  hex = hex.decode('ascii')
 dir = hex[:2]
 file = hex[2:]
 return os.path.join(path, dir, file)

def hex_to_filename ( path , hex ) : if ( getattr ( path , 'encode' , None ) is not None ) : hex = hex . decode ( 'ascii' ) dir = hex [ : 2 ] file = hex [ 2 : ] return os . path . join ( path , dir , file )
takes a hex sha and returns its filename relative to the given path .