当前位置: 首页>>代码示例>>Python>>正文


Python HTTPRequest.query_params["since"]方法代码示例

本文整理汇总了Python中tincan.http_request.HTTPRequest.query_params["since"]方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPRequest.query_params["since"]方法的具体用法?Python HTTPRequest.query_params["since"]怎么用?Python HTTPRequest.query_params["since"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tincan.http_request.HTTPRequest的用法示例。


在下文中一共展示了HTTPRequest.query_params["since"]方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: retrieve_activity_profile_ids

# 需要导入模块: from tincan.http_request import HTTPRequest [as 别名]
# 或者: from tincan.http_request.HTTPRequest import query_params["since"] [as 别名]
    def retrieve_activity_profile_ids(self, activity, since=None):
        """Retrieve activity profile id(s) with the specified parameters

        :param activity: Activity object of desired activity profiles
        :type activity: :class:`tincan.activity.Activity`
        :param since: Retrieve activity profile id's since this time
        :type since: str | unicode
        :return: LRS Response object with list of retrieved activity profile id's as content
        :rtype: :class:`tincan.lrs_response.LRSResponse`
        """
        if not isinstance(activity, Activity):
            activity = Activity(activity)

        request = HTTPRequest(
            method="GET",
            resource="activities/profile"
        )
        request.query_params["activityId"] = activity.id

        if since is not None:
            request.query_params["since"] = since

        lrs_response = self._send_request(request)

        if lrs_response.success:
            lrs_response.content = json.loads(lrs_response.data)

        return lrs_response
开发者ID:DamavandiKamali,项目名称:TinCanPython,代码行数:30,代码来源:remote_lrs.py

示例2: retrieve_agent_profile_ids

# 需要导入模块: from tincan.http_request import HTTPRequest [as 别名]
# 或者: from tincan.http_request.HTTPRequest import query_params["since"] [as 别名]
    def retrieve_agent_profile_ids(self, agent, since=None):
        """Retrieve agent profile id(s) with the specified parameters

        :param agent: Agent object of desired agent profiles
        :type agent: :class:`tincan.agent.Agent`
        :param since: Retrieve agent profile id's since this time
        :type since: str | unicode
        :return: LRS Response object with list of retrieved agent profile id's as content
        :rtype: :class:`tincan.lrs_response.LRSResponse`
        """
        if not isinstance(agent, Agent):
            agent = Agent(agent)

        request = HTTPRequest(
            method="GET",
            resource="agents/profile"
        )
        request.query_params["agent"] = agent.to_json(self.version)

        if since is not None:
            request.query_params["since"] = since

        lrs_response = self._send_request(request)

        if lrs_response.success:
            lrs_response.content = json.loads(lrs_response.data)

        return lrs_response
开发者ID:DamavandiKamali,项目名称:TinCanPython,代码行数:30,代码来源:remote_lrs.py

示例3: retrieve_state_ids

# 需要导入模块: from tincan.http_request import HTTPRequest [as 别名]
# 或者: from tincan.http_request.HTTPRequest import query_params["since"] [as 别名]
    def retrieve_state_ids(self, activity, agent, registration=None, since=None):
        """Retrieve state id's from the LRS with the provided parameters

        :param activity: Activity object of desired states
        :type activity: :class:`tincan.activity.Activity`
        :param agent: Agent object of desired states
        :type agent: :class:`tincan.agent.Agent`
        :param registration: Registration UUID of desired states
        :type registration: str | unicode
        :param since: Retrieve state id's since this time
        :type since: str | unicode
        :return: LRS Response object with the retrieved state id's as content
        :rtype: :class:`tincan.lrs_response.LRSResponse`
        """
        if not isinstance(activity, Activity):
            activity = Activity(activity)

        if not isinstance(agent, Agent):
            agent = Agent(agent)

        request = HTTPRequest(
            method="GET",
            resource="activities/state"
        )
        request.query_params = {
            "activityId": activity.id,
            "agent": agent.to_json(self.version)
        }

        if registration is not None:
            request.query_params["registration"] = registration
        if since is not None:
            request.query_params["since"] = since

        lrs_response = self._send_request(request)

        if lrs_response.success:
            lrs_response.content = json.loads(lrs_response.data)

        return lrs_response
开发者ID:DamavandiKamali,项目名称:TinCanPython,代码行数:42,代码来源:remote_lrs.py


注:本文中的tincan.http_request.HTTPRequest.query_params["since"]方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。