From d45993071f6c3d8032b8d376f13b0de2104ee4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=92=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Fri, 19 Feb 2016 21:23:43 +0300 Subject: [PATCH] Internal client information (Tox address/id) docs --- src/tox.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/tox.py b/src/tox.py index 23367cd..82d5755 100644 --- a/src/tox.py +++ b/src/tox.py @@ -214,24 +214,56 @@ class Tox(object): # ----------------------------------------------------------------------------------------------------------------- def self_get_address(self, address=None): + """ + Writes the Tox friend address of the client to a byte array. The address is not in human-readable format. If a + client wants to display the address, formatting is required. + + :param address: pointer (c_char_p) to a memory region of at least TOX_ADDRESS_SIZE bytes. If this parameter is + None, this function allocates memory for address. + :return: pointer (c_char_p) to a memory region with the Tox friend address + """ if address is None: address = create_string_buffer(TOX_ADDRESS_SIZE) self.libtoxcore.tox_self_get_address(self._tox_pointer, address) return address def self_set_nospam(self, nospam): + """ + Set the 4-byte nospam part of the address. + + :param nospam: Any 32 bit unsigned integer. + """ self.libtoxcore.tox_self_set_nospam(self._tox_pointer, c_uint32(nospam)) def self_get_nospam(self): + """ + Get the 4-byte nospam part of the address. + + :return: nospam part of the address + """ return int(self.libtoxcore.tox_self_get_nospam(self._tox_pointer).value) def self_get_public_key(self, public_key=None): + """ + Copy the Tox Public Key (long term) from the Tox object. + + :param public_key: A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If this parameter is NULL, this + function allocates memory for Tox Public Key. + :return: pointer (c_char_p) to a memory region with the Tox Public Key + """ if public_key is None: public_key = create_string_buffer(TOX_PUBLIC_KEY_SIZE) self.libtoxcore.tox_self_get_address(self._tox_pointer, public_key) return public_key def self_get_secret_key(self, secret_key=None): + """ + Copy the Tox Secret Key from the Tox object. + + :param secret_key: A memory region of at least TOX_SECRET_KEY_SIZE bytes. If this parameter is NULL, this + function allocates memory for Tox Secret Key. + :return: pointer (c_char_p) to a memory region with the Tox Secret Key + """ if secret_key is None: secret_key = create_string_buffer(TOX_PUBLIC_KEY_SIZE) self.libtoxcore.tox_self_get_secret_key(self._tox_pointer, secret_key)