From 43b181ebbf7aa4f68c3e0fddb172ad56ed5670f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Wed, 25 Jan 2017 11:57:42 -0500 Subject: [PATCH] python: add bindings for network, maintain_storage --- python/opendht.pyx | 4 ++++ python/opendht_cpp.pxd | 2 ++ 2 files changed, 6 insertions(+) diff --git a/python/opendht.pyx b/python/opendht.pyx index 2ebbd701..fcf9ddd6 100644 --- a/python/opendht.pyx +++ b/python/opendht.pyx @@ -269,6 +269,10 @@ cdef class DhtConfig(object): self._config.dht_config.node_config.is_bootstrap = bootstrap def setNodeId(self, InfoHash id): self._config.dht_config.node_config.node_id = id._infohash + def setNetwork(self, unsigned netid): + self._config.dht_config.node_config.network = netid + def setMaintainStorage(self, bool maintain_storage): + self._config.dht_config.node_config.maintain_storage = maintain_storage cdef class DhtRunner(_WithID): cdef cpp.shared_ptr[cpp.DhtRunner] thisptr diff --git a/python/opendht_cpp.pxd b/python/opendht_cpp.pxd index d2f53026..80e73186 100644 --- a/python/opendht_cpp.pxd +++ b/python/opendht_cpp.pxd @@ -123,7 +123,9 @@ cdef extern from "opendht/callbacks.h" namespace "dht": cppclass Config: InfoHash node_id + uint32_t network bool is_bootstrap + bool maintain_storage cppclass SecureDhtConfig: Config node_config Identity id -- GitLab