Changeset 132

Show
Ignore:
Timestamp:
02/18/06 18:32:55 (3 years ago)
Author:
tim
Message:

fixed flattener so it can cope without wiki parser

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tags/0.3.2/pyramid/flatteners.py

    r124 r132  
    129129class WikiUrlFlattener(components.Adapter): 
    130130    def flatten(self, ctx, dir): 
    131         from pyramid import moinmoin 
    132         url = expandConstants(ctx,dir,self.original) 
    133         from pprint import pprint 
    134         pprint(url) 
    135         contents = moinmoin.parse(url) 
     131        try: 
     132            from pyramid import moinmoin 
     133            url = expandConstants(ctx,dir,self.original) 
     134            contents = moinmoin.parse(url) 
     135        except: 
     136            print 'moinmoin parse error, replacing with a marker' 
     137            contents = '<strong>MoinMoin parse failed for %s - a wiki instance needs to be installed and the wikiconfig.py directory needs to be on the $PYTHONPATH</strong>'%url 
    136138        return T.xml(contents) 
    137139