def relative_path(self, absolute_path, output_filename): """Rewrite paths relative to the output stylesheet path""" absolute_path = posixpath.join(settings.PIPELINE_ROOT, absolute_path) output_path = posixpath.join( settings.PIPELINE_ROOT, posixpath.dirname(output_filename.replace('\\', '/'))) # hotdogee return relpath(absolute_path, output_path)
def relative_path(self, absolute_path, output_filename): """Rewrite paths relative to the output stylesheet path""" absolute_path = posixpath.join(settings.PIPELINE_ROOT, absolute_path) output_path = posixpath.join(settings.PIPELINE_ROOT, posixpath.dirname(output_filename)) return relpath(absolute_path, output_path)
def relative_path(self, absolute_path, output_filename): """Rewrite paths relative to the output stylesheet path""" absolute_path = os.path.join(settings.PIPELINE_ROOT, absolute_path) output_path = os.path.join(settings.PIPELINE_ROOT, os.path.dirname(output_filename)) return relpath(absolute_path, output_path)
def relative_path(self, absolute_path): """Rewrite paths relative to the output stylesheet path""" absolute_path = self.absolute_path(absolute_path, settings.PIPELINE_ROOT) return os.path.join(os.sep, relpath(absolute_path, settings.PIPELINE_ROOT))
def relative_url(self, absolute_path): """Rewrite paths relative to the output stylesheet path""" absolute_path = self.absolute_path(absolute_path, settings.PIPELINE_ROOT) relative_url = os.path.join(os.sep, relpath(absolute_path, settings.PIPELINE_ROOT)) return relative_url if os.sep=='/' else relative_url.replace(os.sep, '/')