<s> """<STR_LIT>""" <EOL> from time import time <EOL> from datetime import date <EOL> from muntjac . terminal . gwt . client . v_browser_details import VBrowserDetails <EOL> from muntjac . terminal . terminal import ITerminal <EOL> class WebBrowser ( ITerminal ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . _screenHeight = <NUM_LIT:0> <EOL> self . _screenWidth = <NUM_LIT:0> <EOL> self . _browserApplication = None <EOL> self . _locale = None <EOL> self . _address = None <EOL> self . _secureConnection = None <EOL> self . _timezoneOffset = <NUM_LIT:0> <EOL> self . _rawTimezoneOffset = <NUM_LIT:0> <EOL> self . _dstSavings = None <EOL> self . _dstInEffect = None <EOL> self . _touchDevice = None <EOL> self . _browserDetails = None <EOL> self . _clientServerTimeDelta = None <EOL> def getDefaultTheme ( self ) : <EOL> """<STR_LIT>""" <EOL> return None <EOL> def getScreenHeight ( self ) : <EOL> return self . _screenHeight <EOL> def getScreenWidth ( self ) : <EOL> return self . _screenWidth <EOL> def getBrowserApplication ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _browserApplication <EOL> def getAddress ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _address <EOL> def getLocale ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _locale <EOL> def isSecureConnection ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _secureConnection <EOL> def isFirefox ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . _browserDetails is None : <EOL> return False <EOL> return self . _browserDetails . isFirefox ( ) <EOL> def isIE ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . _browserDetails is None : <EOL> return False <EOL> return self . _browserDetails . isIE ( ) <EOL> def isSafari ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . _browserDetails is None : <EOL> return False <EOL> return self . _browserDetails . isSafari ( ) <EOL> def isOpera ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . _browserDetails is None : <EOL> return False <EOL> return self . _browserDetails . isOpera ( ) <EOL> def isChrome ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . _browserDetails is None : <EOL> return False <EOL> return self . _browserDetails . isChrome ( ) <EOL> def getBrowserMajorVersion ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . _browserDetails is None : <EOL> return - <NUM_LIT:1> <EOL> return self . _browserDetails . getBrowserMajorVersion ( ) <EOL> def getBrowserMinorVersion ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . _browserDetails is None : <EOL> return - <NUM_LIT:1> <EOL> return self . _browserDetails . getBrowserMinorVersion ( ) <EOL> def isLinux ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _browserDetails . isLinux ( ) <EOL> def isMacOSX ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _browserDetails . isMacOSX ( ) <EOL> def isWindows ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _browserDetails . isWindows ( ) <EOL> def getTimezoneOffset ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _timezoneOffset <EOL> def getRawTimezoneOffset ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _rawTimezoneOffset <EOL> def getDSTSavings ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _dstSavings <EOL> def isDSTInEffect ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _dstInEffect <EOL> def getCurrentDate ( self ) : <EOL> """<STR_LIT>""" <EOL> return date . fromtimestamp ( time ( ) + self . _clientServerTimeDelta ) <EOL> def isTouchDevice ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _touchDevice <EOL> def updateClientSideDetails ( self , sw , sh , tzo , rtzo , dstSavings , <EOL> dstInEffect , curDate , touchDevice ) : <EOL> """<STR_LIT>""" <EOL> if sw is not None : <EOL> try : <EOL> self . _screenHeight = int ( sh ) <EOL> self . _screenWidth = int ( sw ) <EOL> except ValueError : <EOL> self . _screenHeight = self . _screenWidth = <NUM_LIT:0> <EOL> if tzo is not None : <EOL> try : <EOL> self . _timezoneOffset = - int ( tzo ) * <NUM_LIT> * <NUM_LIT:1000> <EOL> except ValueError : <EOL> self . _timezoneOffset = <NUM_LIT:0> <EOL> if rtzo is not None : <EOL> try : <EOL> self . _rawTimezoneOffset = - int ( rtzo ) * <NUM_LIT> * <NUM_LIT:1000> <EOL> except ValueError : <EOL> self . _rawTimezoneOffset = <NUM_LIT:0> <EOL> if dstSavings is not None : <EOL> try : <EOL> self . _dstSavings = int ( dstSavings ) * <NUM_LIT> * <NUM_LIT:1000> <EOL> except ValueError : <EOL> self . _dstSavings = <NUM_LIT:0> <EOL> if dstInEffect is not None : <EOL> self . _dstInEffect = bool ( dstInEffect ) <EOL> if curDate is not None : <EOL> try : <EOL> curTime = int ( curDate ) <EOL> self . _clientServerTimeDelta = curTime - time ( ) <EOL> except ValueError : <EOL> self . _clientServerTimeDelta = <NUM_LIT:0> <EOL> self . _touchDevice = touchDevice <EOL> def updateRequestDetails ( self , locale , address , secureConnection , agent ) : <EOL> """<STR_LIT>""" <EOL> self . _locale = locale <EOL> self . _address = address <EOL> self . _secureConnection = secureConnection <EOL> if agent is not None : <EOL> self . _browserApplication = agent <EOL> self . _browserDetails = VBrowserDetails ( agent ) </s>
