當前位置: 首頁>>代碼示例>>Python>>正文


Python compat.total_seconds方法代碼示例

本文整理匯總了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) 
開發者ID:skarlekar,項目名稱:faces,代碼行數:5,代碼來源:credentials.py

示例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 
開發者ID:skarlekar,項目名稱:faces,代碼行數:7,代碼來源:credentials.py

示例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 
開發者ID:skarlekar,項目名稱:faces,代碼行數:7,代碼來源:credentials.py

示例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 
開發者ID:awslabs,項目名稱:aws-batch-helpers,代碼行數:5,代碼來源:submit-job.py

示例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 
開發者ID:QData,項目名稱:deepWordBug,代碼行數:7,代碼來源:credentials.py


注:本文中的botocore.compat.total_seconds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。