Changeset 585:83eeed69793f in documentViewer for SrvTxtUtils.py


Ignore:
Timestamp:
Nov 13, 2012, 4:33:34 PM (12 years ago)
Author:
casties
Branch:
default
Message:

new annotator layer for images.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SrvTxtUtils.py

    r553 r585  
    1212
    1313
    14 srvTxtUtilsVersion = "1.5.1"
     14srvTxtUtilsVersion = "1.6"
    1515
    1616def getInt(number, default=0):
     
    133133    return ImageFile.index_html(self, REQUEST, RESPONSE)
    134134
     135
     136def 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.