示例#1
0
 def find_matching_ua(self, user_agent):
     if user_agent.startswith(u"SonyEricsson"):
         match = super(SonyEricssonMatcher, self).find_matching_ua(user_agent)
     else:
         tolerance = second_slash(user_agent)
         match = self.ris_matcher(user_agent, tolerance)
     #print "SonyEricssonMatcher %s -> f_m_ua -> %s" % (user_agent, match)
     return match
示例#2
0
 def look_for_matching_user_agent(self, user_agent):
     if user_agent.startswith(u"SonyEricsson"):
         match = AbstractMatcher.look_for_matching_user_agent(self,
                                                              user_agent)
     else:
         tolerance = utils.second_slash(user_agent)
         match = ris_match(self.user_agents, user_agent, tolerance)
     #print "SonyEricssonMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
示例#3
0
    def look_for_matching_user_agent(self, user_agent):
        if u"Vodafone" in user_agent:
            tolerance = uiol(user_agent, u"LG")
        elif user_agent.startswith(u"LGE/") or user_agent.startswith("LG/"):
            tolerance = utils.second_slash(user_agent)
        else:
            tolerance = utils.first_slash(user_agent)

        return ris_match(self.user_agents, user_agent, tolerance)
示例#4
0
 def find_matching_ua(self, user_agent):
     if user_agent.startswith(u"KDDI/"):
         tolerance = second_slash(user_agent)
     elif user_agent.startswith(u"KDDI"):
         tolerance = first_slash(user_agent)
     else:
         tolerance = iol(user_agent, ")")
     match = self.ris_matcher(user_agent, tolerance)
     #print "KDDIMatcher %s -> f_m_ua -> %s" % (user_agent, match)
     return match
示例#5
0
    def look_for_matching_user_agent(self, user_agent):
        if user_agent.startswith(u"KDDI/"):
            tolerance = utils.second_slash(user_agent)
        elif user_agent.startswith(u"KDDI"):
            tolerance = utils.first_slash(user_agent)
        else:
            tolerance = uiol(user_agent, ")")

        match = ris_match(self.user_agents, user_agent, tolerance)
        #print "KDDIMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
        return match
示例#6
0
 def look_for_matching_user_agent(self, user_agent):
     if (user_agent.startswith(u"SEC-") or
         user_agent.startswith(u"SAMSUNG-") or
         user_agent.startswith(u"SCH")):
         tolerance = utils.first_slash(user_agent)
     elif (user_agent.startswith(u"Samsung") or
           user_agent.startswith(u"SPH") or
           user_agent.startswith(u"SGH")):
         tolerance = utils.first_space(user_agent)
     elif user_agent.startswith(u"SAMSUNG/"):
         tolerance = utils.second_slash(user_agent)
     elif u"Samsung/SGH-L870" in user_agent:
         tolerance = uiol(user_agent, u"/", 5)
     else:
         tolerance = len(user_agent)
     match = ris_match(self.user_agents, user_agent, tolerance)
     #print "SamsungMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match