Example #1
0
 def look_for_matching_user_agent(self, user_agent):
     tolerance = uiol(user_agent, u"/",
                      start_index=user_agent.index(u"Nokia"))
     #print "NokiaMatcher tolerance %s" % tolerance
     match = ris_match(self.user_agents, user_agent, tolerance)
     #print "NokiaMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
Example #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
Example #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)
Example #4
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
Example #5
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
Example #6
0
 def look_for_matching_user_agent(self, user_agent):
     tolerance = utils.first_slash(user_agent)
     #print "AbstractMatcher tolerance %s" % tolerance
     match = ris_match(self.user_agents, user_agent, tolerance)
     #print "AbstractMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
Example #7
0
 def look_for_matching_user_agent(self, user_agent):
     tolerance = uiol(user_agent, u"/", 3)
     match = ris_match(self.user_agents, user_agent, tolerance)
     #print "VodafoneMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
Example #8
0
 def look_for_matching_user_agent(self, user_agent):
     tolerance = uiol(user_agent, u";", start_index=uiol(user_agent, u"SPV"))
     match = ris_match(self.user_agents, user_agent, tolerance)
     return match
Example #9
0
 def look_for_matching_user_agent(self, user_agent):
     tolerance = uiol(user_agent, u" ",
                      start_index=uiol(user_agent, u"Android"))
     match = ris_match(self.user_agents, user_agent, tolerance)
     #print "AndroidMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
Example #10
0
 def ris_matcher(self, user_agent, tolerance):
     return ris_match(self.user_agents, user_agent, tolerance)