'Returns the appropriate parser class from the filename.'

def GetParserFromFilename(self, path):

    handler_name = path.split('://')[0]
    for parser_cls in GRRConfigParser.classes.values():
        if (parser_cls.name == handler_name):
            return parser_cls
    extension = os.path.splitext(path)[1]
    if (extension in ['.yaml', '.yml']):
        return YamlParser
    return ConfigFileParser
