diff --git a/Makefile.am b/Makefile.am index c23caf7e1bef42bc1d1d3dabd61dce1b45e7e55e..e764ea6dcc704d8fb795513dc13438217326b950 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,13 @@ SUBDIRS = src + if ENABLE_TOOLS SUBDIRS += tools endif + +if USE_CYTHON +SUBDIRS += python +endif + if HAVE_DOXYGEN SUBDIRS += doc endif diff --git a/configure.ac b/configure.ac index d2c87bccc41f627453616ac4c3065984b3533ab3..3e156ce5539f738fba15368fa5a6e03a501fcd25 100644 --- a/configure.ac +++ b/configure.ac @@ -78,7 +78,7 @@ AC_ARG_ENABLE([tools], AS_HELP_STRING([--disable-tools],[Disable tools (CLI DHT AM_CONDITIONAL(ENABLE_TOOLS, test x$build_tools == xyes) AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile doc/Makefile])]) -AM_COND_IF([USE_CYTHON], [AC_CONFIG_FILES([tools/python/Makefile])]) +AM_COND_IF([USE_CYTHON], [AC_CONFIG_FILES([python/Makefile])]) AC_CONFIG_FILES([Makefile src/Makefile diff --git a/tools/python/Makefile.am b/python/Makefile.am similarity index 100% rename from tools/python/Makefile.am rename to python/Makefile.am diff --git a/tools/python/opendht.pyx b/python/opendht.pyx similarity index 98% rename from tools/python/opendht.pyx rename to python/opendht.pyx index 8f4f8787e82d1a51c20ec4a9b1ae4ad3a47720be..e745b0abacaccf3d369362e16ec46350a2d86630 100644 --- a/tools/python/opendht.pyx +++ b/python/opendht.pyx @@ -5,8 +5,10 @@ # distutils: libraries = opendht gnutls # cython: language_level=3 # -# opendht.pyx - Copyright 2015 by Guillaume Roguez <yomgui1 AT gmail DOT com> -# A Python3 wrapper to access to OpenDHT API +# Copyright (c) 2015 Savoir-Faire Linux Inc. +# Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com> +# Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com> +# # This wrapper is written for Cython 0.22 # # This file is part of OpenDHT Python Wrapper. @@ -25,7 +27,6 @@ # along with OpenDHT Python Wrapper. If not, see <http://www.gnu.org/licenses/>. # - from libc.stdint cimport * from libcpp.string cimport string from libcpp.vector cimport vector diff --git a/tools/python/setup.py b/python/setup.py similarity index 88% rename from tools/python/setup.py rename to python/setup.py index 82f8ede3ed269fce6ca58f4133360ec35a1e4f9e..29a416a36cde528b0a72e0ecf44095b9d924bcb5 100644 --- a/tools/python/setup.py +++ b/python/setup.py @@ -1,4 +1,7 @@ -# This file is copyright 2015 by Guillaume Roguez <yomgui1 AT gmail DOT com> +# Copyright (c) 2015 Savoir-Faire Linux Inc. +# Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com> +# Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com> +# # A Python3 wrapper to access to OpenDHT API # This wrapper is written for Cython 0.22 # diff --git a/tools/python/tests/benchmark.py b/python/tools/benchmark.py old mode 100644 new mode 100755 similarity index 100% rename from tools/python/tests/benchmark.py rename to python/tools/benchmark.py diff --git a/tools/python/tests/dhtnetwork.py b/python/tools/dhtnetwork.py old mode 100644 new mode 100755 similarity index 100% rename from tools/python/tests/dhtnetwork.py rename to python/tools/dhtnetwork.py diff --git a/tools/python/tests/dummy_if.py b/python/tools/dummy_if.py similarity index 100% rename from tools/python/tests/dummy_if.py rename to python/tools/dummy_if.py diff --git a/tools/python/scanner.py b/python/tools/scanner.py old mode 100644 new mode 100755 similarity index 82% rename from tools/python/scanner.py rename to python/tools/scanner.py index 3c919825030bef7f44cf0caecfaf173fbae22bc7..439ba7204b8abafeb42f20fba95f2f06bb5b314c --- a/tools/python/scanner.py +++ b/python/tools/scanner.py @@ -1,7 +1,30 @@ -import time +#!/usr/bin/env python3 +# Copyright (c) 2015 Savoir-Faire Linux Inc. +# Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERWISE +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import time, sys from pprint import pprint from math import cos, sin, pi +sys.path.append('..') from opendht import * import numpy as np diff --git a/tools/Makefile.am b/tools/Makefile.am index e4f7a934d0da708d98622632703d2cf464a980ae..a4cf1f0850947f84f162c6d2842f8aa640d74df7 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,7 +1,3 @@ -if USE_CYTHON -SUBDIRS = python -endif - libexec_PROGRAMS = dhtnode dhtchat dhtscanner AM_CPPFLAGS = -I../include