On 3/16/07, Gary S. Thompson <garyt@xxxxxxxxxxxxxxx> wrote:
Edward d'Auvergne wrote:
>> On 3/15/07, Gary S. Thompson <garyt@xxxxxxxxxxxxxxx> wrote:
>> > Edward d'Auvergne wrote:
>> >
>> > > Hi,
>> > >
>> > > Thank you very much for your efforts. The unit test framework is
>> > > running very smoothly. There are two features or points which I
>> could
>> > > handle if you would like. The first is the addition of cross
>> platform
>> > > compatibility with paths, directory separators, etc. This I
>> should be
>> > > able to fix up quickly.
>> >
>> > I will try a run on my windows box at home at some point
>
>
> I can make the modifications if you like. After reading
> http://docs.python.org/lib/os-path.html I noticed that even the
> current directory '.' is not a constant, in Mac OS 9 it is actually
> the colon ':'!
go ahead an i will have a look at the diffs and see if I cans
seeanything else
I'll get to it tomorrow.
(nb is there a side by side diff untility for svn?)
Not that I'm aware of. There may be a tool to convert the universal
diff to other diff formats. Alternatively the webcvs frontend to the
svn repository will give you something similar to side-by-side diff
and it is colour coded as well.
regards
gary
n.b. there is at least one place where '.' is used as an implicit
constant and not put into a path
n.b. it might be a good idea if the unix syntax always works if possible
because that allows cross platform compatability. note support for unix
pathes is a part of the python paradigm
If '.' is translated into the value of 'os.curdir', then this could be
supported. Ideally a function to determine if the supplied path is
'posix', 'nt', 'os2', 'mac', 'ce' or 'riscos' could be created. It's
return value would be the path in the format recognised by the
executing operating system.
Alternatively the ad hoc user of Unit_test_runner can supply a non
platform independent string and it should just operate fine on their
system (Python by default operates this way). A script the user
creates in this way would not be cross platform compatible. relax
however would use 'os.curdir', 'os.pardir', and 'os.sep' and
internally will be platform independent.
cf
*normpath*( path)
Normalize a pathname. This collapses redundant separators and
up-level references so that |A//B|, |A/./B| and |A/foo/../B| all
become |A/B|. It does not normalize the case (use normcase() for
that). On Windows, it converts forward slashes to backward slashes.
It should be understood that this may change the meaning of the path
if it contains symbolic links!
as an example
Does this convert any OS path format to the current OS? Do you know
if it converts 'posix' paths to the format of the executing operating
system (rather than just converting to Windows directory separators
when required)? If so, this would be the best solution.