本文整理汇总了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