Exemplo n.º 1
0
 def find_matching_ua(self, user_agent):
     tol1 = iol(user_agent, u"/", start_index=user_agent.index(u"Nokia"))
     tol2 = iol(user_agent, u" ", start_index=user_agent.index(u"Nokia"))
     tolerance = tol1 if tol1 < tol2 else tol2
     #print "NokiaMatcher tolerance %s" % tolerance
     match = self.ris_matcher(user_agent, tolerance)
     #print "NokiaMatcher %s -> f_m_ua -> %s" % (user_agent, match)
     return match
Exemplo n.º 2
0
    def find_matching_ua(self, user_agent):
        for sams in self.SAMSUNGS:
            if sams in user_agent:
                tol1 = iol(user_agent, u"/", start_index=user_agent.index(sams))
                tol2 = iol(user_agent, u" ", start_index=user_agent.index(sams))
                tolerance = tol1 if tol1 < tol2 else tol2
                break
        else:
            tolerance = len(user_agent)

        match = self.ris_matcher(user_agent, tolerance)
        #print "SamsungMatcher %s -> f_m_ua -> %s" % (user_agent, match)
        return match
Exemplo n.º 3
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
Exemplo n.º 4
0
 def find_matching_ua(self, user_agent):
     tolerance = iol(user_agent, u"/", 3)
     match = self.ris_matcher(user_agent, tolerance)
     #print "VodafoneMatcher %s -> f_m_ua -> %s" % (user_agent, match)
     return match
Exemplo n.º 5
0
 def find_matching_ua(self, user_agent):
     tolerance = iol(user_agent, u";", start_index=iol(user_agent, u"SPV"))
     match = self.ris_matcher(user_agent, tolerance)
     return match
Exemplo n.º 6
0
 def find_matching_ua(self, user_agent):
     tolerance = iol(user_agent, u"/",
                     start_index=user_agent.upper().index(u"LG"))
     match = self.ris_matcher(user_agent, tolerance)
     return match
Exemplo n.º 7
0
 def find_matching_ua(self, user_agent):
     tolerance = iol(user_agent, u" ",
                     start_index=iol(user_agent, u"Android"))
     match = self.ris_matcher(user_agent, tolerance)
     #print "AndroidMatcher %s -> f_m_ua -> %s" % (user_agent, match)
     return match