コード例 #1
0
ファイル: service.py プロジェクト: jatlaoui/script.pinsentry
 def setCachedPinLevel(level):
     # Check if the pin cache is enabled, if it is not then the cache level will
     # always remain at 0 (i.e. always need to enter the pin)
     # Cache duration is set to zero if disabled
     cacheDuration = Settings.getPinCachingEnabledDuration()
     if cacheDuration != 0:
         if PinSentry.pinLevelCached < level:
             log("PinSentry: Updating cached pin level to %d" % level)
             PinSentry.pinLevelCached = level
     # Check to see if the duration expires
     if cacheDuration > 0:
         PinSentry.pinLevelCacheExpires = int(time.time()) + (cacheDuration * 60)
     else:
         PinSentry.pinLevelCacheExpires = -1
コード例 #2
0
 def setCachedPinLevel(level):
     # Check if the pin cache is enabled, if it is not then the cache level will
     # always remain at 0 (i.e. always need to enter the pin)
     # Cache duration is set to zero if disabled
     cacheDuration = Settings.getPinCachingEnabledDuration()
     if cacheDuration != 0:
         if PinSentry.pinLevelCached < level:
             log("PinSentry: Updating cached pin level to %d" % level)
             PinSentry.pinLevelCached = level
     # Check to see if the duration expires
     if cacheDuration > 0:
         PinSentry.pinLevelCacheExpires = int(
             time.time()) + (cacheDuration * 60)
     else:
         PinSentry.pinLevelCacheExpires = -1