Esempio n. 1
0
 def find_matching_ua(self, user_agent):
     if user_agent.startswith(u"Mozilla"):
         if user_agent.startswith(u"Mozilla/4"):
             match = ld_match(self.extract_uas(u"Mozilla/4"), user_agent,
                              self.MOZILLA_LD_TOLERANCE)
         elif user_agent.startswith(u"Mozilla/5"):
             match = ld_match(self.extract_uas(u"Mozilla/5"), user_agent,
                              self.MOZILLA_LD_TOLERANCE)
         else:
             match = ld_match(self.extract_uas(u"Mozilla"), user_agent,
                              self.MOZILLA_LD_TOLERANCE)
     else:
         match = super(CatchAllMatcher, self).find_matching_ua(user_agent)
     #print "CatchAllMatcher %s -> f_m_ua -> %s" % (user_agent, match)
     return match
Esempio n. 2
0
 def look_for_matching_user_agent(self, user_agent):
     if user_agent.startswith(u"Mozilla"):
         if user_agent.startswith(u"Mozilla/4"):
             match = ld_match(self.extract_uas(u"Mozilla/4"), user_agent,
                              self.MOZILLA_LD_TOLERANCE)
         elif user_agent.startswith(u"Mozilla/5"):
             match = ld_match(self.extract_uas(u"Mozilla/5"), user_agent,
                              self.MOZILLA_LD_TOLERANCE)
         else:
             match = ld_match(self.extract_uas(u"Mozilla"), user_agent,
                              self.MOZILLA_LD_TOLERANCE)
     else:
         match = AbstractMatcher.look_for_matching_user_agent(self,
                                                              user_agent)
     #print "CatchAllMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
Esempio n. 3
0
 def look_for_matching_user_agent(self, user_agent):
     if user_agent.startswith(u"Pantech"):
         match = ld_match(self.user_agents, user_agent,
                          self.PANTECH_LD_TOLERANCE)
     else:
         match = AbstractMatcher.look_for_matching_user_agent(self,
                                                              user_agent)
     #print "PantechMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
Esempio n. 4
0
 def look_for_matching_user_agent(self, user_agent):
     if user_agent.startswith(u"NEC"):
         match = AbstractMatcher.look_for_matching_user_agent(self,
                                                              user_agent)
     else:
         match = ld_match(self.user_agents, user_agent,
                          self.NEC_LD_TOLERANCE)
     #print "NecMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
Esempio n. 5
0
 def look_for_matching_user_agent(self, user_agent):
     if (user_agent.startswith(u"Mot-") or user_agent.startswith(u"MOT-") or
         user_agent.startswith(u"Motorola")):
         match = AbstractMatcher.look_for_matching_user_agent(self,
                                                              user_agent)
     else:
         match = ld_match(self.user_agents, user_agent,
                          self.MOTOROLA_TOLERANCE)
     #print "MotorolaMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
Esempio n. 6
0
 def look_for_matching_user_agent(self, user_agent):
     match = ld_match(self.user_agents, user_agent,
                      self.WINDOWS_CE_TOLERANCE)
     return match
Esempio n. 7
0
 def look_for_matching_user_agent(self, user_agent):
     match = ld_match(self.user_agents, user_agent, self.OPERA_TOLERANCE)
     #print "OperaMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
Esempio n. 8
0
 def look_for_matching_user_agent(self, user_agent):
     tolerance = utils.first_semi_colon(user_agent)
     match = ld_match(self.user_agents, user_agent, tolerance)
     #print "AppleMatcher %s -> l_f_m_ua -> %s" % (user_agent, match)
     return match
Esempio n. 9
0
 def ld_matcher(self, user_agent, tolerance):
     return ld_match(self.user_agents, user_agent, tolerance)