Changeset 585:83eeed69793f in documentViewer for SrvTxtUtils.py
- Timestamp:
- Nov 13, 2012, 4:33:34 PM (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SrvTxtUtils.py
r553 r585 12 12 13 13 14 srvTxtUtilsVersion = "1. 5.1"14 srvTxtUtilsVersion = "1.6" 15 15 16 16 def getInt(number, default=0): … … 133 133 return ImageFile.index_html(self, REQUEST, RESPONSE) 134 134 135 136 def getBrowserType(self): 137 """check the browsers request to find out the browser type""" 138 bt = {} 139 ua = self.REQUEST.get_header("HTTP_USER_AGENT") 140 bt['ua'] = ua 141 bt['isIE'] = False 142 bt['isN4'] = False 143 if string.find(ua, 'MSIE') > -1: 144 bt['isIE'] = True 145 else: 146 bt['isN4'] = (string.find(ua, 'Mozilla/4.') > -1) 147 148 try: 149 nav = ua[string.find(ua, '('):] 150 ie = string.split(nav, "; ")[1] 151 if string.find(ie, "MSIE") > -1: 152 bt['versIE'] = string.split(ie, " ")[1] 153 except: pass 154 155 bt['isMac'] = string.find(ua, 'Macintosh') > -1 156 bt['isWin'] = string.find(ua, 'Windows') > -1 157 bt['isIEWin'] = bt['isIE'] and bt['isWin'] 158 bt['isIEMac'] = bt['isIE'] and bt['isMac'] 159 bt['staticHTML'] = False 160 161 return bt 162 163
Note: See TracChangeset
for help on using the changeset viewer.