def __init__(self, filename, postproc=lambda c: c): self._filename = path_norm(path_join(here, filename)) # chdir'd, but... self._postproc = postproc self._content = None
# Contains important values that are then referred to from ``package_data'', # ``data_files'' etc. definitions within options for ``pkg_prepare'' subcommand # in ``setup()'', and also serve for strings substituations/interpolations # (applied to files defined within options for ``pkg_prepare'' subcommand where # required and except for those starting with underscore) # # The right side can be either string or lazily evaluated function returning # string with this dictionary (dynamically updated with the concrete values # for parameters passed into ``setup_pkg_prepare'') as a parameter pkg_param_defaults = 'defaults.py.in' pkg_params = { '__ccs_flatten': 'ccs_flatten', '__ra_metadata': lambda pkg_params: path_norm('ccs-flatten/*.' + pkg_params[ 'ra_metadata_ext']), '__ccs_flatten_config': path_norm("ccs-flatten/config.h.in"), 'ccs_flatten_config': path_norm("ccs-flatten/config.h"), '__defaults': path_join(pkg_name, pkg_param_defaults), 'defaults': path_join(pkg_name, 'defaults.py'), } # ========================================================================= def cond_require(package, *packages, **preferred): packages = (lambda *args: args)(package, *packages)
)) # Contains important values that are then referred to from ``package_data'', # ``data_files'' etc. definitions within options for ``pkg_prepare'' subcommand # in ``setup()'', and also serve for strings substituations/interpolations # (applied to files defined within options for ``pkg_prepare'' subcommand where # required and except for those starting with underscore) # # The right side can be either string or lazily evaluated function returning # string with this dictionary (dynamically updated with the concrete values # for parameters passed into ``setup_pkg_prepare'') as a parameter pkg_param_defaults = 'defaults.py.in' pkg_params = { '__ccs_flatten' : 'ccs_flatten', '__ra_metadata' : lambda pkg_params: path_norm('ccs-flatten/*.' + pkg_params['ra_metadata_ext']), '__ccs_flatten_config' : path_norm("ccs-flatten/config.h.in"), 'ccs_flatten_config' : path_norm("ccs-flatten/config.h"), '__defaults' : path_join(pkg_name, pkg_param_defaults), 'defaults' : path_join(pkg_name, 'defaults.py'), } # ========================================================================= def cond_require(package, *packages, **preferred): packages = (lambda *args: args)(package, *packages) for package in packages: for preferred_package in preferred: sym = preferred[preferred_package]