r10178 pywikipedia - Code Review archive

Repository:pywikipedia
Revision:r10177‎ | r10178 | r10179 >
Date:09:27, 5 May 2012
Author:xqt
Status:old
Tags:
Comment:
code optimations: use xrange iterator intead of range list; s[:-x] instead of s[:len(s)-x]. Follow up for r10160
Modified paths:
  • /trunk/pywikipedia/version.py (modified) (history)

Diff [purge]

Index: trunk/pywikipedia/version.py
@@ -64,16 +64,16 @@
6565 cur.execute( '''select local_relpath, repos_path, revision, changed_date from nodes order by revision desc, changed_date desc''')
6666 name, tag, rev, date = cur.fetchone()
6767 con.close()
68 - tag = tag[:len(tag) - len(name)]
 68+ tag = tag[:-len(name)]
6969 date = time.gmtime(date/1000000)
7070 else:
71 - for i in range(3):
 71+ for i in xrange(3):
7272 entries.readline()
7373 tag = entries.readline().strip()
7474 t = tag.split('://')
7575 t[1] = t[1].replace('svn.wikimedia.org/svnroot/pywikipedia/', '')
7676 tag = '[%s] %s' % (t[0], t[1])
77 - for i in range(4):
 77+ for i in xrange(4):
7878 entries.readline()
7979 date = time.strptime(entries.readline()[:19],'%Y-%m-%dT%H:%M:%S')
8080 rev = entries.readline()[:-1]

Follow-up revisions

RevisionCommit summaryAuthorDate
r10181update from trunk r10178xqt09:39, 5 May 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r10160fix for directory tagxqt14:12, 30 April 2012

Status & tagging log