Skip to content
Snippets Groups Projects
Commit bca0cde6 authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA Committed by Moul
Browse files

[enh] #100: make silkaj installable from pip:

- move main in `bin/silkaj`.
- fix variable naming.
- remove requirement.txt
- add setup.py with Python 3.7 compatibility: #98.
parent 0131740f
No related branches found
No related tags found
1 merge request!80100 pip install
#!/usr/bin/env python3
from silkaj.network_tools import check_port, best_node
from silkaj.silkaj import cli, manage_cmd
if __name__ == '__main__':
ep, cli_args = cli()
check_port(ep["port"])
best_node(ep, 1)
manage_cmd(ep, cli_args)
setup.py 0 → 100644
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="silkaj",
version="0.6.0",
author="Moul",
author_email="moul@moul.re",
description="Command line client for Duniter",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://git.duniter.org/clients/python/silkaj",
license='GNU AGPLv3',
packages=setuptools.find_packages(),
keywords='g1 duniter cryptocurrency librecurrency RTM',
classifiers=(
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3 :: Only',
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
),
install_requires=[
"commandlines",
"ipaddress",
"tabulate",
"pynacl",
"scrypt",
"pyaes",
],
scripts=[
'bin/silkaj',
],
)
name = "silkaj"
#!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from sys import stderr from sys import stderr
...@@ -97,7 +96,7 @@ def cli(): ...@@ -97,7 +96,7 @@ def cli():
return ep, cli_args return ep, cli_args
def manage_cmd(ep, c): def manage_cmd(ep, cli_args):
if cli_args.subcmd == "about": if cli_args.subcmd == "about":
about() about()
...@@ -127,7 +126,7 @@ def manage_cmd(ep, c): ...@@ -127,7 +126,7 @@ def manage_cmd(ep, c):
send_transaction(ep, cli_args) send_transaction(ep, cli_args)
elif cli_args.subcmd == "cert": elif cli_args.subcmd == "cert":
send_certification(ep, c) send_certification(ep, cli_args)
elif cli_args.subcmd == "generate_auth_file": elif cli_args.subcmd == "generate_auth_file":
generate_auth_file(cli_args) generate_auth_file(cli_args)
...@@ -163,8 +162,3 @@ def about(): ...@@ -163,8 +162,3 @@ def about():
\n @@@@@@@@@@@@@@@\n") \n @@@@@@@@@@@@@@@\n")
if __name__ == '__main__':
ep, cli_args = cli()
check_port(ep["port"])
best_node(ep, 1)
manage_cmd(ep, cli_args)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment