Пример #1
0
    def expires(self):
        """Get naive datetime of token expiration.

        :returns: Datetime of expiration of the token.
        :rtype: datetime.datetime
        """
        expires = self._token().get('expires')
        if expires is None:
            return None
        expires = strtodatetime(expires)
        expires = expires.replace(tzinfo=None)
        return expires
Пример #2
0
    def synced(self):
        """Get synced datetime

        :returns: The synced datetime
        :rtype: datetime
        """
        synced = self.run_data.get('synced')
        if synced is not None:
            try:
                synced = utils.strtodatetime(synced)
            except Exception:
                synced = None
        return synced
Пример #3
0
    def completed(self):
        """Get completed datetime

        :returns: The completed datetime str
        :rtype: str|None
        """
        if self._completed is None:
            try:
                raw = self.run_data.get('completed')
                self._completed = utils.strtodatetime(raw)
            except Exception:
                self._completed = None
        return self._completed