コード例 #1
0
    def from_info(info, metadata, client_section):
        if not info:
            return None

        return WatchSession('logging-%s' % info.get('machineIdentifier'),
                            info['ratingKey'],
                            metadata,
                            info['state'],
                            client=Client.from_section(client_section))
コード例 #2
0
    def from_info(info, metadata, client_section):
        if not info:
            return None

        return WatchSession(
            'logging-%s' % info.get('machineIdentifier'),
            info['ratingKey'],
            metadata,
            info['state'],
            client=Client.from_section(client_section)
        )
コード例 #3
0
    def from_section(section, state, metadata, client_section=None):
        """
        :type section: ?
        :type state: str

        :rtype: WatchSession or None
        """

        if not section:
            return None

        return WatchSession(section.get('sessionKey'),
                            section.get('ratingKey'),
                            metadata,
                            state,
                            user=User.from_section(section),
                            client=Client.from_section(client_section))
コード例 #4
0
    def from_section(section, state, metadata, client_section=None):
        """
        :type section: ?
        :type state: str

        :rtype: WatchSession or None
        """

        if not section:
            return None

        return WatchSession(
            section.get('sessionKey'),
            section.get('ratingKey'),
            metadata, state,
            user=User.from_section(section),
            client=Client.from_section(client_section)
        )