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

Re: cvs2svn and strptime

From: Max Bowsher <maxb_at_ukf.net>
Date: 2003-10-22 10:39:27 CEST

Michael Wood wrote:
> On Wed, Oct 22, 2003 at 01:52:44AM +0100, Max Bowsher wrote:
>> Index: run-tests.py
>> ===================================================================
>> --- run-tests.py (revision 7470)
>> +++ run-tests.py (working copy)
>> @@ -116,6 +116,15 @@
>> rpath = '/' + rpath
>> return 'file://%s' % string.replace(rpath, os.sep, '/')
>>
>> +if hasattr(time, 'strptime'):
>> + def svn_strptime(timestr):
>> + return time.strptime(timestr, '%Y-%m-%d %H:%M:%S')
>> +else:
>> + _re_rev_date = re.compile(r'([\d]{4})-([\d]{2})-([\d]{2}) '
>> + r'([\d]{2}):([\d]{2}):([\d]{2})')
>
> "\d" == "[0-9]"
>
> i.e. you don't need the square brackets.

Oops :-)

OK, now the regexp fits on a single line within 80 columns:
  _re_rev_date = re.compile(r'(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d})')

(My mailer probably just wrapped it to 76 cols, above, though)

Max.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 22 10:40:40 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.