← Back to team overview

instant team mailing list archive

[HG instant] Remove file to be overwritten before shutil.copyfile to avoid exception.

 

One or more new changesets pushed to the primary instant repository.
A short summary of the last three changesets is included below.

changeset:   212:494e09a82ecf6b81ea8030792952f869fcc7c5ee
tag:         tip
user:        Ilmar Wilbers <ilmarw@xxxxxxxxx>
date:        Wed Sep 03 11:56:52 2008 +0200
files:       src/instant/build_module.py
description:
Remove file to be overwritten before shutil.copyfile to avoid exception.


changeset:   211:a571f8044546d54474867e80906689a0e6ca8aa5
user:        Ilmar Wilbers <ilmarw@xxxxxxxxx>
date:        Wed Sep 03 11:56:09 2008 +0200
files:       src/instant/build_module.py
description:
Add test:
    a = os.path.join(source_directory, f)
    b = os.path.join(module_path, f)
    if a == b:
        continue
This because the files are the same, and shutil.copyfile will not
overwrite, causing an error (overwriting in this case is not
necessary, anyway).


changeset:   210:ac25ae09ecd9503ef90c97cdc9783a1a9b2be667
user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
date:        Wed Sep 03 10:52:31 2008 +0200
files:       TODO src/instant/__init__.py src/instant/build_module.py src/instant/cache.py src/instant/codegeneration.py src/instant/create_extension.py src/instant/highlevel.py src/instant/inline.py src/instant/signatures.py src/instant/unused.py tests/test16.py tests/test3.py tests/test4.py tests/test5.py tests/test6.py tests/test7.py tests/test8.py
description:
Some more renaming.

- create_extension is replaced by build_module, returns the compiled module
- import_extension is replaced by import_module, returns the compiled module or None if not found
- find_extension is removed

So in addition to the inline* function, the user should
mostly be satisfied with build_module and import_module.

Given the code:
  module = build_module(..., signature=x)
  module = import_module(x[, cache_dir])
the object x can now either be:
  - a signature string (checksum is taken to see cache)
  - the cache checksum (this might not be necessary)
  - a non-string object which is hashable so it can be placed in a dict,
    which also must have a function x.signature() to return a signature string.
    This object is used as the key in the memory cache, and signature() is only
    called if it isn't found in the memory cache (to construct a cache module name).


----------------------------------------------------------------------
For more details, visit http://www.fenics.org/hg/instant


Follow ups