本文整理匯總了Python中botocore.compat.total_seconds方法的典型用法代碼示例。如果您正苦於以下問題:Python compat.total_seconds方法的具體用法?Python compat.total_seconds怎麽用?Python compat.total_seconds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類botocore.compat
的用法示例。
在下文中一共展示了compat.total_seconds方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _seconds_remaining
# 需要導入模塊: from botocore import compat [as 別名]
# 或者: from botocore.compat import total_seconds [as 別名]
def _seconds_remaining(self):
delta = self._expiry_time - self._time_fetcher()
return total_seconds(delta)
示例2: _is_expired
# 需要導入模塊: from botocore import compat [as 別名]
# 或者: from botocore.compat import total_seconds [as 別名]
def _is_expired(self, credentials):
end_time = parse(credentials['Credentials']['Expiration'])
now = datetime.datetime.now(tzlocal())
seconds = total_seconds(end_time - now)
return seconds < self.EXPIRY_WINDOW_SECONDS
示例3: _is_expired
# 需要導入模塊: from botocore import compat [as 別名]
# 或者: from botocore.compat import total_seconds [as 別名]
def _is_expired(self, credentials):
end_time = _parse_if_needed(credentials['Credentials']['Expiration'])
now = datetime.datetime.now(tzlocal())
seconds = total_seconds(end_time - now)
return seconds < self.EXPIRY_WINDOW_SECONDS
示例4: nowInMillis
# 需要導入模塊: from botocore import compat [as 別名]
# 或者: from botocore.compat import total_seconds [as 別名]
def nowInMillis():
endTime = long(total_seconds(datetime.utcnow() - datetime(1970, 1, 1))) * 1000L
return endTime
示例5: _is_expired
# 需要導入模塊: from botocore import compat [as 別名]
# 或者: from botocore.compat import total_seconds [as 別名]
def _is_expired(self, credentials):
"""Check if credentials are expired."""
end_time = _parse_if_needed(credentials['Credentials']['Expiration'])
seconds = total_seconds(end_time - _local_now())
return seconds < self._expiry_window_seconds