Changeset 56899a in indico


Ignore:
Timestamp:
06/14/10 16:59:50 (3 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
c4a9d4
Parents:
295bac
git-author:
Leszek Syroka <leszek.marek.syroka@…> (05/21/10 15:37:26)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (06/14/10 16:59:50)
Message:

[FIX] Vars.js.tpl.tmp caching

  • Vars.js.tpl.tmp is now reloaded when:
    • it doesn't exist
    • vars.js.tpl was modified after var.js.tpl.tmp
    • indico.conf was modified after var.js.tpl.tmp
    • location was added or deleted
    • roombooking module was switched
    • default location was changed
  • fix#191
  • review by jbenito: remove the file instead of regenerate
Location:
indico/MaKaC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/common/info.py

    rbdd862 r56899a  
    291291    def setRoomBookingModuleActive( self, active = False ): 
    292292        self._roomBookingModuleActive = active 
     293        from MaKaC.webinterface.rh.JSContent import RHGetVarsJs 
     294        RHGetVarsJs.removeTmpVarsFile() 
    293295 
    294296    # Only for default Indico/ZODB plugin 
  • indico/MaKaC/rb_location.py

    r3fa943 r56899a  
    125125        root = MaKaC.common.DBMgr.getInstance().getDBConnection().root() 
    126126        root[_DEFAULT_ROOM_BOOKING_LOCATION] = locationName 
     127        from MaKaC.webinterface.rh.JSContent import RHGetVarsJs 
     128        RHGetVarsJs.removeTmpVarsFile() 
    127129 
    128130    @staticmethod 
     
    150152        locations.append( location ) 
    151153        root[_ROOM_BOOKING_LOCATION_LIST] = locations 
     154        from MaKaC.webinterface.rh.JSContent import RHGetVarsJs 
     155        RHGetVarsJs.removeTmpVarsFile() 
    152156 
    153157    @staticmethod 
     
    160164        locations = [ loc for loc in locations if loc.friendlyName != locationName ] 
    161165        root[_ROOM_BOOKING_LOCATION_LIST] = locations 
     166        from MaKaC.webinterface.rh.JSContent import RHGetVarsJs 
     167        RHGetVarsJs.removeTmpVarsFile() 
    162168 
    163169    @staticmethod 
  • indico/MaKaC/webinterface/rh/JSContent.py

    r8459f9 r56899a  
    1414class RHTemplateContentJS(base.RH): 
    1515    _uh = urlHandlers.Build("JSContent.py") 
     16    _tplName = '' 
    1617 
    1718    def __init__(self, req): 
     
    5758                self._req.status = apache.HTTP_NOT_MODIFIED 
    5859                self._doProcess = False 
     60            else: 
     61                self._regenerate = True 
    5962        else: 
    6063            # file needs to be regenerated 
    61             self._regenerate = True; 
     64            self._regenerate = True 
    6265 
    6366 
     
    98101    _uh = urlHandlers.Derive(RHTemplateContentJS, "getVars") 
    99102 
     103    _tplName = 'vars.js' 
     104 
    100105    def __init__(self, req): 
    101106        RHTemplateContentJS.__init__(self, req) 
    102         self._tplName = 'vars.js'; 
    103107        self._dict = {} 
    104108 
     109    @classmethod 
     110    def removeTmpVarsFile(cls): 
     111        cfg = Config.getInstance() 
     112        fileName = cfg.getTPLFile( cls._tplName ) 
     113 
     114        if fileName == "": 
     115            fileName = "%s.tpl"%cls._tplName 
     116 
     117        htmlPath = os.path.join(cfg.getTempDir(), fileName+".tmp") 
     118        if os.access(htmlPath, os.R_OK): 
     119            os.remove(htmlPath) 
Note: See TracChangeset for help on using the changeset viewer.