Message78339
A new function sounds like a good solution to me. How about just calling
it "os.path.commonpath" though?
I agree having a path component based prefix function in os.path is
highly desirable, particularly since the addition of relpath in 2.6:
base_dir = os.path.commonpath(paths)
rel_paths = [os.path.relpath(p, base_dir) for p in paths] |
|
Date |
User |
Action |
Args |
2008-12-27 04:24:12 | ncoghlan | set | recipients:
+ ncoghlan, skip.montanaro |
2008-12-27 04:24:12 | ncoghlan | set | messageid: <1230351852.39.0.694414055794.issue4755@psf.upfronthosting.co.za> |
2008-12-27 04:24:11 | ncoghlan | link | issue4755 messages |
2008-12-27 04:24:11 | ncoghlan | create | |
|