From 8df53eb6f98e438b84adbc881ef2e0de4bf0ead7 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: Thu, 18 Feb 2016 20:48:30 +0300 Subject: [PATCH] upd tox --- src/tox.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/tox.py b/src/tox.py index cb84f27..fee988e 100644 --- a/src/tox.py +++ b/src/tox.py @@ -147,6 +147,24 @@ class Tox(object): self.libtoxcore.tox_self_get_address(self._tox_pointer, address) return address + def self_set_nospam(self, nospam): + self.libtoxcore.tox_self_set_nospam(self._tox_pointer, c_uint32(nospam)) + + def self_get_nospam(self): + return int(self.libtoxcore.tox_self_get_nospam(self._tox_pointer).value) + + def self_get_public_key(self, public_key=None): + 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): + 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) + return secret_key + def __del__(self): if hasattr(self, 'tox_options'): self.libtoxcore.tox_kill(self._tox_pointer)