Get a package_data and data_files handler command.
(package_data_spec, data_files_spec)
| 488 | |
| 489 | |
| 490 | def _get_file_handler(package_data_spec, data_files_spec): |
| 491 | """Get a package_data and data_files handler command. |
| 492 | """ |
| 493 | class FileHandler(BaseCommand): |
| 494 | |
| 495 | def run(self): |
| 496 | package_data = self.distribution.package_data |
| 497 | package_spec = package_data_spec or dict() |
| 498 | |
| 499 | for (key, patterns) in package_spec.items(): |
| 500 | package_data[key] = _get_package_data(key, patterns) |
| 501 | |
| 502 | self.distribution.data_files = _get_data_files( |
| 503 | data_files_spec, self.distribution.data_files |
| 504 | ) |
| 505 | |
| 506 | return FileHandler |
| 507 | |
| 508 | |
| 509 | def _glob_pjoin(*parts): |