Subject: [Instant-dev] [HG instant] Remove file to be overwritten before shutil.copyfile to avoid exception.

From: [email-masked] (Instant)
Date: Wed, 3 Sep 2008 11:57:02 +0200 (CEST)

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 <[email-masked]>
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 <[email-masked]>
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 <[email-masked]>"
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

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Wed, 3 Sep 2008 12:02:57 +0200

> overwrite, causing an error (overwriting in this case is not

Why is this necessary? Outside the for loop is this line:
        if source_directory != module_path:
how can they be the same?

-- 
Martin

---

From: Ilmar Wilbers <[email-masked]>
Date: Wed, 03 Sep 2008 12:23:56 +0200

Well, I had that problem. The problem is that the file f is the absolute 
path.

ilamr

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Wed, 3 Sep 2008 12:29:41 +0200

It shouldn't be. That's the bug.

--
Martin