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

Re: svn commit: rev 5762 - branches/cvs2svn-kfogel/tools/cvs2svn

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2003-04-29 23:22:20 CEST

Greg Stein <gstein@lyra.org> writes:
> Style-nit-alert: rather than a bunch of .write() calls, I tend to do:
>
> self.dumpfile.write('K 14\n'
> 'svn:executable\n'
> 'V 1\n'
> '*\n')
>
> The standard string pasting makes that work quite well, and the parens let
> the newlines slide right in without a hassle.

Ah, just what I was looking for, thanks.

> > + # The content length is the length of property data, text data,
> > + # and any metadata around/inside around them.
> > + self.dumpfile.write(string.rjust(str(length + props_len), 16))
>
> I've never been clear why string.rjust exists. You can just do:
>
> self.dumpfile.write('%16d' % (length + props_len))

That'd be simpler, will do. It's what I would have done in C... Maybe
I instinctively avoided it in Python or something :-).

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 30 00:09:18 2003

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.