本文整理汇总了Python中synapse.http.servlet.parse_string_from_args函数的典型用法代码示例。如果您正苦于以下问题:Python parse_string_from_args函数的具体用法?Python parse_string_from_args怎么用?Python parse_string_from_args使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse_string_from_args函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: on_GET
def on_GET(self, origin, content, query):
if self.deny_access:
raise FederationDeniedError(origin)
limit = parse_integer_from_args(query, "limit", 0)
since_token = parse_string_from_args(query, "since", None)
include_all_networks = parse_boolean_from_args(
query, "include_all_networks", False
)
third_party_instance_id = parse_string_from_args(
query, "third_party_instance_id", None
)
if include_all_networks:
network_tuple = None
elif third_party_instance_id:
network_tuple = ThirdPartyInstanceID.from_string(third_party_instance_id)
else:
network_tuple = ThirdPartyInstanceID(None, None)
data = yield self.handler.get_local_public_room_list(
limit, since_token,
network_tuple=network_tuple,
from_federation=True,
)
defer.returnValue((200, data))
开发者ID:matrix-org,项目名称:synapse,代码行数:26,代码来源:server.py
示例2: on_GET
def on_GET(self, origin, content, query):
limit = parse_integer_from_args(query, "limit", 0)
since_token = parse_string_from_args(query, "since", None)
data = yield self.room_list_handler.get_local_public_room_list(
limit, since_token
)
defer.returnValue((200, data))
开发者ID:mebjas,项目名称:synapse,代码行数:7,代码来源:server.py
示例3: on_POST
def on_POST(self, origin, content, query, group_id, user_id):
requester_user_id = parse_string_from_args(query, "requester_user_id")
if get_domain_from_id(requester_user_id) != origin:
raise SynapseError(403, "requester_user_id doesn't match origin")
new_content = yield self.handler.remove_user_from_group(
group_id, user_id, requester_user_id, content,
)
defer.returnValue((200, new_content))
开发者ID:matrix-org,项目名称:synapse,代码行数:10,代码来源:server.py
示例4: on_DELETE
def on_DELETE(self, origin, content, query, group_id, role_id):
requester_user_id = parse_string_from_args(query, "requester_user_id")
if get_domain_from_id(requester_user_id) != origin:
raise SynapseError(403, "requester_user_id doesn't match origin")
if role_id == "":
raise SynapseError(400, "role_id cannot be empty string")
resp = yield self.handler.delete_group_role(
group_id, requester_user_id, role_id,
)
defer.returnValue((200, resp))
开发者ID:matrix-org,项目名称:synapse,代码行数:13,代码来源:server.py
示例5: on_GET
def on_GET(self, origin, content, query, context):
return self.handler.on_context_state_request(
origin,
context,
parse_string_from_args(query, "event_id", None),
)
开发者ID:DoubleMalt,项目名称:synapse,代码行数:6,代码来源:server.py
注:本文中的synapse.http.servlet.parse_string_from_args函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论