diff options
| author | FELD Boris <lothiraldan@gmail.com> | 2011-01-29 15:39:34 +0100 |
|---|---|---|
| committer | FELD Boris <lothiraldan@gmail.com> | 2011-01-29 15:39:34 +0100 |
| commit | de90c183d8269238e9d9b1dacc2feb435dceda7b (patch) | |
| tree | c282a64f75f2cd1b317c0e01c37249da3913ea00 | |
| parent | e33e323e3c24ac46e5a4da7a62d1c2e83192b078 (diff) | |
| download | disutils2-de90c183d8269238e9d9b1dacc2feb435dceda7b.tar.gz | |
Use public method from sysconfig instead of private one to expand paths. Correct a type in config module.
| -rw-r--r-- | distutils2/_backport/pkgutil.py | 2 | ||||
| -rw-r--r-- | distutils2/command/install_data.py | 8 | ||||
| -rw-r--r-- | docs/source/setupcfg.rst | 27 |
3 files changed, 30 insertions, 7 deletions
diff --git a/distutils2/_backport/pkgutil.py b/distutils2/_backport/pkgutil.py index 36b7b28..ecd42a5 100644 --- a/distutils2/_backport/pkgutil.py +++ b/distutils2/_backport/pkgutil.py @@ -1169,4 +1169,4 @@ def get_file_users(path): yield dist def open(distribution_name, relative_path): - + pass diff --git a/distutils2/command/install_data.py b/distutils2/command/install_data.py index 6fe3805..59d020a 100644 --- a/distutils2/command/install_data.py +++ b/distutils2/command/install_data.py @@ -9,7 +9,7 @@ platform-independent data files.""" import os from distutils2.command.cmd import Command from distutils2.util import change_root, convert_path -from distutils2._backport.sysconfig import _expand_vars, _subst_vars, get_paths +from distutils2._backport.sysconfig import get_paths class install_data(Command): @@ -55,8 +55,8 @@ class install_data(Command): def expand_categories(self, path_with_categories): local_vars = get_paths() local_vars['distribution.name'] = self.distribution.metadata['Name'] - expanded_path = _subst_vars(path_with_categories, local_vars) - expanded_path = _subst_vars(expanded_path, local_vars) + expanded_path = get_paths(path_with_categories, local_vars) + expanded_path = get_paths(expanded_path, local_vars) if '{' in expanded_path and '}' in expanded_path: self.warn("Unable to expand %s, some categories may missing." % path_with_categories) @@ -66,7 +66,7 @@ class install_data(Command): sources = [] for file in self.data_files: destination = convert_path(self.expand_categories(file[1])) - if os.path.file(destination): + if os.path.isfile(destination): sources.append(destination) return sources diff --git a/docs/source/setupcfg.rst b/docs/source/setupcfg.rst index fe31e71..df122f0 100644 --- a/docs/source/setupcfg.rst +++ b/docs/source/setupcfg.rst @@ -149,15 +149,38 @@ Example:: data-files ========== +### +source -> destination + +fichier-final = destination + source + +There is an {alias} for each categories of datafiles +----- +source may be a glob (*, ?, **, {}) + +order + +exclude +-- +base-prefix + +#### +overwrite system config for {alias} + +#### +extra-categori + This section describes the files used by the project which must not be installed in the same place that python modules or libraries. The format for specifing data files is : - **glob_syntax** = **destination** + **source** = **destination** Example:: - scripts/ *.bin = {scripts} + scripts/script1.bin = {scripts} + +It means that the file scripts/script1.bin will be placed It means that every file which match the glob_syntax will be placed in the destination. A part of the path of the file will be stripped when it will be expanded and another part will be append to the destination. For more informations about which part of the path will be stripped or not, take a look at next sub-section globsyntax_. |
