import os from myghty.resolver import * publish_dir = os.path.dirname(os.path.abspath(__file__)) # The following options are passed directly into Myghty, so all configuration options # available to the Myghty handler are available for your use here config = {} config['data_dir'] = os.path.join(publish_dir, 'cache') config['component_root'] = [ {'comp' : os.path.join(publish_dir, 'components')}, {'htdocs' : os.path.join(publish_dir, 'htdocs')}, ] config['resolver_strategy'] = [ ConditionalGroup(context='request', rules=[ PathTranslate((r'/$$', '/index.myt')), # bounce non-myghty requests down to paste htdocs handler, # using "silent" NotFound rule ConditionalGroup(regexp=r'(?!.*\.myt$$)', rules = [ NotFound(silent=True) ]), ]), PathTranslate(), ResolveDhandler(), URICache(), ResolveUpwards(), ResolvePathModule(), ResolveModule(), ResolveFile() ]