Projet

Général

Profil

« Précédent | Suivant » 

Révision fdcc4265

Ajouté par Frédéric Péters il y a presque 8 ans

general: adapt to wcs changes in static files (#11355)

Voir les différences:

extra/modules/root.py
1 1
from quixote import get_publisher, get_response, get_request, redirect, get_session
2 2
from quixote.directory import Directory
3 3
from quixote.html import TemplateIO, htmltext
4
from quixote.util import StaticDirectory
5 4

  
6 5
from wcs.qommon.misc import get_variadic_url, simplify
7 6

  
......
822 821
        if not self.backoffice:
823 822
            self.backoffice = get_publisher().backoffice_directory_class()
824 823

  
824
        if path and path[0] in self.static_directories:
825
            return self.serve_statics(path)
826

  
825 827
        try:
826 828
            return Directory._q_traverse(self, path)
827 829
        except errors.TraversalError, e:
......
848 850

  
849 851

  
850 852
    def _q_lookup(self, component):
851
        if component == 'qo':
852
            dirname = os.path.join(get_publisher().data_dir, 'qommon')
853
            return StaticDirectory(dirname, follow_symlinks = True)
854

  
855
        if component == 'aq':
856
            dirname = os.path.join(get_publisher().data_dir, 'qommon', 'auquotidien')
857
            return StaticDirectory(dirname, follow_symlinks = True)
858

  
859
        # maps /leaflet/ to the directory provided by the libjs-openlayers package
860
        if component == 'leaflet':
861
            return StaticDirectory('/usr/share/javascript/leaflet')
862

  
863
        if component in ('css','images'):
864
            return OldRootDirectory._q_lookup(self, component)
865

  
866 853
        # is this a category ?
867 854
        try:
868 855
            category = Category.get_by_urlname(component)

Formats disponibles : Unified diff