Changeset 425:fd8bef319208 in documentViewer
- Timestamp:
- Jan 12, 2011, 2:10:45 PM (14 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentViewer.py
r424 r425 59 59 bt['isIE'] = False 60 60 bt['isN4'] = False 61 bt['versFirefox']="" 62 bt['versIE']="" 63 bt['versSafariChrome']="" 64 bt['versOpera']="" 65 61 66 if string.find(ua, 'MSIE') > -1: 62 67 bt['isIE'] = True 63 68 else: 64 69 bt['isN4'] = (string.find(ua, 'Mozilla/4.') > -1) 65 70 # Safari oder Chrome identification 71 try: 72 nav = ua[string.find(ua, '('):] 73 nav1=ua[string.find(ua,')'):] 74 nav2=nav1[string.find(nav1,'('):] 75 nav3=nav2[string.find(nav2,')'):] 76 ie = string.split(nav, "; ")[1] 77 ie1 =string.split(nav1, " ")[2] 78 ie2 =string.split(nav3, " ")[1] 79 ie3 =string.split(nav3, " ")[2] 80 if string.find(ie3, "Safari") >-1: 81 bt['versSafariChrome']=string.split(ie2, "/")[1] 82 except: pass 83 # IE identification 66 84 try: 67 85 nav = ua[string.find(ua, '('):] … … 69 87 if string.find(ie, "MSIE") > -1: 70 88 bt['versIE'] = string.split(ie, " ")[1] 71 except: pass 89 except:pass 90 # Firefox identification 91 try: 92 nav = ua[string.find(ua, '('):] 93 nav1=ua[string.find(ua,')'):] 94 if string.find(ie1, "Firefox") >-1: 95 nav5= string.split(ie1, "/")[1] 96 logging.debug("FIREFOX: %s"%(nav5)) 97 bt['versFirefox']=string.split(nav5, ".")[1] 98 except:pass 99 #Opera identification 100 try: 101 if string.find(ua,"Opera") >-1: 102 nav = ua[string.find(ua, '('):] 103 nav1=nav[string.find(nav,')'):] 104 bt['versOpera']=string.split(nav1,"/")[2] 105 except:pass 72 106 73 107 bt['isMac'] = string.find(ua, 'Macintosh') > -1
Note: See TracChangeset
for help on using the changeset viewer.