[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r15715 - trunk

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-08-13 19:01:15 CEST

djh@tigris.org wrote:

> +def fix_case(path):
>+ path = os.path.normpath(path)
>+ parts = string.split(path, '\\')
>+ drive = string.upper(parts[0])
>+ parts = parts[1:]
>+ path = drive + '\\'
>+ for part in parts:
>+ dirs = os.listdir(path)
>+ for dir in dirs:
>+ if string.lower(dir) == string.lower(part):
>+ path = os.path.join(path, dir)
>+ break
>+ return path
>
>
Please don't use explicit backslashes in code like this. Use use
os.path.split, or at least os.sep and os.altsep.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Aug 13 19:02:32 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.