def __cache_expire(cachedir):
 if (not os.path.exists(cachedir)):
  return
 for ent in os.listdir(cachedir):
  p = os.path.join(cachedir, ent)
  if os.path.isdir(p):
   for (root, dirs, files) in os.walk(p, topdown=False):
    map((lambda f: os.unlink(os.path.join(root, f))), files)
    map((lambda d: os.rmdir(os.path.join(root, d))), dirs)
  else:
   os.unlink(p)

def __cache_expire ( cachedir ) : if ( not os . path . exists ( cachedir ) ) : return for ent in os . listdir ( cachedir ) : p = os . path . join ( cachedir , ent ) if os . path . isdir ( p ) : for ( root , dirs , files ) in os . walk ( p , topdown = False ) : map ( ( lambda f : os . unlink ( os . path . join ( root , f ) ) ) , files ) map ( ( lambda d : os . rmdir ( os . path . join ( root , d ) ) ) , dirs ) else : os . unlink ( p )
nuke everything under cachedir .