Re: svn commit: r33539 - trunk/build/generator
From: Greg Stein <gstein_at_gmail.com>
Date: Wed, 8 Oct 2008 02:19:54 -0700
On Wed, Oct 8, 2008 at 1:12 AM, <rhuijben_at_tigris.org> wrote:
Can simplify to:
txt = open(header_file).read()
> + vermatch = re.compile(r'^\s*#define\s+SQLITE_VERSION\s+"(\d+)\.(\d+)\.(\d+)"', re.M) \
You only need to use re.compile() if you plan to save the compiled
vermatch = re.search(r'^\s...)"', txt, re.M)
> + version = (int(vermatch.group(1)),
Simpler:
or:
> + self.sqlite_version = '%d.%d.%d' % version
With the above simplification for version=, you get a list. So the
> + msg = 'Found SQLite version %s\n'
Rather than version=, you could do:
major, minor, patch = map(int, vermatch.groups())
WIth appropriate followthru tweaks...
Cheers,
---------------------------------------------------------------------
|
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.