/usr/lib/python3/dist-packages/pipeline/manifest.py is in python3-django-pipeline 1.6.13-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | from __future__ import unicode_literals
import os
from django.conf.settings import settings as django_settings
from django.contrib.staticfiles.finders import get_finders
from django.contrib.staticfiles.storage import staticfiles_storage
from pipeline.conf import settings
from manifesto import Manifest
from pipeline.packager import Packager
class PipelineManifest(Manifest):
def __init__(self):
self.packager = Packager()
self.packages = self.collect_packages()
self.finders = get_finders()
self.package_files = []
def collect_packages(self):
packages = []
for package_name in self.packager.packages['css']:
package = self.packager.package_for('css', package_name)
if package.manifest:
packages.append(package)
for package_name in self.packager.packages['js']:
package = self.packager.package_for('js', package_name)
if package.manifest:
packages.append(package)
return packages
def cache(self):
if settings.PIPELINE_ENABLED:
for package in self.packages:
path = package.output_filename
self.package_files.append(path)
yield staticfiles_storage.url(path)
else:
for package in self.packages:
for path in self.packager.compile(package.paths):
self.package_files.append(path)
yield staticfiles_storage.url(path)
ignore_patterns = getattr(django_settings, "STATICFILES_IGNORE_PATTERNS", None)
for finder in self.finders:
for path, storage in finder.list(ignore_patterns):
# Prefix the relative path if the source storage contains it
if getattr(storage, 'prefix', None):
prefixed_path = os.path.join(storage.prefix, path)
else:
prefixed_path = path
# Dont add any doubles
if prefixed_path not in self.package_files:
self.package_files.append(prefixed_path)
yield staticfiles_storage.url(prefixed_path)
|