version 1.147, 2010/10/28 15:44:20
|
version 1.148, 2010/10/29 12:53:45
|
Line 51 def serializeNode(node, encoding='utf-8'
|
Line 51 def serializeNode(node, encoding='utf-8'
|
buf.close() |
buf.close() |
return s |
return s |
|
|
def getBrowserType(self): |
def browserCheck(self): |
"""get browser type object""" |
"""check the browsers request to find out the browser type""" |
if self.REQUEST.SESSION.has_key('browserType'): |
bt = {} |
return self.REQUEST.SESSION['browserType'] |
ua = self.REQUEST.get_header("HTTP_USER_AGENT") |
|
bt['ua'] = ua |
|
bt['isIE'] = False |
|
bt['isN4'] = False |
|
if string.find(ua, 'MSIE') > -1: |
|
bt['isIE'] = True |
else: |
else: |
bt = browserCheck(self) |
bt['isN4'] = (string.find(ua, 'Mozilla/4.') > -1) |
self.REQUEST.SESSION.set('browserType', bt) |
|
logging.debug("documentViewer (BROWSER TYPE) bt %s"%bt) |
try: |
|
nav = ua[string.find(ua, '('):] |
|
ie = string.split(nav, "; ")[1] |
|
if string.find(ie, "MSIE") > -1: |
|
bt['versIE'] = string.split(ie, " ")[1] |
|
except: pass |
|
|
|
bt['isMac'] = string.find(ua, 'Macintosh') > -1 |
|
bt['isWin'] = string.find(ua, 'Windows') > -1 |
|
bt['isIEWin'] = bt['isIE'] and bt['isWin'] |
|
bt['isIEMac'] = bt['isIE'] and bt['isMac'] |
|
bt['staticHTML'] = False |
|
|
return bt |
return bt |
|
|
|
|
Line 309 class documentViewer(Folder):
|
Line 326 class documentViewer(Folder):
|
ret+="mk=%s"%m |
ret+="mk=%s"%m |
return ret |
return ret |
|
|
|
def getBrowser(self): |
|
"""getBrowser the version of browser """ |
|
bt = browserCheck(self) |
|
logging.debug("XXXXXXXXXXXXXXXX: %s"%bt) |
|
return bt |
|
|
def findDigilibUrl(self): |
def findDigilibUrl(self): |
"""try to get the digilib URL from zogilib""" |
"""try to get the digilib URL from zogilib""" |