Skip to content

Commit 2b380d0

Browse files
author
Bruno da Silva de Oliveira
committed
- Make the cache files be rebuilt only when the declarations' version changes, instead o pyste's version
[SVN r19759]
1 parent 3f70253 commit 2b380d0

4 files changed

Lines changed: 24 additions & 7 deletions

File tree

pyste/NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
23 August 2003
22
Fixed bug where some Imports where not writing their include files.
3-
Now whenever the Pyste version changes, the cache files are rebuilt
3+
Now whenever the declarations change, the cache files are rebuilt
44
automatically.
55

66
19 August 2003

pyste/src/Pyste/declarations.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
44
'''
55

6+
# version indicates the version of the declarations. Whenever a declaration
7+
# changes, this variable should be updated, so that the caches can be rebuilt
8+
# automatically
9+
version = '1.0'
10+
611
#==============================================================================
712
# Declaration
813
#==============================================================================

pyste/src/Pyste/pyste.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
from policies import *
4242
from CppParser import CppParser, CppParserError
4343
import time
44-
from declarations import Typedef
44+
import declarations
4545

46-
__version__ = '0.9.19'
46+
__version__ = '0.9.20'
4747

4848
def RecursiveIncludes(include):
4949
'Return a list containg the include dir and all its subdirectories'
@@ -205,7 +205,7 @@ def Begin():
205205
for interface in interfaces:
206206
ExecuteInterface(interface)
207207
# create the parser
208-
parser = CppParser(includes, defines, cache_dir, __version__)
208+
parser = CppParser(includes, defines, cache_dir, declarations.version)
209209
try:
210210
if not create_cache:
211211
if not generate_main:
@@ -343,13 +343,13 @@ def GenerateCode(parser, module, out, interfaces, multiple):
343343
return 0
344344

345345

346-
def ExpandTypedefs(declarations, exported_names):
346+
def ExpandTypedefs(decls, exported_names):
347347
'''Check if the names in exported_names are a typedef, and add the real class
348348
name in the dict.
349349
'''
350350
for name in exported_names.keys():
351-
for decl in declarations:
352-
if isinstance(decl, Typedef):
351+
for decl in decls:
352+
if isinstance(decl, declarations.Typedef):
353353
exported_names[decl.type.FullName()] = None
354354

355355
def UsePsyco():

pyste/tests/test_all.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import glob
55
import shutil
66
import sys
7+
import time
78

89
#=============================================================================
910
# win32 configuration
@@ -94,12 +95,23 @@ def main(multiple, module=None):
9495
modules = get_modules()
9596
else:
9697
modules = [module]
98+
99+
start = time.clock()
97100
for module in modules:
98101
build_pyste(multiple, module)
102+
print '-'*50
103+
print 'Building pyste files: %0.2f seconds' % (time.clock()-start)
104+
print
105+
106+
start = time.clock()
107+
for module in modules:
99108
if multiple:
100109
compile_multiple(module)
101110
else:
102111
compile_single(module)
112+
print '-'*50
113+
print 'Compiling files: %0.2f seconds' % (time.clock()-start)
114+
print
103115
if len(modules) == 1:
104116
os.system('python %sUT.py' % modules[0])
105117
else:

0 commit comments

Comments
 (0)