qlever 0.4.2__py3-none-any.whl → 0.4.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of qlever might be problematic. Click here for more details.
- qlever/__init__.py +2 -0
- qlever/commands/get_data.py +2 -0
- qlever/commands/setup_config.py +2 -0
- qlever/config.py +14 -11
- qlever/log.py +1 -3
- qlever/qlever_main.py +2 -0
- qlever/qlever_old.py +1476 -0
- qlever-0.4.4.dist-info/METADATA +100 -0
- {qlever-0.4.2.dist-info → qlever-0.4.4.dist-info}/RECORD +13 -12
- {qlever-0.4.2.dist-info → qlever-0.4.4.dist-info}/entry_points.txt +1 -1
- qlever-0.4.2.dist-info/METADATA +0 -301
- {qlever-0.4.2.dist-info → qlever-0.4.4.dist-info}/LICENSE +0 -0
- {qlever-0.4.2.dist-info → qlever-0.4.4.dist-info}/WHEEL +0 -0
- {qlever-0.4.2.dist-info → qlever-0.4.4.dist-info}/top_level.txt +0 -0
qlever/__init__.py
CHANGED
qlever/commands/get_data.py
CHANGED
qlever/commands/setup_config.py
CHANGED
qlever/config.py
CHANGED
|
@@ -3,8 +3,9 @@ from __future__ import annotations
|
|
|
3
3
|
import argparse
|
|
4
4
|
import os
|
|
5
5
|
import traceback
|
|
6
|
-
from pathlib import Path
|
|
7
6
|
from importlib.metadata import version
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from termcolor import colored
|
|
8
9
|
|
|
9
10
|
import argcomplete
|
|
10
11
|
|
|
@@ -115,17 +116,11 @@ class QleverConfig:
|
|
|
115
116
|
argcomplete_enabled = os.environ.get("QLEVER_ARGCOMPLETE_ENABLED")
|
|
116
117
|
if not argcomplete_enabled and not argcomplete_check_off:
|
|
117
118
|
log.info("")
|
|
118
|
-
log.warn(f"
|
|
119
|
-
f"
|
|
120
|
-
f"`.bashrc` or `.zshrc`:"
|
|
119
|
+
log.warn(f"To enable autocompletion, run the following command, "
|
|
120
|
+
f"and consider adding it to your `.bashrc` or `.zshrc`:"
|
|
121
121
|
f"\n\n"
|
|
122
122
|
f"eval \"$(register-python-argcomplete {script_name})\""
|
|
123
|
-
f" && export QLEVER_ARGCOMPLETE_ENABLED=1"
|
|
124
|
-
f"\n\n"
|
|
125
|
-
f"If autocompletion does not work for you or you don't "
|
|
126
|
-
f"want to use it, disable this warning as follows:"
|
|
127
|
-
f"\n\n"
|
|
128
|
-
f"export QLEVER_ARGCOMPLETE_CHECK_OFF")
|
|
123
|
+
f" && export QLEVER_ARGCOMPLETE_ENABLED=1")
|
|
129
124
|
log.info("")
|
|
130
125
|
|
|
131
126
|
# Create a temporary parser only to parse the `--qleverfile` option, in
|
|
@@ -180,7 +175,10 @@ class QleverConfig:
|
|
|
180
175
|
# command. We have a dedicated class for each command. These classes
|
|
181
176
|
# are defined in the modules in `qlever/commands`. In `__init__.py`
|
|
182
177
|
# an object of each class is created and stored in `command_objects`.
|
|
183
|
-
parser = argparse.ArgumentParser(
|
|
178
|
+
parser = argparse.ArgumentParser(
|
|
179
|
+
description=colored("This is the qlever command line tool, "
|
|
180
|
+
"it's all you need to work with QLever",
|
|
181
|
+
attrs=["bold"]))
|
|
184
182
|
parser.add_argument("--version", action="version",
|
|
185
183
|
version=f"%(prog)s {version('qlever')}")
|
|
186
184
|
add_qleverfile_option(parser)
|
|
@@ -198,6 +196,11 @@ class QleverConfig:
|
|
|
198
196
|
# because it is executed whenever the user triggers the autocompletion.
|
|
199
197
|
argcomplete.autocomplete(parser, always_complete_options="long")
|
|
200
198
|
|
|
199
|
+
# If called without arguments, show the help message.
|
|
200
|
+
if len(os.sys.argv) == 1:
|
|
201
|
+
parser.print_help()
|
|
202
|
+
exit(1)
|
|
203
|
+
|
|
201
204
|
# Parse the command line arguments.
|
|
202
205
|
args = parser.parse_args()
|
|
203
206
|
|
qlever/log.py
CHANGED