Show
Ignore:
Timestamp:
03/25/08 14:11:29 (8 months ago)
Author:
JensDiemer
Message:

work-a-round for ticket:87 with the new PyLucidCommonMiddleware?.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/PyLucid/install/BaseInstall.py

    r1449 r1505  
    8787""" 
    8888 
     89def get_base_context(request): 
     90    """ 
     91    Build a base context. 
     92    Used in BaseInstall and PyLucidCommonMiddleware. 
     93    """ 
     94    media_url = posixpath.join( 
     95        settings.MEDIA_URL, settings.PYLUCID_MEDIA_DIR, "" 
     96    ) # With appended slash, for backward compatible 
     97    context = { 
     98        "output": "", 
     99        "request": request, 
     100        "PyLucid_media_url": media_url, 
     101        "version": PYLUCID_VERSION_STRING, 
     102        "current_working_dir": os.getcwd(), 
     103    } 
     104    return context 
     105 
     106 
     107 
    89108class BaseInstall(object): 
    90109    """ 
     
    108127        self.request = request 
    109128 
    110         media_url = posixpath.join( 
    111             settings.MEDIA_URL, settings.PYLUCID_MEDIA_DIR, "" 
    112         ) # With appended slash, for backward compatible 
    113         self.context = { 
    114             "output": "", 
    115             "request": request, 
    116             "PyLucid_media_url": media_url, 
    117             "version": PYLUCID_VERSION_STRING, 
    118             "current_working_dir": os.getcwd(), 
    119         } 
     129        self.context = get_base_context(request) 
     130 
    120131        self.page_msg = PageMessages(self.context) 
    121132        self.context["page_msg"] = self.page_msg