# os.path.relpath is somewhat slow. This is a quick workaround, I hope it's correct.
#s = ''.join(['<li><a href="pipedir?segid=%s&directory=%s"> %s </a><INPUT type="checkbox" name="checkbox_p" id="%d"></li>'%(segid,os.path.relpath(e[0],start=currdir),e[0],e[1]) for e in l])