Skip to content

Commit

Permalink
Added. Single source for package about info
Browse files Browse the repository at this point in the history
Added version information to the cli
Updated version to 0.7
  • Loading branch information
atscub committed Nov 16, 2019
1 parent b6c2a88 commit eb16c5c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
build/
dist/
*.egg-info/
.idea/

*.pyc
19 changes: 19 additions & 0 deletions nautacli/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
__all__ = [
"__name__",
"__cli__",
"__author__",
"__email__",
"__version__",
"__url__",
"__description__",
]

__name__ = "nauta-cli"
__cli__ = "nauta"
__version__ = "0.7"

__author__ = "Abraham Toledo Sanchez"
__email__ = "abrahamtoledo90@gmail.com"
__url__ = "https://github.com/abrahamtoledo/nauta-cli"

__description__ = "Utilidad en linea de comandos (CLI) para la gestion del portal cautivo Nauta de Cuba"
7 changes: 5 additions & 2 deletions nautacli/nauta.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/usr/bin/env python3

from pprint import pprint
from textwrap import dedent
from datetime import datetime

import subprocess
import requests
import argparse
import json
Expand All @@ -18,6 +16,9 @@

import logging

from .__about__ import __name__, __version__


CONFIG_DIR = os.path.expanduser("~/.local/share/nauta/")
try:
os.makedirs(CONFIG_DIR)
Expand Down Expand Up @@ -454,6 +455,8 @@ def main():
help="show debug info"
)

parser.add_argument("--version", action="version", version="{} v{}".format(__name__, __version__))

cards_parser = subparsers.add_parser('cards')
cards_parser.set_defaults(func=cards)
cards_parser.add_argument("-v",
Expand Down
39 changes: 23 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,38 @@
from os import path
from io import open


about = {}
with open("nautacli/__about__.py") as fp:
exec(fp.read(), about)


here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()

setup(
name="nauta-cli",
version=0.6,
description='Utilidad en linea de comandos (CLI) para la gestion del portal cautivo Nauta de Cuba',
long_description_content_type='text/markdown',
url='https://github.com/atscub/nauta-cli',
author='atscub',
author_email='atscubacel@yahoo.com',
name=about["__name__"],
version=about["__version__"],
description=about["__description__"],
long_description=long_description,
long_description_content_type="text/markdown",
url=about["__url__"],
author=about["__author__"],
author_email=about["__email__"],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: End Users/Desktop',
'Topic :: Internet',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python'
"Development Status :: 3 - Alpha",
"Intended Audience :: End Users/Desktop",
"Topic :: Internet",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python"
],
keywords='nauta portal cautivo',
keywords="nauta portal cautivo",
packages=find_packages(),
install_requires=['requests', 'bs4'],
install_requires=["requests", "bs4"],
entry_points = {
'console_scripts': ['nauta=nautacli:main'],
"console_scripts": [about["__cli__"] + "=nautacli:main"],
}
)

0 comments on commit eb16c5c

Please sign in to comment.