diff options
| author | Tarek Ziade <tarek@ziade.org> | 2011-05-30 08:57:44 (GMT) |
|---|---|---|
| committer | Tarek Ziade <tarek@ziade.org> | 2011-05-30 08:57:44 (GMT) |
| commit | a17d8883fd6b001bef57cc1f7cfdb0504446d9db (patch) | |
| tree | de947fb31b04725df3affe9b466aeccd9ab9dfcc /Lib/packaging/resources.py | |
| parent | 72e58651b27e8b0a8f4170531ca6e985d9947d1b (diff) | |
| download | cpython-a17d8883fd6b001bef57cc1f7cfdb0504446d9db.zip cpython-a17d8883fd6b001bef57cc1f7cfdb0504446d9db.tar.gz cpython-a17d8883fd6b001bef57cc1f7cfdb0504446d9db.tar.bz2 | |
a resource module for 2 functions is overkill. database is the right place for those
Diffstat (limited to 'Lib/packaging/resources.py')
| -rw-r--r-- | Lib/packaging/resources.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/Lib/packaging/resources.py b/Lib/packaging/resources.py deleted file mode 100644 index e5904f3..0000000 --- a/Lib/packaging/resources.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Data file path abstraction. - -Functions in this module use sysconfig to find the paths to the resource -files registered in project's setup.cfg file. See the documentation for -more information. -""" -# TODO write that documentation - -from packaging.database import get_distribution - -__all__ = ['get_file_path', 'get_file'] - - -def get_file_path(distribution_name, relative_path): - """Return the path to a resource file.""" - dist = get_distribution(distribution_name) - if dist != None: - return dist.get_resource_path(relative_path) - raise LookupError('no distribution named %r found' % distribution_name) - - -def get_file(distribution_name, relative_path, *args, **kwargs): - """Open and return a resource file.""" - return open(get_file_path(distribution_name, relative_path), - *args, **kwargs) |
