'Creates SimpleHandlers out of XML-specified static file includes.'

def MakeStaticFilePatternsIntoHandlers(self):

    includes = self.static_file_includes
    if (not includes):
        return [handler.SimpleHandler('/*', {'type': 'static'})]
    handler_patterns = []
    for include in includes:
        pattern = include.pattern.replace('**', '*')
        if (pattern[0] != '/'):
            pattern = ('/' + pattern)
        properties = {'type': 'static'}
        if include.expiration:
            properties['expiration'] = include.expiration
        if include.http_headers:
            properties['http_headers'] = tuple(sorted(include.http_headers.items()))
        handler_patterns.append(handler.SimpleHandler(pattern, properties))
    return handler_patterns
