本文整理汇总了Python中squeakspace.common.util_client.encode函数的典型用法代码示例。如果您正苦于以下问题:Python encode函数的具体用法?Python encode怎么用?Python encode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了encode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: create_group
def create_group(self, user_id, session_id, node_name, group_id,
post_access, read_access, delete_access,
posting_key_hash, reading_key_hash, delete_key_hash,
quota_allocated, when_space_exhausted,
max_post_size,
public_key_hash, passphrase=None):
method = 'POST'
path = '/proxy/group'
body = uc.encode(
{'node_name' : node_name,
'group_id' : group_id,
'post_access' : post_access,
'read_access' : read_access,
'delete_access' : delete_access,
'posting_key_hash' : posting_key_hash,
'reading_key_hash' : reading_key_hash,
'delete_key_hash' : delete_key_hash,
'quota_allocated' : quota_allocated,
'when_space_exhausted' : when_space_exhausted,
'max_post_size' : max_post_size,
'public_key_hash' : public_key_hash,
'passphrase' : passphrase})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=body, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:26,代码来源:client.py
示例2: read_version
def read_version(self, node_name):
method = 'GET'
url = '/version?' + uc.encode(
{'node_name' : node_name})
return self.send_and_getter.send_and_get(self.conn, method, url)
开发者ID:elpassassin,项目名称:squeakspace,代码行数:7,代码来源:client_raw.py
示例3: create_group
def create_group(
self,
timestamp, node_name, group_id, owner_id,
post_access, read_access, delete_access,
posting_key_type, posting_pub_key,
reading_key_type, reading_pub_key,
delete_key_type, delete_pub_key,
quota_allocated, when_space_exhausted,
max_post_size,
public_key_hash, signature):
method = 'POST'
url = '/group'
body = uc.encode(
{'timestamp' : timestamp,
'node_name' : node_name,
'group_id' : group_id,
'owner_id' : owner_id,
'post_access' : post_access,
'read_access' : read_access,
'delete_access' : delete_access,
'posting_key_type' : posting_key_type,
'posting_pub_key' : posting_pub_key,
'reading_key_type' : reading_key_type,
'reading_pub_key' : reading_pub_key,
'delete_key_type' : delete_key_type,
'delete_pub_key' : delete_pub_key,
'quota_allocated' : quota_allocated,
'when_space_exhausted' : when_space_exhausted,
'max_post_size' : max_post_size,
'public_key_hash' : public_key_hash,
'signature' : signature})
return self.send_and_getter.send_and_get(self.conn, method, url, body)
开发者ID:elpassassin,项目名称:squeakspace,代码行数:34,代码来源:client_raw.py
示例4: create_user
def create_user(self, node_name, user_id,
key_type, public_key, public_key_hash, revoke_date,
default_message_access, when_mail_exhausted,
quota_size, mail_quota_size,
max_message_size,
user_class, auth_token):
method = 'POST'
url = '/user'
body = uc.encode(
{'node_name' : node_name,
'user_id' : user_id,
'key_type' : key_type,
'public_key' : public_key,
'public_key_hash' : public_key_hash,
'revoke_date' : revoke_date,
'default_message_access' : default_message_access,
'when_mail_exhausted' : when_mail_exhausted,
'quota_size' : quota_size,
'mail_quota_size' : mail_quota_size,
'max_message_size' : max_message_size,
'user_class' : user_class,
'auth_token' : auth_token})
return self.send_and_getter.send_and_get(self.conn, method, url, body)
开发者ID:elpassassin,项目名称:squeakspace,代码行数:25,代码来源:client_raw.py
示例5: query_user
def query_user(self, node_name, user_id):
method = 'GET'
url = '/query-user?' + uc.encode(
{'node_name' : node_name,
'user_id' : user_id})
return self.send_and_getter.send_and_get(self.conn, method, url)
开发者ID:elpassassin,项目名称:squeakspace,代码行数:8,代码来源:client_raw.py
示例6: read_node_addr
def read_node_addr(self, user_id, session_id, node_name):
method = 'GET'
path = '/local/node-addr?' + uc.encode(
{'node_name' : node_name})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=None, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:8,代码来源:client.py
示例7: read_quota_available
def read_quota_available(self, node_name, user_class):
method = 'GET'
url = '/quota-available?' + uc.encode(
{'node_name' : node_name,
'user_class' : user_class})
return self.send_and_getter.send_and_get(self.conn, method, url)
开发者ID:elpassassin,项目名称:squeakspace,代码行数:8,代码来源:client_raw.py
示例8: list_user_keys
def list_user_keys(self, user_id, session_id, node_name=None):
method = 'GET'
path = '/local/list-user-keys?' + uc.encode(
{'node_name' : node_name})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=None, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:8,代码来源:client.py
示例9: read_public_key
def read_public_key(self, user_id, session_id, public_key_hash):
method = 'GET'
path = '/local/public-key?' + uc.encode(
{'public_key_hash' : public_key_hash})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=None, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:8,代码来源:client.py
示例10: delete_node_addr
def delete_node_addr(self, user_id, session_id, node_name):
method = 'DELETE'
path = '/local/node-addr'
body = uc.encode(
{'node_name' : node_name})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=body, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:9,代码来源:client.py
示例11: query_user
def query_user(self, user_id, session_id, node_name, other_user_id):
method = 'GET'
path = '/proxy/query-user?' + uc.encode(
{'node_name' : node_name,
'other_user_id' : other_user_id})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=None, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:9,代码来源:client.py
示例12: delete_public_key
def delete_public_key(self, user_id, session_id, public_key_hash):
method = 'DELETE'
path = '/local/public-key'
body = uc.encode(
{'public_key_hash' : public_key_hash})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=body, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:9,代码来源:client.py
示例13: create_local_user
def create_local_user(self, user_id, password):
method = 'POST'
path = '/local/user'
body = uc.encode(
{'user_id' : user_id,
'password' : password})
return self.send_and_getter.send_and_get(self.conn, method, path, body=body, cookies=None)
开发者ID:elpassassin,项目名称:squeakspace,代码行数:9,代码来源:client.py
示例14: read_quota_available
def read_quota_available(self, user_id, session_id, node_name, user_class):
method = 'GET'
path = '/proxy/quota-available?' + uc.encode(
{'node_name' : node_name,
'user_class' : user_class})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=None, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:9,代码来源:client.py
示例15: read_private_key
def read_private_key(self, user_id, session_id, public_key_hash, only_public_part=None, allow_private_user_key=None):
method = 'GET'
path = '/local/private-key?' + uc.encode(
{'public_key_hash' : public_key_hash,
'only_public_part' : only_public_part,
'allow_private_user_key' : allow_private_user_key})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=None, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:10,代码来源:client.py
示例16: encrypt
def encrypt(self, user_id, session_id, public_key_hash, plaintext):
method = 'POST'
path = '/local/crypt/encrypt'
body = uc.encode(
{'public_key_hash' : public_key_hash,
'plaintext' : plaintext})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body, cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:10,代码来源:client.py
示例17: read_message_quota
def read_message_quota(self, user_id, session_id, node_name, public_key_hash, passphrase=None):
method = 'GET'
path = '/proxy/message-quota?' + uc.encode(
{'node_name' : node_name,
'public_key_hash' : public_key_hash,
'passphrase' : passphrase})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=None, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:10,代码来源:client.py
示例18: assign_user_key
def assign_user_key(self, user_id, session_id, node_name, public_key_hash):
method = 'POST'
path = '/local/user-key'
body = uc.encode(
{'node_name' : node_name,
'public_key_hash' : public_key_hash})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=body, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:10,代码来源:client.py
示例19: read_max_post_size
def read_max_post_size(self, timestamp, node_name, group_id, owner_id, post_signature):
method = 'GET'
url = '/max-post-size?' + uc.encode(
{'timestamp' : timestamp,
'node_name' : node_name,
'group_id' : group_id,
'owner_id' : owner_id,
'post_signature' : post_signature})
return self.send_and_getter.send_and_get(self.conn, method, url)
开发者ID:elpassassin,项目名称:squeakspace,代码行数:10,代码来源:client_raw.py
示例20: read_local_message_access
def read_local_message_access(self, user_id, session_id, to_user, node_name, from_user_key_hash):
method = 'GET'
path = '/local/message-access?' + uc.encode(
{'to_user' : to_user,
'node_name' : node_name,
'from_user_key_hash' : from_user_key_hash})
cookies = co.SimpleCookie({'user_id' : user_id, 'session_id' : session_id})
return self.send_and_getter.send_and_get(self.conn, method, path, body=None, cookies=cookies)[0]
开发者ID:elpassassin,项目名称:squeakspace,代码行数:10,代码来源:client.py
注:本文中的squeakspace.common.util_client.encode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论