From 0131740fd348f3dd9c8063d544f6791f9cf105a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= <sebastien@da-rocha.net> Date: Wed, 20 Jun 2018 10:34:07 +0200 Subject: [PATCH] [mod] #100: Create a silkaj package for pip installation: - move sources in silkaj folder - import silkaj from the package - remove executable rights on silkaj/silkaj.py --- silkaj | 1 - {src => silkaj}/auth.py | 2 +- {src => silkaj}/cert.py | 12 ++++++------ {src => silkaj}/commands.py | 8 ++++---- {src => silkaj}/constants.py | 0 {src => silkaj}/license.py | 0 {src => silkaj}/money.py | 8 ++++---- {src => silkaj}/network_tools.py | 0 {src => silkaj}/silkaj.py | 19 +++++++++---------- {src => silkaj}/tools.py | 2 +- {src => silkaj}/tx.py | 12 ++++++------ {src => silkaj}/wot.py | 6 +++--- 12 files changed, 34 insertions(+), 36 deletions(-) delete mode 120000 silkaj rename {src => silkaj}/auth.py (98%) rename {src => silkaj}/cert.py (88%) rename {src => silkaj}/commands.py (97%) rename {src => silkaj}/constants.py (100%) rename {src => silkaj}/license.py (100%) rename {src => silkaj}/money.py (95%) rename {src => silkaj}/network_tools.py (100%) rename {src => silkaj}/silkaj.py (92%) mode change 100755 => 100644 rename {src => silkaj}/tools.py (98%) rename {src => silkaj}/tx.py (96%) rename {src => silkaj}/wot.py (97%) diff --git a/silkaj b/silkaj deleted file mode 120000 index 70e7362b..00000000 --- a/silkaj +++ /dev/null @@ -1 +0,0 @@ -src/silkaj.py \ No newline at end of file diff --git a/src/auth.py b/silkaj/auth.py similarity index 98% rename from src/auth.py rename to silkaj/auth.py index ba50f174..98c37571 100644 --- a/src/auth.py +++ b/silkaj/auth.py @@ -1,4 +1,4 @@ -from tools import get_publickey_from_seed, b58_decode, xor_bytes, message_exit +from silkaj.tools import get_publickey_from_seed, b58_decode, xor_bytes, message_exit from nacl import encoding import nacl.hash from scrypt import hash diff --git a/src/cert.py b/silkaj/cert.py similarity index 88% rename from src/cert.py rename to silkaj/cert.py index 4625ac26..bcd6a34f 100644 --- a/src/cert.py +++ b/silkaj/cert.py @@ -1,12 +1,12 @@ import urllib from tabulate import tabulate -from auth import auth_method -from tools import get_publickey_from_seed, message_exit, sign_document_from_seed -from network_tools import get_current_block, post_request -from license import license_approval -from constants import NO_MATCHING_ID -from wot import is_member, get_pubkey_from_id, get_pubkeys_from_id,\ +from silkaj.auth import auth_method +from silkaj.tools import get_publickey_from_seed, message_exit, sign_document_from_seed +from silkaj.network_tools import get_current_block, post_request +from silkaj.license import license_approval +from silkaj.constants import NO_MATCHING_ID +from silkaj.wot import is_member, get_pubkey_from_id, get_pubkeys_from_id,\ get_uid_from_pubkey diff --git a/src/commands.py b/silkaj/commands.py similarity index 97% rename from src/commands.py rename to silkaj/commands.py index 44265003..60a05edd 100644 --- a/src/commands.py +++ b/silkaj/commands.py @@ -5,10 +5,10 @@ from collections import OrderedDict from tabulate import tabulate from operator import itemgetter -from wot import get_uid_from_pubkey -from network_tools import discover_peers, get_request, best_node, get_current_block -from tools import convert_time, get_currency_symbol, message_exit -from constants import NO_MATCHING_ID +from silkaj.wot import get_uid_from_pubkey +from silkaj.network_tools import discover_peers, get_request, best_node, get_current_block +from silkaj.tools import convert_time, get_currency_symbol, message_exit +from silkaj.constants import NO_MATCHING_ID def currency_info(ep): diff --git a/src/constants.py b/silkaj/constants.py similarity index 100% rename from src/constants.py rename to silkaj/constants.py diff --git a/src/license.py b/silkaj/license.py similarity index 100% rename from src/license.py rename to silkaj/license.py diff --git a/src/money.py b/silkaj/money.py similarity index 95% rename from src/money.py rename to silkaj/money.py index 21e8be10..fb7e5f58 100644 --- a/src/money.py +++ b/silkaj/money.py @@ -1,7 +1,7 @@ -from network_tools import get_request, get_current_block -from tools import get_currency_symbol, get_publickey_from_seed -from auth import auth_method -from wot import check_public_key +from silkaj.network_tools import get_request, get_current_block +from silkaj.tools import get_currency_symbol, get_publickey_from_seed +from silkaj.auth import auth_method +from silkaj.wot import check_public_key def cmd_amount(ep, cli_args): diff --git a/src/network_tools.py b/silkaj/network_tools.py similarity index 100% rename from src/network_tools.py rename to silkaj/network_tools.py diff --git a/src/silkaj.py b/silkaj/silkaj.py old mode 100755 new mode 100644 similarity index 92% rename from src/silkaj.py rename to silkaj/silkaj.py index 7c95ea2b..e9e88d58 --- a/src/silkaj.py +++ b/silkaj/silkaj.py @@ -3,17 +3,16 @@ from sys import stderr from commandlines import Command -from tx import send_transaction -from money import cmd_amount -from cert import send_certification -from commands import currency_info, difficulties, set_network_sort_keys,\ +from silkaj.tx import send_transaction +from silkaj.money import cmd_amount +from silkaj.cert import send_certification +from silkaj.commands import currency_info, difficulties, set_network_sort_keys,\ network_info, argos_info, list_issuers -from tools import message_exit -from network_tools import check_port, best_node -from wot import received_sent_certifications, id_pubkey_correspondence -from auth import generate_auth_file -from license import display_license -from constants import SILKAJ_VERSION, G1_SYMBOL, GTEST_SYMBOL, G1_DEFAULT_ENDPOINT, G1_TEST_DEFAULT_ENDPOINT +from silkaj.tools import message_exit +from silkaj.wot import received_sent_certifications, id_pubkey_correspondence +from silkaj.auth import generate_auth_file +from silkaj.license import display_license +from silkaj.constants import SILKAJ_VERSION, G1_SYMBOL, GTEST_SYMBOL, G1_DEFAULT_ENDPOINT, G1_TEST_DEFAULT_ENDPOINT def usage(): diff --git a/src/tools.py b/silkaj/tools.py similarity index 98% rename from src/tools.py rename to silkaj/tools.py index 82371149..5dfb096a 100644 --- a/src/tools.py +++ b/silkaj/tools.py @@ -3,7 +3,7 @@ from nacl import encoding, signing, hash, bindings from re import compile, search from sys import exit -from constants import G1_SYMBOL, GTEST_SYMBOL +from silkaj.constants import G1_SYMBOL, GTEST_SYMBOL def convert_time(timestamp, kind): diff --git a/src/tx.py b/silkaj/tx.py similarity index 96% rename from src/tx.py rename to silkaj/tx.py index 59849f18..a102f2e4 100644 --- a/src/tx.py +++ b/silkaj/tx.py @@ -5,13 +5,13 @@ from sys import exit import urllib from tabulate import tabulate -from network_tools import get_request, post_request, get_current_block -from tools import get_currency_symbol, get_publickey_from_seed, sign_document_from_seed,\ +from silkaj.network_tools import get_request, post_request, get_current_block +from silkaj.tools import get_currency_symbol, get_publickey_from_seed, sign_document_from_seed,\ check_public_key, message_exit -from auth import auth_method -from wot import get_uid_from_pubkey -from money import get_last_ud_value, get_amount_from_pubkey -from constants import NO_MATCHING_ID +from silkaj.auth import auth_method +from silkaj.wot import get_uid_from_pubkey +from silkaj.money import get_last_ud_value, get_amount_from_pubkey +from silkaj.constants import NO_MATCHING_ID def send_transaction(ep, cli_args): diff --git a/src/wot.py b/silkaj/wot.py similarity index 97% rename from src/wot.py rename to silkaj/wot.py index 905629cb..40712cf7 100644 --- a/src/wot.py +++ b/silkaj/wot.py @@ -3,9 +3,9 @@ from time import time from tabulate import tabulate from collections import OrderedDict -from network_tools import get_request -from tools import message_exit, check_public_key, convert_time -from constants import NO_MATCHING_ID +from silkaj.network_tools import get_request +from silkaj.tools import message_exit, check_public_key, convert_time +from silkaj.constants import NO_MATCHING_ID def get_sent_certifications(certs, time_first_block, params): -- GitLab