Changeset 3493fe in indico


Ignore:
Timestamp:
04/13/12 10:13:39 (14 months ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.99, b8c30da8ebdbdcbd675a873997cc3e95f567de49, 4287315ec967a3da168d83963c14001db8487d53
Children:
a7600a
Parents:
677f2a
git-author:
Pedro Ferreira <jose.pedro.ferreira@…> (04/04/12 11:44:49)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (04/13/12 10:13:39)
Message:

[FIX] Config: use singleton instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/webinterface/pages/base.py

    r1fe078 r3493fe  
    4949    def _includeJSPackage(self, packageName, module = 'indico', path=None): 
    5050        info = HelperMaKaCInfo().getMaKaCInfoInstance() 
     51        config = Config.getInstance() 
    5152 
    5253        if info.isDebugActive(): 
    53             return ['js/%s/%s/Loader.js?%d' % (module, packageName, os.stat('%s/js/%s/%s/Loader.js'%(Config().getHtdocsDir(), module, packageName)).st_mtime )] 
    54         else: 
    55             return ['js/%s/pack/%s.js.pack?%d' % (module, packageName, os.stat('%s/js/%s/pack/%s.js.pack'%(Config().getHtdocsDir(),module, packageName)).st_mtime )] 
     54            return ['js/%s/%s/Loader.js?%d' % (module, packageName, os.stat('%s/js/%s/%s/Loader.js'%(config.getHtdocsDir(), module, packageName)).st_mtime )] 
     55        else: 
     56            return ['js/%s/pack/%s.js.pack?%d' % (module, packageName, os.stat('%s/js/%s/pack/%s.js.pack'%(config.getHtdocsDir(),module, packageName)).st_mtime )] 
    5657 
    5758    def _includeJQuery(self): 
    5859        # TODO: rename this to _includeJSLibs or something similar 
    5960        info = HelperMaKaCInfo().getMaKaCInfoInstance() 
     61        config = Config.getInstance() 
    6062 
    6163        files = ['underscore', 'jquery', 'jquery-ui', 'jquery.form', 'jquery.custom', 
     
    6466        if info.isDebugActive(): 
    6567            # We can't use Loader.js as jQuery is included before any indico js 
    66             return ['js/jquery/%s.js?%d' % (f, os.stat('%s/js/jquery/%s.js'%(Config().getHtdocsDir(), f)).st_mtime) for f in files] 
    67         else: 
    68             return ['js/jquery/pack/jquery.js.pack?%d' % os.stat('%s/js/jquery/pack/jquery.js.pack'%Config().getHtdocsDir()).st_mtime] 
     68            return ['js/jquery/%s.js?%d' % (f, os.stat('%s/js/jquery/%s.js' % (config.getHtdocsDir(), f)).st_mtime) for f in files] 
     69        else: 
     70            return ['js/jquery/pack/jquery.js.pack?%d' % os.stat('%s/js/jquery/pack/jquery.js.pack' % config.getHtdocsDir()).st_mtime] 
    6971 
    7072    def _includeJSFile(self, path, filename): 
    7173        info = HelperMaKaCInfo().getMaKaCInfoInstance() 
     74        config = Config.getInstance() 
    7275 
    7376        if info.isDebugActive(): 
    74             return ['%s/%s.js?%d' % (path, filename, os.stat('%s/%s/%s.js'%(Config().getHtdocsDir(), path, filename)).st_mtime)] 
    75         else: 
    76             return ['%s/%s.js.pack?%d' % (path, filename, os.stat('%s/%s/%s.js.pack'%(Config().getHtdocsDir(),path, filename)).st_mtime)] 
     77            return ['%s/%s.js?%d' % (path, filename, os.stat('%s/%s/%s.js' % (config.getHtdocsDir(), path, filename)).st_mtime)] 
     78        else: 
     79            return ['%s/%s.js.pack?%d' % (path, filename, os.stat('%s/%s/%s.js.pack' % (config.getHtdocsDir(),path, filename)).st_mtime)] 
    7780 
    7881    def _includePresentationFiles(self): 
    7982        info = HelperMaKaCInfo().getMaKaCInfoInstance() 
     83        config = Config.getInstance() 
    8084 
    8185        if info.isDebugActive(): 
    82             return ['%s?%d' % (f, os.stat('%s/%s'%(Config().getHtdocsDir(), f)).st_mtime) for f in ['js/presentation/Loader.js', 'js/indico/jquery/defaults.js', 'js/indico/jquery/global.js']] 
    83         else: 
    84             return ['%s?%d' % (f, os.stat('%s/%s'%(Config().getHtdocsDir(), f)).st_mtime) for f in ['js/presentation/pack/Presentation.js.pack', 'js/indico/jquery/defaults.js', 'js/indico/jquery/global.js']] 
     86            return ['%s?%d' % (f, os.stat('%s/%s' % (config.getHtdocsDir(), f)).st_mtime) for f in ['js/presentation/Loader.js', 'js/indico/jquery/defaults.js', 'js/indico/jquery/global.js']] 
     87        else: 
     88            return ['%s?%d' % (f, os.stat('%s/%s' % (config.getHtdocsDir(), f)).st_mtime) for f in ['js/presentation/pack/Presentation.js.pack', 'js/indico/jquery/defaults.js', 'js/indico/jquery/global.js']] 
    8589 
    8690    def _getBaseURL( self ): 
Note: See TracChangeset for help on using the changeset viewer.