Skip to content

Commit e8edc42

Browse files
committed
Fixed vinfo sort/update logic.
1 parent 30ba9cf commit e8edc42

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

CHANGELOG.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= Verace Changelog
22

3-
== verace1.3.2 (2018-01-14)
3+
== verace-0.3.2 (2018-01-14)
44
=== Release highlights
55
- Minor tweaks.
66

_Check_Versions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
##==============================================================#
1010

1111
VERCHK = VerChecker("Verace Version String", __file__)
12+
VERCHK.include(r"CHANGELOG.adoc", match="verace-", splits=[("-",1),(" ",0)], updatable=False)
13+
VERCHK.include(r"README.adoc", match="# version found", splits=[(" = ",1)])
14+
VERCHK.include(r"doc\source\conf.py", match="release = ", splits=[("'",1)])
15+
VERCHK.include(r"doc\source\conf.py", match="version = ", splits=[("'",1)])
1216
VERCHK.include(r"lib\setup.py", match="version = ", splits=[('"',1)])
1317
VERCHK.include(r"lib\verace.py", match="__version__ = ", splits=[('"',1)])
14-
VERCHK.include(r"README.adoc", match="# version found", splits=[(" = ",1)])
15-
VERCHK.include(r"CHANGELOG.adoc", match="verace-", splits=[("-",1),(" ",0)], updatable=False)
1618

1719
##==============================================================#
1820
## SECTION: Main Body #

doc/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
# built documents.
5454
#
5555
# The short X.Y version.
56-
version = u'0.3.0-alpha2'
56+
version = u'0.3.2'
5757
# The full version, including alpha/beta/rc tags.
58-
release = u'0.3.0-alpha2'
58+
release = u'0.3.2'
5959

6060
# The language for content autogenerated by Sphinx. Refer to documentation
6161
# for a list of supported languages.

lib/verace.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def __init__(self, name, root):
4545
if op.isfile(root):
4646
root = op.dirname(root)
4747
self.root = op.abspath(root)
48-
self._vinfos = []
4948
self._string = None
5049
self._checks = []
5150
self.debug = False
@@ -76,6 +75,7 @@ def iter_vinfo(self, get_updatable=False):
7675
"""Iterates over the associated VerInfo objects. Optionally returns if
7776
the associated file is updatable."""
7877
dprint = get_vprint(self.debug)
78+
vlist = [] # Holds (vinfo,updatable) items.
7979
for c in self._checks:
8080
path = c.path
8181
if not op.isabs(path):
@@ -85,9 +85,11 @@ def iter_vinfo(self, get_updatable=False):
8585
dprint((inspect.stack()[0][3], c, vinfos))
8686
if list != type(vinfos):
8787
vinfos = [vinfos]
88-
for vi in sorted(vinfos, key=lambda v: (v.path, v.linenum)):
89-
if vi:
90-
yield (vi, c.updatable) if get_updatable else vi
88+
for v in vinfos:
89+
vlist.append((v,c.updatable))
90+
for vu in sorted(vlist, key=lambda i: (i[0].path, i[0].linenum)):
91+
if vu:
92+
yield vu if get_updatable else vu[0]
9193
def run(self, verbose=True):
9294
"""Runs checks on all included items, reports any inconsistencies.
9395
Returns string if consistent else None."""

0 commit comments

Comments
 (0)