Commit 3832f2c6 authored by Greg Harris's avatar Greg Harris
Browse files

Basic support for setup utils of LASCLI:

python setup.py install
parent c8c521b5
from glob import glob
from os.path import splitext, basename
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="lasloader",
version="0.0.7",
author="Greg Harris & Niall McDaid",
author_email="author@example.com",
description="LAS file ingest command line interface",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://community.opengroup.org/osdu/platform/data-flow/data-loading/wellbore-ddms-las-loader",
project_urls={
"Bug Tracker": "https://community.opengroup.org/osdu/platform/data-flow/data-loading/wellbore-ddms-las-loader/-/issues",
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
packages=['lasloader', 'lasloader.commands'],
package_dir={"": "src"},
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
include_package_data=True,
python_requires=">=3.9",
entry_points={"console_scripts": ["lascli=lasloader.__main__:main"]},
)
import sys
from knack import CLI
from lasloader.lascli import LasCommandLoader, LasCommandHelp
def main():
"""Main entry point for LAS LOADER"""
try:
args_list = sys.argv[1:]
lascli = CLI(cli_name="LASCLI",
commands_loader_cls=LasCommandLoader,
help_cls=LasCommandHelp)
exit_code = lascli.invoke(args_list)
sys.exit(exit_code)
except KeyboardInterrupt:
sys.exit(1)
if __name__ == "__main__":
main()
import sys
from collections import OrderedDict
from knack import CLI, ArgumentsContext
from knack import ArgumentsContext
from knack.help import CLIHelp
from knack.commands import CLICommandsLoader, CommandGroup
......@@ -151,23 +150,3 @@ class LasCommandLoader(CLICommandsLoader):
help='The base url of the OSDU instance.')
arg_context.argument('token', type=str, options_list=('-t', '--token'),
help='A valid bearer token used to authenticate with the OSDU instance.')
def main():
"""Main entry point for LAS LOADER"""
try:
args_list = sys.argv[1:]
lascli = CLI(cli_name="LASCLI",
commands_loader_cls=LasCommandLoader,
help_cls=LasCommandHelp)
exit_code = lascli.invoke(args_list)
sys.exit(exit_code)
except KeyboardInterrupt:
sys.exit(1)
if __name__ == "__main__":
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment